#bitolasan

1 messages ยท Page 1 of 1 (latest)

neon mossBOT
steep hamlet
#

Hi there ๐Ÿ‘‹

#

I'm not sure what you're referring to by "discounted rates" so I'm kinda side-stepping that piece for now, but I may be able to help with that as well if you can provide more clarity on what you're referring to there.

#

If a currency conversion occurred, you can find the related Balance Transaction object to get details about the exchange rate used for that conversion.
https://stripe.com/docs/api/balance_transactions

As long as you're dealing with one-time payments, the Checkout Session should have a reference to a Payment Intent object via the payment_intent field:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent

You can use that ID to retrieve the related Payment Intent:
https://stripe.com/docs/api/payment_intents/retrieve

#

That will have a Charge ID in the latest_charge field:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
which can be used to retrieve the related Charge:
https://stripe.com/docs/api/charges/retrieve

That Charge will have a reference to a Balance Transaction:
https://stripe.com/docs/api/charges/object#charge_object-balance_transaction

The exchange_rate on the Balance Transaction tells you what exchange rate was used.
https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-exchange_rate

jolly talon
#

Hi, I'm using another discord account, the one I used logged out and I couldn't remember its password!

Well let's go, I need to know which event I have to select when registering a webhook in stripe so that every time a customer makes a payment via a payment link, I receive the amount of the sale in the currency of the sale, the gross amount in the currency of my account and the fee charged.

steep hamlet
#

Do you plan to expand your integration to anything other than Payment Links? Additionally, do you plan to accept payment methods that are delayed notification?

checkout.session.completed is triggered whenever a Checkout Session's flow is completed, and since Payment Links generate Checkout Sessions, that is a great Event type for what you're describing.

#

If you're not going to expand your integration, you can listen for something closer to the Charge object, like charge.succeeded to reduce how much you need to do when you receive the Event, but if you expand you'd need to revisit that logic and make sure it's only triggering when it should.

jolly talon
#

Reading your message, I've just tested the "customer_cash_balance_transaction.created" event but it doesn't fire when the sale is made. I believe this is because apparently when a payment is made via a payment link, the stripe does not create a customer and set them as a guest.

steep hamlet
#

That Event type (customer.cash_balance_transaction.created) won't be relevant here.

jolly talon
#

The Checkout Session Completed event does not return the amount in the local currency, nor even the amount of the fees charged.

steep hamlet
neon mossBOT
jolly talon
#

I think I understand, basically if I select to trigger the "charge" event in my webhook, I'll probably find the information I need?

#

I've added all these events to my endpoint, I'll test to see what I get

steep hamlet
#

Nope, it'll get you the Charge object in the Event, which has less hops to get to the Balance Transaction that was created, but you'll still need to make a request once the Event hits your endpoint to get the related Balance Transaction object. That Balance Transaction has the details you're looking for.

jolly talon
#

Does this mean that, using Charge ID, I can cross-reference the data and access the balance transaction for this charge, thus obtaining information on the fee charged and the exchange rate used?

crisp oracle
jolly talon
#

Perfect! I think I have a path to follow, I'm going to work on it and do some tests, but you've helped me a lot, thank you very much!

crisp oracle
#

Sure thing!

jolly talon
#

From what I've seen, it looks like I won't be able to get this data the way I'm trying to do it, I'm using pabbly to create new lines with the information I need every time a customer buys.

#

It's not really possible to do this using only pabbly to integrate the stripe with the spreadsheets, is it?

#

Which event should I select here, so that every time a ballance transaction is made I receive the event details?

crisp oracle
#

I'm not sure what Pabbly is so I can't really say. You just need to be able to make API calls to the Stripe API, and you'll also need some system to ingest the HTTP response