#cashiersprit-payment-element

1 messages ยท Page 1 of 1 (latest)

red trail
rough lintel
#

payment element already done

red trail
#

Oh, sincere apologies, I overlooked the word tax in your initial message.

rough lintel
#

our finanacial team want to integrate stripe tax to existing payment element

red trail
rough lintel
#

en, I think we have old checkout flow before. but recently , we use payment element to replace the old checkout

#

now no checkout anymore

red trail
#

So when you're working with the Payment Element, are you creating Payment Intents directly, or are they being created as part of a larger flow (such as when you're using Subscriptions)?

rough lintel
#

Payment Intents directly

acoustic sedge
#

might work for you

red trail
#

Good callout @acoustic sedge, thank you! That might be the best approach here.

rough lintel
#

en, I won't call them an integration. it seems they have loose relationship. payment element and tax

acoustic sedge
#

yep, it's pretty easy to integrate

#

you could also use checkout if you wanted: https://stripe.com/docs/payments/checkout
but seen as you've already built upon paymentintents, i wouldn't see much benefit of you moving over as you've already integrated

rough lintel
#

yes, we already used payment element to replace checkout. we won't go back

acoustic sedge
#

orders is your best bet then

rough lintel
#

it seems no clear path to integrate payment element and tax

acoustic sedge
#

no. you create the order, then submit that order (expending the paymentintent made by it), an example in node.js:

const order = await stripe.orders.submit('{{ORDER_ID}}', {
  expected_total: 1000,
  expand: ['payment.payment_intent']
});
const paymentIntent = order.payment.payment_intent;
const clientSecret = paymentIntent.client_secret

you can then access the paymentintent using order.payment.payment_intent, and pass the paymentintent's secret to the client for confirmation

#

the client secret should be passed to the client, which can then use stripe.js to collect payment details and confirm the payment using confirmCardPayment()

#

i sadly have to hop out, but if you have any other questions or concerns, im sure @cold plume will be happy to help :)

cold plume
#

๐Ÿ‘‹