#qmathe

1 messages ยท Page 1 of 1 (latest)

dawn geyserBOT
rose remnant
#

Hi ๐Ÿ‘‹ I think looking at Transfer that gets created is going to be the easiest approach. When you're creating the Payment Intents, are you providing a value for the transfer_group parameter?

steady kettle
#

No, I'm not providing a value for the transfer_group.

rose remnant
#

Gotcha, I was thinking that would be the easiest approach to find the related Transfer, I'll need to double check how to find those a different way.

steady kettle
#

ok, thanks. I'm going to take a look.

btw is a charge always related to a payment? I'm wondering whether it's safe to list charges for a connected account and expect them to only represent received payments.

rose remnant
#

Charges are our lowest level object that handles money movement. Our newer abstractions (Payment Intents, Invoices, Subscriptions) all rely on them, but they always represent funds moving into a Stripe account.

dawn geyserBOT
steady kettle
#

I tried what you suggested in the Stripe CLI. It's weird, but latest_charge doesn't appear to be present when retrieving a payment intent with Stripe CLI. I can find the charge in charges though. However when retrieving charges[0].transfer.balance_transaction, the balance transaction has no application fee and net mount is the same value than amount (-600 if the payment intent amount was 600).

Did I misunderstand what you suggested?

btw it looks like charges[0].transfer.destination_payment should give me access to the charge and balance transaction on the connected account side, because when using the Stripe dashboard I can use it to navigate to the right net amount. Is there an API to retrieve a destination payment? I cannot find one.

rose remnant
#

Sorry, it slipped my mind with Destination Charges the application fee is pulled back from the Connected Account after the Transfer.

I also feel like I'm losing sight of what you're trying to accomplish. You know the amount of the Payment Intent that you're creating as well as the application_fee_amount, so you should already know how much is being transferred to the Connected Account.

steady kettle
#

Yes, I guess it's easier to do the subtraction myself: amount - application_fee_amount.

#

What I want is the net amount received by a connected account for a payment made by a customer, when I get a payment intent succeeded event.

#

I initially thought it would be safer to get this net amount value through the API, in case for some reason the net amount is not amount - application_fee_amount (in some exceptional cases).

rose remnant
#

When you say latest_charge isn't present when retrieving the Payment Intent, do you see charges instead? The change to latest_charge happened with our last API release, so if you're using an older version you may see different behavior.

steady kettle
#

Yes, I see charges instead. For my tests, I was using Stripe CLI from Stripe Dashboard in test mode.

rose remnant
#

Gotcha, then I think you'll be able to use the Charge contained in charges to follow the path I suggested before, but with the flow of funds for Destination Charges I don't think that will have the net amount that you're after.

steady kettle
#

ok, so the simple subtraction sounds like the best option.

Is it safe to assume the net amount received by the connected account will always match this subtraction? Or can Stripe increase or decrease the application fee I set on the payment intent, may be to compensate some previous incorrect fund moves?

rose remnant
#

As far as I know we do not ever modify the application fee amount that you set.

steady kettle
#

ok, great. Thank you for helping me to figure out what the right solution is ๐Ÿ™‚