#RJ01

1 messages · Page 1 of 1 (latest)

granite crownBOT
thorn salmon
#

Hi! Let me help you with this.

#

In your flow with Payment Element, are you creating PI before displaying the form?

stoic bane
#

Hello

#

no not yet. here's my plan..

I want to use the address element, so the user can input there address..
and once they inputted there address, i will use those values to compute the sales tax base on their address.

once i got the sales tax and total the amount, that's the time i will create PI. so the user can input their card information and pay it.

#

So is it possible to create address element first?

thorn salmon
#

You can create the PI before, and as the customer updates the Address, you can update the PI amount with the calculated tax

stoic bane
#

oh.. do we have curl for that?

stoic bane
#

thanks, one more question..

#

if we are using this payment element, can we also create subscription?

thorn salmon
stoic bane
#

ohh, hmm.. is it possible to set how much tax it will cost? so every month / year it will also deduct the tax to the customer?

#

since we are using other API to compute sales tax base on the address..

#

we have an existing one.. we are getting the sales tax rate and we are computing it and sending it to stripe.

#

on payment intent..

#

but how can we implement this in subscription? for monthly and yearly?

thorn salmon
#

I am not sure how will it get the address. Maybe it will automatically add the address fields to the Payment Element. Let me check.

#

I am checking now, it seems like you will need to collect the address info before proceeding to checkout. and before creating the Subscription object

stoic bane
#

yea. alright, will take a look with this automatic_tax..

#

question again sorry 😄

#

how can we show modal? instead of returning an html here?

thorn salmon
#

For some payment methods the customer will need to be redirected elsewhere, so no.

#

Also, I think you're confusing the billing_details parameter with elements options. "never" here will result in the properties being set to "never", instead of not showing in the form.

stoic bane
#

okay will check this. hmm, would you know on how can I know if it is success? im thinking to create another variable that will contain if it success or not. like in stripeError..

thorn salmon
#

Your app needs to listen to webhook notifications to do any post-payment business logic.

stoic bane
#

thanks will study this

thorn salmon
#

Happy to help!

granite crownBOT