#defekt7x-payment-intent

1 messages · Page 1 of 1 (latest)

meager knot
#

👋 Happy to help

#

Not possible to change the amount after confirmCardPayment. After payment intent is created, you can calculate the tax, then confirmCardPayment to collect card information from the customer

queen trench
#

Hmm, so we're using Avalara (Avatax for Stripe) so we do this currently for our recurring subscriptions, which works great. When we call stripe.subscriptions.create() we set pay_immediately: false (which is an Avalara specific flag) which sets the subscription invoice to a Draft, and then Avalara comes in right after that and updates the line item to add the calculated tax.

I'm trying to figure out how to do this with One-Time payments. These are the events that the Avalara webhook is listening for:

charge.refunded
charge.succeeded
customer.created
customer.updated
invoice.created
invoice.marked_uncollectible
invoice.updated

I tried adding pay_immediately to stripe.paymentIntents.create() but that didn't work.

meager knot
#

Which doc do you use for one-time payment integration?

queen trench
#

Sorry, what do you mean which doc?

meager knot
#

our payment intent API doesn't have pay_immediately parameter, so wondering where you get such information and how you integrate with one time payment currently

queen trench
#

Yeah, it's an Avalara specific flag... it's not in the docs anywhere at all, and you have to email customer support to have them enable the flag for your account if you have the Avalara integration set up. Kind of confusing. It works when creating a subscription, so I was just blindly testing to see if it would work when creating a payment intent and it looks like it's not supported there

meager knot
#

I see. If you're going to build one time payment on your own, I'd suggest this doc: https://stripe.com/docs/payments/quickstart

During or payment intent creation, you can calculate the tax and pass the client secret to confirmCardPayment

queen trench
#

Yeah this is pretty much exactly what I'm doing.

meager knot
#

Any reason why you can't compute the tax while creating the payment intent, but only later after webhook events are in?

queen trench
#

We don't compute the tax on our end, that's the whole reason we have the Avalara integration set up so that it can be automated with the webhooks. We need things to come through as invoices instead of charges. Is there a way to go from Payment Intent -> Invoice instead of Payment Intent -> Charge?

meager knot
#

I see! I'm not familiar with Avalara and it seems like a tax compliance solution. Let me think about it

queen trench
#

no worries! thanks

meager knot
#

which exact event that Avalara listens to compute the tax?

queen trench
#

I posted the events above

#
charge.refunded
charge.succeeded
customer.created
customer.updated
invoice.created
invoice.marked_uncollectible
invoice.updated
#

but charges are no good because Avalara can't go in and modify the price of a charge, so if it's a charge, then we must specify that the amount is Tax Inclusive

#

Avalara can only go into Invoices in a draft state to modify the price

meager knot
#

payment intent alone doesn't provide invoice.* events whereas invoicing solution does