diff --git a/src/payment/data/handleRequestError.js b/src/payment/data/handleRequestError.js index 5a2a0a9bd..4ac221542 100644 --- a/src/payment/data/handleRequestError.js +++ b/src/payment/data/handleRequestError.js @@ -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([ {