File tree Expand file tree Collapse file tree 5 files changed +49
-1
lines changed
Expand file tree Collapse file tree 5 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ CHANGELOG
88* Added ` CreditApplication ` and ` FundTransfer ` to the ` EventType ` enum.
99* Added the input ` /event/party ` . This is the party submitting the
1010 transaction. You may provide this by providing ` party ` to ` Event ` .
11+ * Added the input ` /payment/method ` . This is the payment method associated
12+ with the transaction. You may provide this by providing ` method ` to
13+ ` Payment ` .
1114
12158.1.0 (2025-05-23)
1316------------------
Original file line number Diff line number Diff line change @@ -224,6 +224,7 @@ try {
224224 }),
225225 payment: new minFraud.Payment ({
226226 declineCode: ' A' ,
227+ method: minFraud .Constants .PaymentMethod .Card ,
227228 processor: minFraud .Constants .Processor .ConceptPayments ,
228229 wasAuthorized: true ,
229230 }),
Original file line number Diff line number Diff line change @@ -24,6 +24,19 @@ export enum DeliverySpeed {
2424 Standard = 'standard' ,
2525}
2626
27+ export enum PaymentMethod {
28+ BankDebit = 'bank_debit' ,
29+ BankRedirect = 'bank_redirect' ,
30+ BankTransfer = 'bank_transfer' ,
31+ BuyNowPayLater = 'buy_now_pay_later' ,
32+ Card = 'card' ,
33+ Crypto = 'crypto' ,
34+ DigitalWallet = 'digital_wallet' ,
35+ GiftCard = 'gift_card' ,
36+ RealTimePayment = 'real_time_payment' ,
37+ Rewards = 'rewards' ,
38+ }
39+
2740export enum Processor {
2841 Adyen = 'adyen' ,
2942 Affirm = 'affirm' ,
Original file line number Diff line number Diff line change 11import Payment from './payment' ;
2+ import { PaymentMethod } from '../constants' ;
23
34describe ( 'Payment()' , ( ) => {
45 it ( 'constructs' , ( ) => {
@@ -8,4 +9,28 @@ describe('Payment()', () => {
89 } ) ;
910 } ) . not . toThrow ( ) ;
1011 } ) ;
12+
13+ it ( 'accepts card payment method' , ( ) => {
14+ const payment = new Payment ( {
15+ method : PaymentMethod . Card ,
16+ } ) ;
17+
18+ expect ( payment . method ) . toEqual ( PaymentMethod . Card ) ;
19+ } ) ;
20+
21+ it ( 'accepts crypto payment method' , ( ) => {
22+ const payment = new Payment ( {
23+ method : PaymentMethod . Crypto ,
24+ } ) ;
25+
26+ expect ( payment . method ) . toEqual ( PaymentMethod . Crypto ) ;
27+ } ) ;
28+
29+ it ( 'accepts digital_wallet payment method' , ( ) => {
30+ const payment = new Payment ( {
31+ method : PaymentMethod . DigitalWallet ,
32+ } ) ;
33+
34+ expect ( payment . method ) . toEqual ( PaymentMethod . DigitalWallet ) ;
35+ } ) ;
1136} ) ;
Original file line number Diff line number Diff line change 1- import { Processor } from '../constants' ;
1+ import { PaymentMethod , Processor } from '../constants' ;
22
33interface PaymentProps {
4+ /**
5+ * The payment method associated with the transaction.
6+ */
7+ method ?: PaymentMethod ;
48 /**
59 * The payment processor used for the transaction.
610 */
@@ -21,6 +25,8 @@ interface PaymentProps {
2125 * The payment information for the transaction being sent to the web service.
2226 */
2327export default class Payment implements PaymentProps {
28+ /** @inheritDoc PaymentProps.method */
29+ public method ?: PaymentMethod ;
2430 /** @inheritDoc PaymentProps.processor */
2531 public processor ?: Processor ;
2632 /** @inheritDoc PaymentProps.wasAuthorized */
You can’t perform that action at this time.
0 commit comments