Ruby on rails 如何使用Rails 5将SCA条带签出与条带连接集成
我一直在尝试在我的网站上向用户(本例中为卖家)付款。我已经设法允许卖家设置他们自己的条带帐户,然后他们的条带帐户ID保存在数据库中 然而,我无法允许人们向卖家付款。我一直在看Stripe文档,虽然非常详细,但我不知道所有东西都应该放在哪里。我想要这样的东西: 我有了一个新的电荷视图,这个代码应该在其中,我想:Ruby on rails 如何使用Rails 5将SCA条带签出与条带连接集成,ruby-on-rails,ruby-on-rails-5,stripe-payments,Ruby On Rails,Ruby On Rails 5,Stripe Payments,我一直在尝试在我的网站上向用户(本例中为卖家)付款。我已经设法允许卖家设置他们自己的条带帐户,然后他们的条带帐户ID保存在数据库中 然而,我无法允许人们向卖家付款。我一直在看Stripe文档,虽然非常详细,但我不知道所有东西都应该放在哪里。我想要这样的东西: 我有了一个新的电荷视图,这个代码应该在其中,我想: // Initialize Stripe.js with the same connected account ID used when creating // the Checkout
// Initialize Stripe.js with the same connected account ID used when creating
// the Checkout Session.
var stripe = Stripe('pk_test_CscsJfPdlaNBpLla09y0aA6W', {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'
});
stripe.redirectToCheckout({
// Make the id field from the Checkout Session creation API response
// available to this file, so you can provide it as parameter here
// instead of the {{CHECKOUT_SESSION_ID}} placeholder.
sessionId: '{{CHECKOUT_SESSION_ID}}'
}).then(function (result) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer
// using `result.error.message`.
});
我也有一个收费控制器,但我不确定这是否意味着存在:
session = Stripe::Checkout::Session.create({
payment_method_types: ['card'],
line_items: [{
name: "Cucumber from Roger's Farm",
amount: 200,
currency: 'gbp',
quantity: 10,
}],
payment_intent_data: {
application_fee_amount: 200,
},
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
}, {stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'})
如何使用正确的帐户ID初始化Stripe.js?这个代码应该在哪里?我还需要更多吗
任何帮助都将不胜感激。谢谢。您需要用相应的条带帐户ID替换
{{CONNECTED\u STRIPE\u ACCOUNT\u ID}
,客户端和服务器端。是的,我知道,但就是这样吗?在我看来,我不需要其他东西吗?