display both WC and own messages

This commit is contained in:
Kirill Braslavsky 2021-03-02 19:41:18 +02:00
parent a256cc6d53
commit 223aa6493d

View file

@ -39,7 +39,9 @@ class CheckoutActionHandler {
}).then(function (data) { }).then(function (data) {
if (!data.success) { if (!data.success) {
spinner.unblock(); spinner.unblock();
errorHandler.message(data.data.message, true); //handle both messages sent from Woocommerce (data.messages) and this plugin (data.data.message)
const message = typeof(data.messages) !== 'undefined' ? data.messages : data.data.message;
errorHandler.message(message, true);
return; return;
} }
const input = document.createElement('input'); const input = document.createElement('input');