xendit-node
Advanced tools
Comparing version 1.21.1 to 1.21.2
@@ -5,3 +5,8 @@ const x = require('./xendit.test'); | ||
const ro = new RetailOutlet({}); | ||
function sleepFor(sleepDuration) { | ||
var now = new Date().getTime(); | ||
while (new Date().getTime() < now + sleepDuration) { | ||
/* Do nothing */ | ||
} | ||
} | ||
module.exports = function() { | ||
@@ -15,4 +20,10 @@ return ro | ||
}) | ||
.then(({ id }) => ro.getFixedPaymentCode({ id })) | ||
.then(({ id }) => ro.updateFixedPaymentCode({ id: id, expectedAmt: 12000 })) | ||
.then(({ id }) => { | ||
sleepFor(3000); | ||
return ro.getFixedPaymentCode({ id }); | ||
}) | ||
.then(({ id }) => { | ||
sleepFor(3000); | ||
return ro.updateFixedPaymentCode({ id: id, expectedAmt: 12000 }); | ||
}) | ||
.then(({ id, payment_code }) => | ||
@@ -28,3 +39,6 @@ Promise.all([ | ||
) | ||
.then(([id]) => ro.getPaymentsByFixedPaymentCodeId({ id })) | ||
.then(([id]) => { | ||
sleepFor(3000); | ||
return ro.getPaymentsByFixedPaymentCodeId({ id }); | ||
}) | ||
.then(() => { | ||
@@ -31,0 +45,0 @@ // eslint-disable-next-line no-console |
{ | ||
"name": "xendit-node", | ||
"version": "1.21.1", | ||
"version": "1.21.2", | ||
"description": "NodeJS client for Xendit API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1305,2 +1305,3 @@ # Xendit API Node.js Client | ||
properties?: DebitCardProperties | OnlineBankingAccessProperties; | ||
device?: object; | ||
metadata?: object; | ||
@@ -1359,2 +1360,3 @@ }); | ||
basket?: Basket[]; | ||
device?: object; | ||
metadata?: object; | ||
@@ -1361,0 +1363,0 @@ }); |
@@ -25,2 +25,3 @@ interface Basket { | ||
basket?: Basket[]; | ||
device?: object; | ||
metadata?: object; | ||
@@ -27,0 +28,0 @@ }): Promise<object>; |
@@ -30,2 +30,3 @@ const { Validate, Auth, fetchWithHTTPErr, promWithJsErr } = require('../utils'); | ||
description: data.description, | ||
device: data.channelCode === 'BCA_ONEKLIK' ? data.device : undefined, | ||
basket: data.basket | ||
@@ -32,0 +33,0 @@ ? data.basket.map(product => ({ |
@@ -15,2 +15,3 @@ enum ChannelCode { | ||
successRedirectURL: string; | ||
accountMobileNumber?: string; | ||
failureRedirectURL?: string; | ||
@@ -24,2 +25,3 @@ callbackURL?: string; | ||
properties?: DebitCardProperties | OnlineBankingAccessProperties; | ||
device?: object; | ||
metadata?: object; | ||
@@ -26,0 +28,0 @@ }): Promise<object>; |
@@ -17,16 +17,5 @@ const { Validate, Auth, fetchWithHTTPErr, promWithJsErr } = require('../utils'); | ||
channel_code: data.channelCode, | ||
properties: | ||
data.channelCode === 'DC_BRI' | ||
? { | ||
account_mobile_number: data.properties.accountMobileNumber, | ||
card_last_four: data.properties.cardLastFour, | ||
card_expiry: data.properties.cardExpiry, | ||
account_email: data.properties.accountEmail, | ||
} | ||
: { | ||
success_redirect_url: data.properties.successRedirectURL, | ||
failure_redirect_url: data.properties.failureRedirectURL, | ||
callback_url: data.properties.callbackURL, | ||
}, | ||
properties: getProperties(data), | ||
metadata: data.metadata, | ||
device: data.device, | ||
}), | ||
@@ -39,2 +28,27 @@ }) | ||
function getProperties(data) { | ||
if (data.channelCode === 'DC_BRI') { | ||
return { | ||
account_mobile_number: data.properties.accountMobileNumber, | ||
card_last_four: data.properties.cardLastFour, | ||
card_expiry: data.properties.cardExpiry, | ||
account_email: data.properties.accountEmail, | ||
}; | ||
} else if (data.channelCode === 'BCA_ONEKLIK') { | ||
return { | ||
account_mobile_number: data.properties.accountMobileNumber, | ||
success_redirect_url: data.properties.successRedirectURL, | ||
failure_redirect_url: data.properties.failureRedirectURL, | ||
callback_url: data.properties.callbackURL, | ||
}; | ||
} else { | ||
return { | ||
account_mobile_number: data.properties.accountMobileNumber, | ||
success_redirect_url: data.properties.successRedirectURL, | ||
failure_redirect_url: data.properties.failureRedirectURL, | ||
callback_url: data.properties.callbackURL, | ||
}; | ||
} | ||
} | ||
function validateOTPforLinkedAccount(data) { | ||
@@ -41,0 +55,0 @@ return promWithJsErr((resolve, reject) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
247650
6863
1616