Skip to content
Snippets Groups Projects
Commit 3916e309 authored by dmunio's avatar dmunio Committed by mattwire
Browse files

Fix error when making a payment with a currency other than the default...

Fix error when making a payment with a currency other than the default currency. #230
parent 10084281
No related branches found
No related tags found
1 merge request!1246.5
......@@ -205,7 +205,7 @@
$.post(url, {
payment_method_id: result.paymentMethod.id,
amount: CRM.payment.getTotalAmount().toFixed(2),
currency: CRM.vars.stripe.currency,
currency: getCurrency(),
id: CRM.vars.stripe.id,
description: document.title,
csrfToken: CRM.vars.stripe.csrfToken
......@@ -625,6 +625,19 @@
return submit;
}
/**
* Get currency on the form
* @returns {currency}
*/
function getCurrency() {
if (document.getElementById('currency')) {
return document.getElementById("currency").value;
}
else {
return CRM.vars.stripe.currency;
}
}
function cardElementChanged(event) {
if (event.empty) {
$('div#card-errors').hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment