我遵循本指南(https://mikesabat.wordpress.com/2013/12/15/making-users-pay-building-a-site-with-strip-and-devise/),除了將條紋庫更改爲v2而不是v1以外,無需任何修改。條紋用戶令牌問題
基本上,我的問題是,stripe_card_token領域節省開始tok_BLAHBLAHBLAH的值,而在條紋儀表盤,每個客戶都有類似cus_BLAHBLAHBLAH令牌。
我的javascript返回條紋令牌和填充到一個隱藏字段:
handleStripeResponse: (status, response) ->
if status == 200
console.log(response);
$('#user_stripe_card_token').val(response.id)
$('#new_user')[0].submit()
else
$('#stripe_error').text(response.error.message)
$('#stripe_error').show()
$('input[type=submit]').attr('disabled', false)