Coffeescript 提交时条带处理错误,尽管事务已成功
我无法理解为什么我在提交表格时从Stripe中收到此错误: 向我们的安全信用卡处理程序提交您的信用卡时发生意外错误。这可能是由于网络连接问题造成的,因此您应该再试一次,您不会被收取两次费用。如果此问题仍然存在,请告知我们 但是,事务处理成功 我的代码与示例表单不同,只是因为我正在使用Parsely验证代码,并且仅当表单的其余部分有效时才希望生成令牌:Coffeescript 提交时条带处理错误,尽管事务已成功,coffeescript,stripe-payments,Coffeescript,Stripe Payments,我无法理解为什么我在提交表格时从Stripe中收到此错误: 向我们的安全信用卡处理程序提交您的信用卡时发生意外错误。这可能是由于网络连接问题造成的,因此您应该再试一次,您不会被收取两次费用。如果此问题仍然存在,请告知我们 但是,事务处理成功 我的代码与示例表单不同,只是因为我正在使用Parsely验证代码,并且仅当表单的其余部分有效时才希望生成令牌: if $(".error-block").length > 0 && $(".error-block").html(
if $(".error-block").length > 0 && $(".error-block").html() != ''
$.scrollTo($(".error-block"))
Stripe.setPublishableKey($('#stripe_key').val())
stripeResponseHandler = (status, response) ->
if response.error
$(".error-block").text(response.error.message)
$('#join-button').attr("disabled", false).removeClass('disable').html('Join')
else
$form = $('#user_new')
token = response['id']
$('#user_stripe_token').val(token)
$('#user_card_number').val('')
$('#user_card_cvc').val('')
$('#user_card_expiry_month').val('')
$('#user_card_expiry_year').val('')
$form.get(0).submit()
$('#user_new').submit ->
valid = $(@).parsley().isValid()
if valid != false
$('#join-button').attr("disabled", true).addClass('disable').html('Please wait...')
Stripe.card.createToken({
number: $('#user_card_number').val(),
cvc: $('#user_card_cvc').val(),
exp_month: $('#user_card_expiry_month').val(),
exp_year: $('#user_card_expiry_year').val()
name: $('#user_first_name').val() + " " + $('#user_last_name').val()
}, stripeResponseHandler)
return false
return false
你知道我哪里出了问题吗?是否$form.get0.submit会将你送回你的$user\u new.submit->函数?我是否缺少一些东西,让您的提交处理程序告诉浏览器它可以将表单提交到服务器?@muistooshort-mmm很好!!将检查