#mateusz-kuda_api

1 messages · Page 1 of 1 (latest)

balmy bearBOT
jovial whaleBOT
#

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.

balmy bearBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1250730290528387114

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

inland fiber
#

Hi, let me help you with this.

#

Could you please share the code that creates the Stripe Elements?

coral wave
#

Yes off coures

inland fiber
#

But yeah, this looks like a bug

coral wave
#
const options = {
        locale: 'en',
        mode: 'payment',
        amount: 2583,
        setupFutureUsage: 'off_session',
        currency: 'pln',
        fonts: [],
        appearance: {},
    };
#

we are using this optiosn

inland fiber
coral wave
#

Because the payment intent is automatically created during subscritpion creation

#

yes this one

#

but instread of doing this:

  const res = await fetch("/create-intent", {
    method: "POST",
  });
#

we are creating subscritpion

#

but still payment intent will be created

inland fiber
#

Yes, the example I shared is for a Subscription

coral wave
#

Yes now I see

#

so we are using

#

let me check the subscription version

inland fiber
#

Still, the way you implemented it is correct, and it shouldn't give you an error.

#

What happens if you disable automatic tax? It might be a seemingly unrelated feature, that unfortunately breaks the flow. Could you please try it and let me know if it changes the situation?

coral wave
#

Yes we can do it, please wait a second

#

new req id for subscritpion creation: req_uDj37vVQmDxX7j
request for submit: req_izcDptvkLUkX8b

#

still the same

#

As I can see for payment_method_types by default you are using card, maybe this is an error?

The list of payment method types (for example, card) that this SetupIntent can use. If you don’t provide this, it defaults to [“card”].

#

Because we are not using this field

balmy bearBOT
coral wave
#

I must go to meeting without laptop, could I ask you not to close the thread? I'll be back within 30 minutes, sorry for the problem

inland fiber
#

Last thought, this might be due to your API version, in the latest version Subscription will default to automatic_payment_method. You can try making the call with a newer API version.

coral wave
#

How I can change the api version?

jagged sedge
coral wave
#

Thanks

jagged sedge
#

Happy to help!

coral wave
#

Ok, unfortunatelly changing the API version for request didn't help

jagged sedge
#

What Stripe JS version are you using ?

coral wave
#

Let me check

#

How I can check the version of JS? We are including this one in our website:

<script src="https://js.stripe.com/v3" />
#

on request logger I see 2023-08-16

jagged sedge
coral wave
#

And for this one request I changed API version by using the lates version: 2024-04-10 but only for API

jagged sedge
#

Ok I see.

#

The issue is that you are using mode:payment and not mode: subscription when creating the payment element

#

For example:

const options = {
  mode: 'subscription',
  amount: ...,
  currency: '...',
  // Fully customizable with appearance API.
  appearance: {/*...*/},
};

// Set up Stripe.js and Elements to use in checkout form
const elements = stripe.elements(options);

// Create and mount the Payment Element
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
coral wave
#

We are checking

jovial whaleBOT