#masud-checkout-ruby

1 messages · Page 1 of 1 (latest)

prime drumBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

proven yacht
#

Hi, can you add more deatils on what you want to achieve here?

zinc lichen
#

Create a card-less checkout session

proven yacht
#

Try this and let me know if you run into any issues.

zinc lichen
#

Yeah, that's the same code i used and it gave me same error.

#
 session = Stripe::Checkout::Session.create({
            line_items: [
              {
                price_data: {
                  unit_amount: 0,
                  product_data: {name: 'Free t-shirt'},
                  currency: 'usd',
                },
                quantity: 1,
              },
            ],
            mode: 'payment',
            success_url: 'https://example.com/success',
            cancel_url: 'https://example.com/cancel',
          })

yeah same

proven yacht
#

What API version are you using?

zinc lichen
#

using the ruby gem

#

checking...

#

stripe (8.5.0)

proven yacht
#

There is a note: To process no-cost orders using the Checkout API, make sure you’re on API version 2023-08-16 or later.

#

The API version

#

not the library version

zinc lichen
#

I mean, the api version is whatever the gem version is for stripe-ruby, right?

proven yacht
#

No, it would be pinned to an API version. In this case, can you update the ruby gem library version to the latest and try?

zinc lichen
#

yes

#
Fetching stripe 8.7.0 (was 8.5.0)
Installing stripe 8.7.0 (was 8.5.0)
Bundle updated!

Doesn't seem like this is the latest, but i will try.

#

i updated to gem 'stripe', '~> 10.6' and same error.

prime drumBOT
proven yacht
#

Can you share the checkout session id with me?

zinc lichen
#

its not creating a checkout session because it's saying i cannot make it zero, so i don't think i can get the ID. right?

proven yacht
#

Let me test this on my end real quick

orchid anvil
#

masud-checkout-ruby

#

You have two options

  1. Upgrade the stripe-ruby gem
  2. Force a more recent API version when creating the Checkout Session
zinc lichen
#

I'm on stripe (10.6.0) atm

orchid anvil
#

It's unlikely you are

zinc lichen
#

Oh is stripe deprecated and now it's stripe-ruby?

orchid anvil
#

not really. The repo is stripe-ruby but the gem is stripe and that hasn't changed for over 10 years

#

Look at your request logs in https://dashboard.stripe.com/test/logs and check the most recent one, it will show the real stripe-ruby version you're using and I'm fairly confident you use an older one

zinc lichen
#

Is that where it's suppose to show the version?

orchid anvil
#

ah you use a third-party library on top of it

#

that "pay rails" thingy is not Stripe's and they seem to force an older API version

zinc lichen
#

I see. that's odd. I'll remove and test then.

orchid anvil
#

How do you use that library? I've never used it but you must be passing an API key somewhere for example

zinc lichen
#

BINGO that was the issue. I'm not even using that pay gem.

zinc lichen
orchid anvil
#

ahhhh

#

yeah then removing it is likely best, they were apparently pinning to an old API version.

#

To be fair, this is 100% expected since they write the code for you and so if the API shape changes under them they get broken