You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am trying payment with decimal number line 70.1, 70.9, 1230.1, 1230.9. I am getting following payment error. It is working on all other cases.
"508 Invalid characters in AMOUNT field. Please contact the merchant."
This is current code for payment gateway integration.
`
const PaymentService = require("globalpayments-api");
const config = new PaymentService.ServicesConfig();
config.hostedPaymentConfig = new PaymentService.HostedPaymentConfig();
config.hostedPaymentConfig.displaySavedCards = true;
// config.hostedPaymentConfig.cardStorageEnabled = true;
config.merchantId = conf.globalpayment.merchantId;
config.channel = conf.globalpayment.channel;
config.accountId = conf.globalpayment.accountId;
config.sharedSecret = conf.globalpayment.sharedSecret;
config.serviceUrl = conf.globalpayment.serviceUrl;
const hostedPaymentData = new PaymentService.HostedPaymentData();
hostedPaymentData.customerKey = consumerData.paymentGatewayId;
hostedPaymentData.customerExists = true;
hostedPaymentData.offerToSaveCard = true;
console.log(hostedPaymentData);
try {
const service = new PaymentService.HostedService(config);
console.log(service);
var vv = service
.authorize(1)
.withCurrency('CAD')
.withOrderId(orderId)
.withHostedPaymentData(hostedPaymentData);
console.log(vv)
let responseStr = service
.authorize(1)
.withCurrency('CAD')
.withOrderId(orderId)
.withHostedPaymentData(hostedPaymentData)
.withAmount(amount)
.serialize();
console.log(responseStr);
console.log(typeof responseStr);
let response = JSON.parse(responseStr);
} catch (error) {
console.log(error);
}
`
When I checked out the response, I am getting amount in response like 123090.00000000001.So this look like Library floating point mechanism for amount creating issue.
The text was updated successfully, but these errors were encountered:
@kuldeep-k Apologies here. We have a commit that fixes this, but it seems it was never merged in. I will work with our internal teams to get this corrected and will follow up as soon as it's available via NPM. In the meantime, you should be able to reference this commit from your package.json file to leverage this fix.
When I am trying payment with decimal number line 70.1, 70.9, 1230.1, 1230.9. I am getting following payment error. It is working on all other cases.
"508 Invalid characters in AMOUNT field. Please contact the merchant."
This is current code for payment gateway integration.
`
`
When I checked out the response, I am getting amount in response like 123090.00000000001.So this look like Library floating point mechanism for amount creating issue.
The text was updated successfully, but these errors were encountered: