#tezzzla1976
1 messages · Page 1 of 1 (latest)
Hello! Not sure I fully understand. What does "comes through" mean exactly?
when it initializes is how I should have said that.
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.
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.
How do you create the pre-authorization?
on our app, via api to stripe?
Using which API?
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.
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.
How is an Invoice created exactly? A Stripe Invoice or a custom invoice on your end?
stripe invoice.. but that's at the end when the ride is completed.. too late for what I'm looking for.
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.
Alternatively, you can add discount details to the Payment Intent's metadata: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-metadata
There are several Payment Intent Events you can listen for, which are listed starting here: https://docs.stripe.com/api/events/types#event_types-payment_intent.amount_capturable_updated
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?
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.
Have a look at the short video here for more details: https://docs.stripe.com/payments/tour#payment-objects
Right, but with a payment intent you get the customer information.. do a lookup on the customer.. the discount shows up, no?
Not sure what you mean by "the discount shows up"?
in the payload of the api call on the customer.
Are you talking about the discount property on the Customer?
yes.
That discount won't apply to the Payment Intent.
Not if you create the Payment Intent yourself I mean.
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.
But yeah, you can look it up, just be aware it has nothing to do with the Payment Intent.