#gracine-checkout-zero-dollar

1 messages ยท Page 1 of 1 (latest)

hollow umbra
#

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.

mortal needle
#

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 ?

hollow umbra
#

All of our Checkout Sessions are hosted, how are you creating your Checkout Sessions currently?

mortal needle
#

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

hollow umbra
#

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.

mortal needle
#

ok i will try it right away, thank you!

hollow umbra
#

Happy to help!

hollow umbra
#

gracine-checkout-zero-dollar

mortal needle
#

it works!

hollow umbra
#

Awesome! I'm glad to hear that helped.

mortal needle
#

Thank you you saved me a lot of time