#abhupray

1 messages · Page 1 of 1 (latest)

solemn dawnBOT
#

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.

vagrant helm
#

Hi there!

#

Can you summarize your question here?

boreal bough
#

I am using srtipeJS to subscribe card using confirmSetup function and I am getting following error code:"setup_state_unexpected_state" and message:"a processing error occured"

#

this is my code in vue

vagrant helm
boreal bough
#

req_g1DThX62dbZTkL

vagrant helm
#

I don't see an error in this request.

#

Where/when exactly do you see the error you mentionned above?

boreal bough
#

req_363NgjFHj80SaP

#

when I am trying to call confirmSetup() function

hidden shore
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

boreal bough
#

ok I have shared the code block above can you tell me how should I call the confirmSetup() function along with parameters that needs to be passed

hidden shore
#

What Stripe guide are you following?

boreal bough
#

as there is no officical guide for vue I am following this react guide

#

can you tell me how should I call the confirmSetup() function

hidden shore
#

I see you're passing a payments attribute to the object literal, however, it's not a valid attribute. It needs to be elements.

await this.stripe.confirmSetup({
                payments,
                clientSecret:token,
                confirmParams:{
                    return_url:"https://eat-express.pages.dev/thankyou-outlet"
                }
            })
boreal bough
#

so payments is a refrence to card element

#

const payments = this.cardElement

hidden shore
#

I understand, but using a variable like this also gives the name to the attribute:

{ payments } is { payments: payments }
But it should be:
{ elements: payments }
boreal bough
#

getting new error now

#

Uncaught (in promise) IntegrationError: Invalid value for stripe.confirmSetup(): elements should be an Elements group. You specified: object.

hidden shore
#

I believe you should provide all elements, not just card element.

boreal bough
#

I have only card element

hidden shore
#

I don't see it in your code. But basically the object you use to create the cardElement

boreal bough
#

It's a react library and I am using stripeJS

hidden shore
#

How are you creating the cardElement?

boreal bough
#

using elements function

#

this.stripe = await loadStripe(process.env.VUE_APP_STRIPE_PUBLISHABLE_KEY);
const elements = this.stripe.elements();
this.cardElement = elements.create('card');
this.cardElement.mount(this.$refs.cardElement);

hidden shore
#

const elements = this.stripe.elements();
You need to put this elements variable into the call to confirmSetup().

boreal bough
#

new error

hidden shore
#

But I strongly recommend you to look into using Payment Element.

boreal bough
#

ok I switchd to payment element and it's still showing the same error

hidden shore
#

What did you change exactly?

boreal bough
#

this.stripe = await loadStripe(process.env.VUE_APP_STRIPE_PUBLISHABLE_KEY);
const options = {
mode: 'setup',
currency: 'usd',
// Fully customizable with appearance API.
appearance: {/.../},
};
const elements = this.stripe.elements(options);
this.cardElement = elements.create('payment');
this.cardElement.mount(this.$refs.cardElement);

#

switched the element from card to payment

hidden shore
#

And how you confirm now?

boreal bough
#

Hey I have used confirmCardSetup() and it's working now

#

thanks for the help

hidden shore
#

Happy to help.