🖥
Stripe::InvalidRequestError: Some of the parameters you provided (paym
require 'stripe'
Stripe.api_key = ENV['STRIPE_SECRET_KEY']
checkout_session = Stripe::Checkout::Session.create(
payment_method_types: ['card'],
mode: 'setup',
success_url: 'http://example.com',
cancel_url: 'http://example.com'
)
payment_method = Stripe::PaymentMethod.create(
type: 'card',
card: { number: '4242424242424242', exp_year: 2030, exp_month: 01}
)
# Stripe::InvalidRequestError:
# Some of the parameters you provided (payment_method) cannot be used when modifying a SetupIntent that was created by Checkout.
# You can try again without those parameters.
Stripe::SetupIntent.update(
checkout_session.setup_intent,
{payment_method: payment_method.id},
)
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2020-03-28
Discussion