Skip to content

Commit

Permalink
fix: Update comment on contry compatibility error
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed May 2, 2024
1 parent 30c45e6 commit eef052d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/payment/data/handleRequestError.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,18 @@ export default function handleRequestError(error) {
]);
}

// Country not DPM compatible
// Country not DPM compatible Stripe error
// Note: with Affirm, if the billing country is not supported, it will not fail at the Stripe level,
// for which we have form validation in place to avoid that, instead of erroring at the Affirm payment environment.
// For other BNPL, Stripe will give the below error if the country is not compatible and/or
// if the state and/or postal code are missing.
// There is country and state validation at the form level, but the below error handling
// is a fallback if the form validation does not catch the country incompatibility.
const billingAddressErrors = [
'payment_method_data[billing_details][address][country]',
'payment_method_data[billing_details][address][state]',
'payment_method_data[billing_details][address][postal_code]',
'billing_details[address][country]',
'billing_details[address][state]',
'billing_details[address][postal_code]',
];
Expand Down

0 comments on commit eef052d

Please sign in to comment.