#slowgen - checkout

1 messages · Page 1 of 1 (latest)

floral granite
#

hey there, what do you mean by checkout.js here? This isually refers to a legacy Checkout solution no longer recommended, but you're also using terminology form a mode integration. Can you clarify what you're trying to do?

covert hemlock
#

In that page if you choose custom payment flow there are files such as create.php, checkout.html and checkout.js

#

Which would be the lastest guide to follow

floral granite
#

Oh, you're referring to the sample code, I see

#

The best flow is up to you! What are you trying to do, exactly?

covert hemlock
#

So just wanting to know why those two cases are there and how to test those

#

processing and requires_payment_method

floral granite
#

Where are you seeing this, exactly?

covert hemlock
#

line 68 checkout.js

#

So that happens after redirect but I can't get there with those statuses

floral granite
#

Oh i understand

#

So to test this you need to use different test payments methods

#

For processing, you'd need to use an async payment method that has a processing delay, such as Sepa -- it may not apply to the payment methods you offer

covert hemlock
#

We're just offering cards and Google & Apple pay will it apply to those?

floral granite
#

For requires_payment_method you can test this by having your payment fail, for example by using an SCA/3DS test card then failing the authentication step

#

For cards you can test requires payment method, yes

#

Use on of these cards then "fail" the authentication step

covert hemlock
#

Sorry to be a pain, so when testing those statuses according to the docs is after redirected to return_url but in my cases it's showing in the same page without redirecting. Does this mean that if I offer card and apple/google pay then it will olny redirect if it succeeds. Cos that''s how it's behaving right now. Any decline/auth failure stays on the same page with message on #payment-message card declined, insufficient funds etc and failing 3ds gave this message without redirecting

#

We are unable to authenticate your payment method. Please choose a different payment method and try again.

floral granite
#

Have you enabled any other options? Such as only redirecting if_required?

#

The default is for authentication to involve a redirect, but this is optional for eg cards, and you can opt out of that redirect

#

Can you share your call to confirmPayment?

covert hemlock
#

Just a part of it

floral granite
#

And using the 3ds test cards you're not redirected to an authentication page? Does an authentication challenge appear in a model?

covert hemlock
#

Yes it does

#

I mean modal shows but no redirection

#

I've never been able to redirect there unless it was success, so really I wanted to know if it'll ever get there. So I can handle that case. We're only offering card and apple/google

floral granite
#

Sorry, redirect to where? I thought you weren't seeing a redirect?

covert hemlock
#

No I'd rather not redirect unless it was successful. Sorry if I lost you. Currently never redirects unless success. But in docs it mentions testing for processing and requires_payment_method. And those two to be tested only after redirection (but I can't redirect unless success). Will those two apply to my situation

#

E.g. does apple/google pay complete sync?

floral granite
#

Those will be synchronous as far as i know, yes

#

You can also modify the code to manually retrieve the payment intent to enter that flow

#

You don't need to keep the sample code as it is, you in fact should be using it only as a reference to see how certain tasks can be accomplished in your application

covert hemlock
#

Yes understand and helpful. Most of my code is server side but that was a bit baffling why to test those two situations if I could never reach it with those statuses

floral granite
#

Consider it illustrative of other payment flows -- your particular integration may not need it

covert hemlock
#

Cheers highly appreciate your help as always

floral granite
#

NP!