File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import buckarooClient from '../buckarooClient' ;
2+ import { uniqid } from '../../src' ;
3+
4+ const twint = buckarooClient . method ( 'twint' ) ;
5+
6+ //Pay
7+ twint
8+ . pay ( {
9+ currency : 'CHF' ,
10+ amountDebit : 10.1 ,
11+ invoice : uniqid ( ) ,
12+ description : 'Twint Payment' ,
13+ } )
14+ . request ( ) ;
15+ //Refund
16+ twint
17+ . refund ( {
18+ originalTransactionKey : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ,
19+ amountCredit : 10.1 ,
20+ invoice : uniqid ( ) ,
21+ description : 'Twint Refund' ,
22+ } )
23+ . request ( ) ;
Original file line number Diff line number Diff line change 1+ import buckarooClient from '../buckarooClient' ;
2+ import { uniqid } from '../../src/Utils' ;
3+
4+ const twint = buckarooClient . method ( 'twint' ) ;
5+
6+ //Pay
7+ twint
8+ . pay ( {
9+ currency : 'CHF' ,
10+ amountDebit : 10.1 ,
11+ invoice : uniqid ( ) ,
12+ description : 'Twint Payment' ,
13+ } )
14+ . request ( ) ;
15+ //Refund
16+ twint
17+ . refund ( {
18+ originalTransactionKey : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ,
19+ amountCredit : 10.1 ,
20+ invoice : uniqid ( ) ,
21+ description : 'Twint Refund' ,
22+ } )
23+ . request ( ) ;
Original file line number Diff line number Diff line change 1+ import { PayablePaymentMethod } from '../../Services' ;
2+ import { ServiceCode } from '../../Utils' ;
3+
4+ export default class Twint extends PayablePaymentMethod {
5+ public defaultServiceCode ( ) : ServiceCode {
6+ return 'twint' ;
7+ }
8+ }
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export { default as surepay } from './Surepay';
8484export { default as thunes } from './Thunes' ;
8585export { default as alipay } from './Alipay' ;
8686export { default as trustly } from './Trustly' ;
87+ export { default as twint } from './Twint' ;
8788export { default as wechatpay } from './WeChatPay' ;
8889export { default as In3 } from './In3' ;
8990export { default as noservice } from './NoService' ;
Original file line number Diff line number Diff line change 1+ import buckarooClientTest from '../BuckarooClient.test' ;
2+ import { IRefundRequest , PaymentMethodInstance } from '../../src' ;
3+ import { createRefundPayload } from '../Payloads' ;
4+
5+ let method : PaymentMethodInstance < 'twint' > ;
6+
7+ beforeEach ( ( ) => {
8+ method = buckarooClientTest . method ( 'twint' ) ;
9+ } ) ;
10+
11+ describe ( 'testing methods' , ( ) => {
12+ test ( 'Pay Simple Payload' , async ( ) => {
13+ const response = await method
14+ . pay ( {
15+ amountDebit : 100 ,
16+ currency : 'CHF' ,
17+ } )
18+ . request ( ) ;
19+ expect ( response . isPendingProcessing ( ) ) . toBeTruthy ( ) ;
20+ } ) ;
21+
22+ test ( 'Refund' , async ( ) => {
23+ const response = await method
24+ . refund (
25+ createRefundPayload < IRefundRequest > ( {
26+ originalTransactionKey : '1B649F2796AA466F8D8AE695XXXXXXXX' ,
27+ } )
28+ )
29+ . request ( ) ;
30+ expect ( response . isSuccess ( ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
You can’t perform that action at this time.
0 commit comments