@funnelsgrove/payments 0.11.18 → 0.11.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,7 +45,8 @@ export const classifyCheckoutFailure = (input) => {
45
45
  const providerErrorType = asNonEmptyString(input.providerErrorType);
46
46
  if (input.provider === 'stripe' && (Boolean(providerDeclineCode)
47
47
  || providerErrorType === 'card_error'
48
- || (providerErrorCode ? STRIPE_PAYMENT_REJECTION_CODES.has(providerErrorCode) : false))) {
48
+ || (providerErrorCode ? STRIPE_PAYMENT_REJECTION_CODES.has(providerErrorCode) : false)
49
+ || /card has insufficient funds/i.test(input.errorMessage))) {
49
50
  return 'payment_rejection';
50
51
  }
51
52
  const message = input.errorMessage.trim();
@@ -57,7 +58,8 @@ export const classifyCheckoutFailure = (input) => {
57
58
  return 'network_failure';
58
59
  }
59
60
  if (/(?:email|card number|expiration|expiry|cvc|zip|postal code|billing address|country).*(?:required|incomplete|incorrect|invalid|unsupported)/i.test(message)
60
- || /(?:required|incomplete|incorrect|invalid|unsupported).*(?:email|card number|expiration|expiry|cvc|zip|postal code|billing address|country)/i.test(message)) {
61
+ || /(?:required|incomplete|incorrect|invalid|unsupported).*(?:email|card number|expiration|expiry|cvc|zip|postal code|billing address|country)/i.test(message)
62
+ || /(?:enter|provide|use) a valid email(?: address)?/i.test(message)) {
61
63
  return 'validation_failure';
62
64
  }
63
65
  return 'platform_failure';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/payments",
3
- "version": "0.11.18",
3
+ "version": "0.11.20",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",