#RJ01
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
In your flow with Payment Element, are you creating PI before displaying the form?
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?
You can create the PI before, and as the customer updates the Address, you can update the PI amount with the calculated tax
oh.. do we have curl for that?
thanks, one more question..
if we are using this payment element, can we also create subscription?
Yes, this will probably be a bit harder with Tax. The basic flow is like this: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
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?
You can set automatic_tax when creating a Subscription: https://stripe.com/docs/api/subscriptions/create#create_subscription-automatic_tax-enabled
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
yea. alright, will take a look with this automatic_tax..
question again sorry 😄
how can we show modal? instead of returning an html here?
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.
Use "never" when you create Elements: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-line1
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..
Your app needs to listen to webhook notifications to do any post-payment business logic.
thanks will study this
Happy to help!