#arnotixe

1 messages ยท Page 1 of 1 (latest)

shadow atlasBOT
shell narwhal
#

(or is this client side js? ๐Ÿค” )

abstract vessel
#

that function is in Stripe.js client-side, not in the server-side library stripe-node

shell narwhal
#

--is there a server side library too though?

abstract vessel
#

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

shell narwhal
#

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

abstract vessel
#

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?

shell narwhal
#

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 ๐Ÿค”

abstract vessel
#

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

shell narwhal
#

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.

abstract vessel
#

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

shell narwhal
#

yep

abstract vessel
#

but yes PaymentElement allows that

shell narwhal
#

๐Ÿ‘ 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

abstract vessel
#

yeah I don't know about the Affirm part sorry

shadow atlasBOT
shell narwhal
#

heh tried googling US phone numbers and I think we're on to something!

Just succeeded my first sandbox affirm payment pi_3NcZzgLYbD2uWeLi0UmM63xc ๐Ÿ˜

abstract vessel
#

good to hear it worked!

shell narwhal
#

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. โš™๏ธ

autumn bluff
#

Hi @shell narwhal I'm taking over, feel free to let me know if you have any follow-up questions.