mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 04:58:28 +08:00
12 lines
349 B
JavaScript
12 lines
349 B
JavaScript
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 );
|
|
}
|
|
|
|
return errorList;
|
|
}
|