mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Merge pull request #1035 from woocommerce/pcp-1036-fix-dcc-messages
Fix DCC error messages handling
This commit is contained in:
commit
67559a0492
2 changed files with 9 additions and 3 deletions
|
@ -59,9 +59,9 @@ class CheckoutActionHandler {
|
|||
);
|
||||
} else {
|
||||
errorHandler.clear();
|
||||
if (data.data.errors.length > 0) {
|
||||
if (data.data.errors?.length > 0) {
|
||||
errorHandler.messages(data.data.errors);
|
||||
} else if (data.data.details.length > 0) {
|
||||
} else if (data.data.details?.length > 0) {
|
||||
errorHandler.message(data.data.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
|
||||
} else {
|
||||
errorHandler.message(data.data.message, true);
|
||||
|
|
|
@ -233,8 +233,14 @@ class CreditCardRenderer {
|
|||
this.spinner.unblock();
|
||||
this.errorHandler.clear();
|
||||
|
||||
if (err.details?.length) {
|
||||
if (err.data?.details?.length) {
|
||||
this.errorHandler.message(err.data.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
|
||||
} else if (err.details?.length) {
|
||||
this.errorHandler.message(err.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
|
||||
} else if (err.data?.errors?.length > 0) {
|
||||
this.errorHandler.messages(err.data.errors);
|
||||
} else if (err.data?.message) {
|
||||
this.errorHandler.message(err.data.message, true);
|
||||
} else if (err.message) {
|
||||
this.errorHandler.message(err.message, true);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue