#arnotixe
1 messages ยท Page 1 of 1 (latest)
(or is this client side js? ๐ค )
that function is in Stripe.js client-side, not in the server-side library stripe-node
--is there a server side library too though?
there is but why would you do it there?
you need to confirm and redirect to Affirm client side
it is more work to do server side
cause you'll have to manually redirect etc
ok, yeah currently we're grabbing the customer details when he clicks Purchase - and could return a redirect url there. But we can feed back that redirecting html page instead I guess
not sure I understand
when a customer clicks purchase, you just call stripe.confirmAffirmPayment() and it handles everything for you
are you using Payment Element? if not, why not?
ok yeah I might be barking up the wrong tree. We have a combined page (Elements, Next.js) currently handling direct Credit card payments only, but want to add affirm now.
I think I got the hang of it ๐
only thing is- is there a test affirm phone number?
I see the page is in sandbox but don't have a phone number to input ๐ค
so wait - are you not using PaymentElement? cause Affirm is supported with minimal integration changes: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
meaning you don't need confirmAffirmPayment()
I see the page is in sandbox but don't have a phone number to input ๐ค
not sure , haven't integrated Affirm but you should be seeing Stripe's test authentication page there
hmm interesting! I'll see if that approach is possible. We just need to make sure we call a "purchase has started" endpoint in our api before running any of the actual purchase calls.
We just need to make sure we call a "purchase has started" endpoint
what endpoint is that?
ah in your api
sorry didn't read that part
yep
but yes PaymentElement allows that
with this approach https://stripe.com/docs/payments/build-a-two-step-confirmation
๐ I'll try something like that!
We also do some pre-purchase magic to make sure we don't duplicate stripe customers (lookup customer in stripe first, then attach the payment method to it). But since this is a public facing order page, we don't know beforehand if we have customer on file already, and it would of course be disastrous to lookup the customer's payment methods by his input email only (without authentication)โฆ
As long as we get a "loose" paymentmethod I'm good with that. Will check out both!
As for the affirm phone number, they say "any US cell phone is good" ๐ It's just I'm not in the US so have to guess hehe
yeah I don't know about the Affirm part sorry
heh tried googling US phone numbers and I think we're on to something!
Just succeeded my first sandbox affirm payment pi_3NcZzgLYbD2uWeLi0UmM63xc ๐
good to hear it worked!
I'll definitely check out both approaches though; this was the redirect page spit back by our api, but I think the method you suggest with using Elements is a lot cleaner. โ๏ธ
Hi @shell narwhal I'm taking over, feel free to let me know if you have any follow-up questions.