So I think you should do two things. First, make sure you're setting your currency correctly and not simply overriding the label. Because your code sample actually isn't complete, it's tough for me to say what's going wrong. My guess is that your little math script is going wonky though.
I'd recommend separating the math out and putting it into a separate section for calculation and using the Custom Checkout Integration [1] as opposed to the Basic Checkout Integration.
[1] https://stripe.com/docs/checkout#integration-custom
Original:
<form action="/user/dashboard/releases/card/{$release->releaseFrontID}/" method="POST" class="stripe-container"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="REMOVED" data-amount="{math equation='x * 100' x=$release->releaseGrandTotal}"
Recommended:
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton">Purchase</button>
<script>
var amount = 100 * {$release->releaseGrandTotal};
console.log('Amount >> ' + amount);
var handler = StripeCheckout.configure({
key: 'pk_test_xxx',
locale: 'auto',
currency: 'gbp',
amount: amount,
token: function(token) {
$.post(
"/user/dashboard/releases/card/{$release->releaseFrontID}/",
{
stripeToken: token.id,
stripeAmount: amount,
stripeEmail: token.email
}, function (data, status) {
// request succeeded, do something
}
);
}
});
$('#customButton').on('click', function(e) {
// Open Checkout with further options:
handler.open({
name: 'Company Name',
description: 'Charge Description'
});
e.preventDefault();
});
// Close Checkout on page navigation:
$(window).on('popstate', function() {
handler.close();
});
</script>
Once you've done that, it should be obvious where the problem is happening. Is this a Smarty template? Have you considered passing the amount as part of the context, rather than doing some kind of math equation in the templating language?