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
Browser and OS: Chrome 99.0.4844.51 (64-bit) on MacOS 12.2.1
Issue description
Zero amount verification throws error when numeric type is used:
.verifyCard({
amount: 0,
...
}, ...)
String type is working, but is not compatible with types/braintree-web definitions.
.verifyCard({
amount: '0',
...
}, ...)
Error:
{name: 'BraintreeError', code: 'THREEDS_MISSING_VERIFY_CARD_OPTION', message: 'verifyCard options must include an amount.', type: 'MERCHANT', details: undefined}
Problem is in braintree-web/three-d-secure/external/frameworks/base.js file:
Probably if(!options.amount) should be changed to null|undefined === condition .
if (this._verifyCardInProgress === true) {
return new BraintreeError(errors.THREEDS_AUTHENTICATION_IN_PROGRESS);
} else if (!options.nonce) {
errorOption = 'a nonce';
} else if (!options.amount) {
errorOption = 'an amount';
}
The text was updated successfully, but these errors were encountered:
Hello @puniserv , thanks for bringing this to our attention. I do see that our check is erroneously throwing the THREEDS_MISSING_VERIFY_CARD_OPTION error and we can look to get this fixed. However, this amount is supposed to reflect the transaction amount and a zero dollar transaction will result in a 94505: The amount you specified must be a number greater than 0. Can you explain your use case for zero-dollar verifications so we can best prioritize this fix?
@jplukarski not really. You can process card verification with 0 amount. We are using this when client is adding card to our system and 0 amount does not cause 94505: The amount you specified must be a number greater than 0. error
Ran into this as well and had to use yarn patch to remove the option checks. Would be better if instead of inverted truthy value (where 0 is false), it just checked that is of type Number.
General information
Issue description
Zero amount verification throws error when numeric type is used:
String type is working, but is not compatible with types/braintree-web definitions.
Error:
Problem is in
braintree-web/three-d-secure/external/frameworks/base.js
file:Probably
if(!options.amount)
should be changed to null|undefined === condition .The text was updated successfully, but these errors were encountered: