からにconnected accountで顧客レコードを請求しようとすると、「そのような顧客:cus_xxxx " - がでない場合は、「接続済み」のアカウントを使用している場合(プラットフォームアカウントを使用して請求する場合)、同じ正確な顧客に課金することは問題ありません。例えばストライプコネクト:既存の顧客を「接続済み」(スタンドアロン)アカウントにチャージする
、ID acct_ABC123
で私たちは、「接続」(スタンドアロン)のアカウントを持っていると仮定すると、次のRubyのコードを考えてみますが、最後の行は "と、Stripe::InvalidRequestError
例外につながる
# Use the (secret) API key for the "platform" or base account.
Stripe.api_key = 'sk_[...]'
customer = Stripe::Customer.create(email: '[email protected]')
# Associate a credit-card with the customer.
token = # Generate a token (e.g., using Stripe Checkout).
customer.sources.create(source: token)
# Attempt to charge the card via the connected account...
Stripe::Charge.create({ amount: 150, currency: 'usd', customer: customer.id,
application_fee: 25 }, stripe_account: 'acct_ABC123')
そのような顧客はありません "上記のエラー。私たちは(stripe_account
パラメータなしapplication_fee
なし)「プラットフォーム」アカウント上でそれを実行しようとする場合は、同じ電荷は...ファインを通じて、いくつかの(混乱と少し奇妙な)理由
Stripe::Charge.create({ amount: 150, currency: 'usd', customer: customer.id }