mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
10 lines
356 B
JavaScript
10 lines
356 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
|
|
}
|