Commit fee1fee0 authored by Your Name's avatar Your Name

fix: add proper success/error notifications for payment gateway configuration save

parent 34e90e63
...@@ -732,12 +732,22 @@ function savePaymentGateways() { ...@@ -732,12 +732,22 @@ function savePaymentGateways() {
}, },
body: JSON.stringify(gatewaysData) body: JSON.stringify(gatewaysData)
}) })
.then(response => response.json()) .then(response => {
if (!response.ok) {
throw new Error('Failed to save payment gateway configuration');
}
return response.json();
})
.then(result => { .then(result => {
showToast('Payment gateway configuration saved successfully', 'success'); if (result.success) {
showToast('Payment gateway configuration saved successfully', 'success');
} else {
showToast(result.error || 'Error saving payment gateway configuration', 'danger');
}
}) })
.catch(error => { .catch(error => {
showToast('Error saving payment gateway configuration', 'danger'); console.error('Error saving payment gateways:', error);
showToast('Error saving payment gateway configuration: ' + error.message, 'danger');
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment