#tezzzla1976

1 messages · Page 1 of 1 (latest)

cedar kindleBOT
solemn hare
#

Hello! Not sure I fully understand. What does "comes through" mean exactly?

sour dawn
#

when it initializes is how I should have said that.

solemn hare
#

Sorry, same question. What does initializes mean? I need a lot more details about the exact thing you want to know and when you want to know it.

sour dawn
#

Ok I run an online taxi company..
when a customer orders a ride.. a pre-authorization is created. I'd like to know if there's a webhook or way I can get information if there's a discount applied or not.

solemn hare
#

How do you create the pre-authorization?

sour dawn
#

on our app, via api to stripe?

solemn hare
#

Using which API?

sour dawn
#

I think that's the answer to your question..

#

Payment intent api?

solemn hare
#

That's one possibily, yes. Is that the one you're using though? The answer to your question is going to be different depending on the API you're using.

sour dawn
#

yeah so a payment intent is created, then when the ride is done an invoice is created and all the line items are created, etc..

I'm just trying to determine if customers are ordering rides with a discount or not (which I will action from there)

#

unfortunately it doesn't appear to be in the payment intent payload.

solemn hare
#

How is an Invoice created exactly? A Stripe Invoice or a custom invoice on your end?

sour dawn
#

stripe invoice.. but that's at the end when the ride is completed.. too late for what I'm looking for.

cedar kindleBOT
solemn hare
#

Payment Intents are low-level payment objects and don't have a concept of discounts. It sounds like you're calculating some kind of discount on your end, which means you should already have the discount information you want.

sour dawn
#

hmm.. thanks for that.

Would a workaround possibly be that when a payment intent is created, we do an api call to retrieve the customer information to see if a discount is on their account?

solemn hare
#

No, Customer discounts don't apply to Payment Intents you create directly. Again, Payment Intents are low-level payment objects that only know about the single amount you specify.

#

If you want higher-level Stripe functionality like discounts you need to use high-level objects like Invoices or Checkout Sessions instead of creating Payment Intents directly.

sour dawn
#

Right, but with a payment intent you get the customer information.. do a lookup on the customer.. the discount shows up, no?

solemn hare
#

Not sure what you mean by "the discount shows up"?

sour dawn
#

in the payload of the api call on the customer.

solemn hare
#

Are you talking about the discount property on the Customer?

sour dawn
#

yes.

solemn hare
#

That discount won't apply to the Payment Intent.

#

Not if you create the Payment Intent yourself I mean.

sour dawn
#

No I understand that, I'm simply trying to figure out if the customer who made the payment intent has a coupon on the customer object.

solemn hare
#

But yeah, you can look it up, just be aware it has nothing to do with the Payment Intent.