我只在Firefox中使用Stripe连接时遇到问题,Chrome工作正常。
当我尝试将卡信息发送到Firefox中的Stripe(最新版本)时,它告诉我:
ReferenceError: stripeResponseHandler is not defined
代码:
<script type="text/javascript" src="../js/v2"></script>
.....
.....
// set publish key for stripe
Stripe.setPublishableKey('myToken');
// validate information
Stripe.card.createToken({
number: $('.cardnumber').val(),
cvc: $('.cw').val(),
exp_month: $('.expmonth option:selected').val(),
exp_year: $('.expyear option:selected').val(),
name: $(".cardholderfullname").val(),
address_line1: $(".address").val(),
address_city: $(".city").val(),
address_state: $("#state option:selected").val(),
address_zip: $(".zipcode").val()
}, stripeResponseHandler);
// error handling and success sending
function stripeResponseHandler(status, response) {
if (response.error) {
$("#message").fadeIn();
$("#message").html("The card information you entered was not valid, please check to make sure all information is correct.");
} else {
sendArray.token = response['id'];
$(sendArray).serialize();
//console.log(sendArray);
$.ajax({
type: "POST",
dataType: "JSON",
url: '../member/functions/stripeAcc/makeCustomer.php',
data: sendArray ,
success: function(response) {
}
});
closeDialogBox();
}
}
..... more
建议和想法?