#nils_72394
1 messages ยท Page 1 of 1 (latest)
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?
pi_3NlVjnCZZ5vcARCG0iTDBZhj
I see you're confirming the PaymentIntent on the backend. At what stage are you collecting the Payment Method?
I would recommend you to follow this guide instead and use Payment Element for all payment method types: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
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.
I believe Payment Element should work with iframes. But why you can't use the Payment Element directly instead of iframe?
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 ๐
Could you maybe provide a screen recording of your flow, as I am not sure I imagine how you want this to work.
But in general, why are you confirming the PaymentIntent on the backend?
Give me a minute please ๐
In the guide you should confirm on the frontend: https://stripe.com/docs/payments/ideal/accept-a-payment?platform=web&ui=element#web-submit-payment
I've sent you a message to our checkout
What do you mean?
I've sent you screen capture video link via direct message
I think my DMs are disabled, please try again
You were right. I haven't seen the message from the bot, that my message has been declined
Why you need the iframe if you do it in the browser? Can you load Stripe.js directly onto the page?
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
Okay, coming back to my question, why are you confirming the PI on the backend?
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
Do you mean this step?
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)
The confirmation must happen on the frontend in this case.
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,
},
});
Does this work?
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,...)
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.
ok, I will check that out. Thanks.
Could I also use it for APM with no extra data like PayPal as well?
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
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.
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.