#vgontier_api

1 messages ¡ Page 1 of 1 (latest)

rigid coralBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1315616208544071724

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

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.

hollow robin
#

hi! don't think so no.

#

what behaviour do you want instead exactly?

broken gale
#

I would like to open the authetntication_url from alma in a popup

#

we're already doing that for bancontact

#

Cause we have the PaymentIntent in return of the fetch with the authentication_url

#

but we would like to do the same thing with Alma

broken gale
#

I dont see that kind of information on the stripe doc or anywhere else

hollow robin
#

true, I'm mistaken, I thought it was still a beta, it's not

broken gale
#

Plus there is something that I don't understand :

console.log('before confirmation');
const { paymentIntent, error } = await stripe.confirmPayment({
  clientSecret,
  confirmParams: {
    payment_method_data: {
      // @ts-expect-error not implemented yet by stripe
      type: 'alma',
    },
    return_url: `${PG_PAYMENT_URL}/redirect/status?lang=${params?.lang}`,
  },
});

// cant access this code below as the page redirect ( except error )

console.log('PaymentIntent', paymentIntent);

if (error) {
  handleFailPayment(error.message);
  return;
}

Why is there a PaymentIntent as a possible return of the confirmPayment but the redirection is blocking any action with it

#
  • the type 'alma' is not a valid typescript type since it only exist on the doc but not on the last version of stripe js ( But i've already mentionned it in another ticket)
hollow robin
#

because not all payment methods redirect, or don't redirect depending on the parameters you pass, so in some cases your code can execute after it

broken gale
#

It only execute after it in case I have an error

hollow robin
#

yeah

broken gale
#

:/

#

Would it be better to have a confirmAlmaPayment method instead ?

hollow robin
#

no

#

because then you couldn't use the PaymentElement, which supports multiple payment methods with exactly the same code, you'd have to write custom code for each payment method to know which function to call. That's the reason for using the PaymentElement and confirmPayment.

broken gale
#

im not using the PaymentElements in my case but y I got u

#

So there is no way actually to open the Alma auth url in a popup instead of having a redirection ?

hollow robin
#

you could try putting that URL into an iframe that you build a popup for.
I don't know if it works, probably it doesn't and the Alma site expects to be in a full browser tab and might error in production if it's in a frame, which is why we built the default as a redirect

broken gale
#

Okay I'll try this, else I'll find another solution, thanks for the help !

hollow robin
#

my understanding is all these European local methods like ideal/bancontact etc need a full-page redirect

broken gale
#

But is there a specific reason to create some specific method for bancontact or alipay and not on others ?

hollow robin
#

not sure what you're asking

broken gale
#

basically why is there a confirmBancontactPayment and not a confirmAlmaPayment method ?

hollow robin
#

I think you mean why isn't there an equivalent of https://docs.stripe.com/js/payment_intents/confirm_bancontact_payment for Alma, and for a definitive answer you'd need to ask the teams involved. But my understanding is it's because you should be using the PaymentElement, we want all merchants to use those Elements integrations that support multiple payment methods and our UIs for those, etc, and not the ones that are payment-method specific. For new payment methods we add, we're adding them with the PaymentElement as the supported frontend integration
you can still implement each method separately if you do want to, per the link I shared earlier

broken gale
#

When creating the Payment Intent and before confirming the payment, is it possible to get the authentication_url by fetching the function retrievePaymentIntent or something similar by using the payment intent id freshly created ?

hollow robin
#

no, you have to confirm the Intent to get it to the requires_action status and then can inspect next_action.redirect_to_url.url (which I think is the real API value that you keep referring to as "authentication_url")