add country checking for stripe charges

This commit is contained in:
Nathan Coad
2016-07-23 12:00:46 +10:00
parent 9e26b69edf
commit 3cbb0334c3
2 changed files with 17 additions and 8 deletions

View File

@@ -7,11 +7,12 @@ jQuery(document).ready(function($) {
locale: 'auto',
token: function(token) {
try {
//store the returned token into hidden form elements
//store relevant parts of the returned token into hidden form elements
$(':input[name="token_id"]', $stripeForm).val(token.id);
$(':input[name="token_email"]', $stripeForm).val(token.email);
$(':input[name="token_client_ip"]', $stripeForm).val(token.client_ip);
$(':input[name="card_brand"]', $stripeForm).val(token.card.brand);
$(':input[name="card_country"]', $stripeForm).val(token.card.country);
$(':input[name="card_cvc_check"]', $stripeForm).val(token.card.cvc_check);
$(':input[name="card_address_zip_check"]', $stripeForm).val(token.card.address_zip_check);
$stripeForm.get(0).submit();