Skip to content

Commit

Permalink
refactor: handleRequestError DPM country not compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed May 1, 2024
1 parent d0bb730 commit 30c45e6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/payment/data/handleRequestError.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ export default function handleRequestError(error) {
}

// Country not DPM compatible
if (error.type === 'invalid_request_error' && (
error.param === 'payment_method_data[billing_details][address][country]' || error.param === 'billing_details[address][state]' || error.param === 'billing_details[address][postal_code]'
)) {
const billingAddressErrors = [
'payment_method_data[billing_details][address][country]',
'billing_details[address][state]',
'billing_details[address][postal_code]',
];

if (error.type === 'invalid_request_error' && billingAddressErrors.includes(error.param)) {
logInfo('Dynamic Payment Method Country Error', error.param);
handleApiErrors([
{
Expand Down

0 comments on commit 30c45e6

Please sign in to comment.