woocommerce-paypal-payments/modules/ppcp-applepay/resources/js/Helper/applePayError.js

13 lines
349 B
JavaScript
Raw Normal View History

2024-07-12 12:58:34 +02:00
export function createAppleErrors( errors ) {
const errorList = [];
for ( const error of errors ) {
const { contactField = null, code = null, message = null } = error;
const appleError = contactField
? new ApplePayError( code, contactField, message )
: new ApplePayError( code );
errorList.push( appleError );
}
2024-07-12 12:58:34 +02:00
return errorList;
}