#nils_72394

1 messages ยท Page 1 of 1 (latest)

gilded magnetBOT
sleek hinge
#

Hi! Let me help you with this.

#

Could you please share the PaymentIntent ID pi_xxx?

#

But it seems like you're confirming the PI without providing the Payment Method details. Could you provide the code that confirms it?

kind saddle
#

pi_3NlVjnCZZ5vcARCG0iTDBZhj

sleek hinge
#

I see you're confirming the PaymentIntent on the backend. At what stage are you collecting the Payment Method?

kind saddle
#

Ok, maybe was just confused, how I can use Stripes's frontend to ask the customer for it's name and bank and also use the backend "confirm".

#

Yes, I've integrated the payment elements. But we need a solution for an iframe. The payment elements tool makes an window.top.href at some point. This is what we try to avoid.

sleek hinge
#

I believe Payment Element should work with iframes. But why you can't use the Payment Element directly instead of iframe?

kind saddle
#

Also after card payment is the redirect to window.top.href. But I haven't found any point at the documentation to avoid this too.

#

Because our payment/shop will be in a overlay of the product (games). When we forward the top/parent page, the customer will be out of the game.

#

Other solution would be to open a popup for the whole checkout flow. But this isn't what we want, too ๐Ÿ˜‰

sleek hinge
#

Could you maybe provide a screen recording of your flow, as I am not sure I imagine how you want this to work.

sleek hinge
kind saddle
#

Give me a minute please ๐Ÿ™‚

sleek hinge
kind saddle
#

I've sent you a message to our checkout

sleek hinge
#

What do you mean?

kind saddle
#

I've sent you screen capture video link via direct message

sleek hinge
#

I think my DMs are disabled, please try again

kind saddle
#

You were right. I haven't seen the message from the bot, that my message has been declined

sleek hinge
#

Thanks, let me check the recording.

#

For what platform is this?

kind saddle
#

Web/Browser

#

nodejs backend

sleek hinge
#

Why you need the iframe if you do it in the browser? Can you load Stripe.js directly onto the page?

kind saddle
#

because our payment checkout is encapsulated to this and will be used on different place. this is just one example. Another would be for ingame purchases. The checkout will over the game field. And on the point it's not very convienent when the page will be completly reloaded and the user has to load the game again

sleek hinge
#

Okay, coming back to my question, why are you confirming the PI on the backend?

kind saddle
#

It was just copy&paste of the documentation, because I thought I'm on the right way.

#

(see link in the initial message)

#

I'm open for better/correct solutions

kind saddle
#

I was hoping, I could use some form from Stripe for bank name selection and name input and then call confirm (frontend or backend), read the next_actionand forward the customer by myself to the return_url or in case of iDeal to the iDeal site.

#

(sorry for mixing iDeal and Card flow - maybe this is a bit confusing for you)

sleek hinge
#

The confirmation must happen on the frontend in this case.

kind saddle
#

ok, I use the "generic" cofirm at the moment. Do I have something to replace/add?

            elements,
            confirmParams: {
                return_url: this.returnUrl + `?transactionId=${this.transactionId}`,
                receipt_email: this.emailAddress,
            },
        });
kind saddle
#

technically yes, but the forwarding in Stripe's SDK uses window.top.href to forward the customer to the return_url after card payments or forward the customer to the 3rd party payment page (APMs like PayPal, iDeal,...)

hidden ingot
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away soon. Please bear with me a moment while I catch up on the context here.

#

Ah, I see what you're talking about. Our doc, when talking about handling the redirect manually, shows that you should make a server-side request to confirm the intent but that won't work due to there not being a Payment Method provided to the intent.

I'm looking to see if we have a way to handle that.

#

Can you try adding a step to your flow that uses this the createPaymentMethod function to create a Payment Method object that can be worked with? You should be able to pass it the idealBank Element that you created.
https://stripe.com/docs/js/payment_methods/create_payment_method

I believe you'll then be able to pass that Payment Method's ID to your backend, and make the confirmation request server-side again by passing that ID to the payment_method field.

kind saddle
#

ok, I will check that out. Thanks.
Could I also use it for APM with no extra data like PayPal as well?

hidden ingot
#

No, the approach I was discussing relied on specifically using the idealBank Element since you already seemed to be going down that path. Are you interested in expanding this to accept other types of Payment Methods? If so I would recommend exploring a Payment Element integration instead.

#

The Payment Element can use the same function to create a Payment Method though. We have two versions of flows that leverage our Payment Element and allow for server-side confirmation.

One option is this:
https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=payment#web-fulfillment

And this is the newer version, where the key difference is that this newer approach does not create a Payment Intent in order to render the Payment Element, that creation is handled later in the process:
https://stripe.com/docs/payments/build-a-two-step-confirmation

kind saddle
#

do you mean in the newer approach, I can do the last step (stripe.confirmPayment()) in popup, that I have created by myself?

Because otherwise I haven't won anything, I guess. Because I already use confirmPayment() and this method is using the forwarding to window.top.

hidden ingot
#

Those flows use a server-side request to confirm the Payment Intent, you can then decide how to handle any next actions that are required.

kind saddle
#

Ok, I will try later. I just thought, because it's client side at the documentation

#

Means, I can do a confirm()directly after this on server-side and read out the next_action?

hidden ingot
#

Yup

#

You'll want to make sure you provide a return_url when making those confirmation requests server-side, so next_action isn't populated for stripe.js