#gracine-checkout-zero-dollar
1 messages ยท Page 1 of 1 (latest)
Hi ๐ if you're working with Subscriptions, then the payment_method_collection parameter may be what you're looking:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_collection
But that setting doesn't work if you're creating Checkout Sessions in payment mode.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hi! Thanks for you reply, I am using the checkout session in hosted mode yes
So in order to prevent the payment methode from being displayed, I must implement the whole checkout process using your API, without using the hosted checkout session process ?
All of our Checkout Sessions are hosted, how are you creating your Checkout Sessions currently?
Something like this:
session_params = {
mode: 'subscription',
allow_promotion_codes: false,
client_reference_id: user.account.account_id,
currency: @currency,
line_items: [{
quantity: 1,
price: billing_product_price.stripe_id
}],
success_url: Rails.application.config.uri + '/app?session_id={CHECKOUT_SESSION_ID}',
cancel_url: Rails.application.config.uri,
}
if user.account.stripe_customer_id.present?
session_params[:customer] = user.account.stripe_customer_id
else
session_params[:customer_email] = customer_email
end
session = Stripe::Checkout::Session.create(session_params)
and in the UI I redirect to session.url
Okay, so it does look like you're using the API to create your sessions, and that you're specifying subscription for the mode parameter, so I believe the parameter that I referenced above is what you're looking for.
ok i will try it right away, thank you!
Happy to help!
gracine-checkout-zero-dollar
it works!
Awesome! I'm glad to hear that helped.
Thank you you saved me a lot of time