File tree Expand file tree Collapse file tree 5 files changed +33
-3
lines changed
Expand file tree Collapse file tree 5 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ CHANGELOG
66
77* Added ` Securepay ` to the ` Processor ` enum.
88* Added ` CreditApplication ` and ` FundTransfer ` to the ` EventType ` enum.
9+ * Added the input ` /event/party ` . This is the party submitting the
10+ transaction. You may provide this by providing ` party ` to ` Event ` .
911
10128.1.0 (2025-05-23)
1113------------------
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ try {
181181 ipAddress: " 81.2.69.160" ,
182182 }),
183183 event : new minFraud.Event ({
184+ party: minFraud .Constants .EventParty .Customer ,
184185 shopId: ' shop' ,
185186 time: new Date (Date .now ()),
186187 transactionId: ' txn1234' ,
Original file line number Diff line number Diff line change 1+ export enum EventParty {
2+ Agent = 'agent' ,
3+ Customer = 'customer' ,
4+ }
5+
16export enum EventType {
27 AccountCreation = 'account_creation' ,
38 AccountLogin = 'account_login' ,
Original file line number Diff line number Diff line change 11import Event from './event' ;
2- import { EventType } from '../constants' ;
2+ import { EventParty , EventType } from '../constants' ;
33
44describe ( 'Event()' , ( ) => {
55 it ( 'sets `time` to now by default' , ( ) => {
@@ -31,4 +31,20 @@ describe('Event()', () => {
3131
3232 expect ( event . type ) . toEqual ( EventType . FundTransfer ) ;
3333 } ) ;
34+
35+ it ( 'accepts agent party' , ( ) => {
36+ const event = new Event ( {
37+ party : EventParty . Agent ,
38+ } ) ;
39+
40+ expect ( event . party ) . toEqual ( EventParty . Agent ) ;
41+ } ) ;
42+
43+ it ( 'accepts customer party' , ( ) => {
44+ const event = new Event ( {
45+ party : EventParty . Customer ,
46+ } ) ;
47+
48+ expect ( event . party ) . toEqual ( EventParty . Customer ) ;
49+ } ) ;
3450} ) ;
Original file line number Diff line number Diff line change 1- import { EventType } from '../constants' ;
1+ import { EventParty , EventType } from '../constants' ;
22
33interface EventProps {
4+ /**
5+ * The party submitting the transaction.
6+ */
7+ party ?: EventParty ;
48 /**
59 * Your internal ID for the transaction. We can use this to locate a specific
610 * transaction in our logs, and it will also show up in email alerts and
@@ -27,13 +31,15 @@ interface EventProps {
2731 * Event information for the transaction being sent to the web service.
2832 */
2933export default class Event implements EventProps {
34+ /** @inheritDoc EventProps.party */
35+ public party ?: EventParty ;
3036 /** @inheritDoc EventProps.transactionId */
3137 public transactionId ?: string ;
3238 /** @inheritDoc EventProps.shopId */
3339 public shopId ?: string ;
3440 /** @inheritDoc EventProps.time */
3541 public time ?: Date ;
36- /** @inheritDoc EventProps.EventType */
42+ /** @inheritDoc EventProps.type */
3743 public type ?: EventType ;
3844
3945 public constructor ( minfraudEvent : EventProps ) {
You can’t perform that action at this time.
0 commit comments