-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
44 lines (37 loc) · 1.24 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var RNMy2c2pSdk = require('react-native').NativeModules.RNMy2c2pSdk;
module.exports = {
init: function(privateKey, production) {
RNMy2c2pSdk.setup(privateKey, production);
},
requestPayment: function(params) {
var payment = Object.assign({}, defaultPaymentRequest, params);
return RNMy2c2pSdk.requestPayment(payment);
},
requestRecurringPayment: function(params) {
var payment = Object.assign({}, defaultPaymentRequest, params);
return RNMy2c2pSdk.requestRecurringPayment(payment);
},
requestInstallmentPayment: function(params) {
var payment = Object.assign({}, defaultPaymentRequest, params);
return RNMy2c2pSdk.requestInstallmentPayment(payment);
},
requestAlternativePayment: function(params) {
var payment = Object.assign({}, defaultPaymentRequest, params);
return RNMy2c2pSdk.requestAlternativePayment(payment);
},
requestPaymentChannel: function(params) {
var payment = Object.assign({}, defaultPaymentRequest, params);
return RNMy2c2pSdk.requestPaymentChannel(payment);
}
};
const defaultPaymentRequest = {
request3DS: 'Y',
paymentUI: false,
storeCard: false,
payCategoryID: '',
userDefined1: '',
userDefined2: '',
userDefined3: '',
userDefined4: '',
userDefined5: ''
};