#rdsdaw2022 - Application Fee Ids
1 messages ยท Page 1 of 1 (latest)
Hello Snufkin
You can actually refund the application fee along with the original charge. We show this here:
https://stripe.com/docs/connect/destination-charges#refunding-app-fee
I used direct charge instead of transfer. And I saw following in the API docs.
const refund = await stripe.refunds.create({
charge: '{CHARGE_ID}',
refund_application_fee: true,
}, {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
But I do not have Charge Id. I have payment_intent_id.
so I can put payment_intent_id in the Charge key?
Gonna test that. Give me a sec
thank you
Okay you will need to specify the Charge ID ch_XXXX
You can find this on the Payment Intent object in the charges:[] array
Sorry, charges.data: [] is the array.
yeah, that array does not have charge_id
Can you share the PI ID?
"charges": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_3KyzsLEna0Ypzfuf13YQh9gR"
}
there is the Payment Intent Id
I'm not sure where you are grabbing that data from but the Payment Intent does have a charge in it
There is also a successful refund
I grabbed it from the response I got. There is successful refund, but the application_fee_amount of 20 cents is not deducted from the platform account
So I am looking how I can refund the application_fee_amount back to the connected account.
Also, where do you see Charge Id? I do not see even when I look at the Logs for that payment intent. All I see in the enpty data array inside it. What I had posted above.
Yeah I'm looking in admin view. In some views we don't display all the data because it isn't relevant. I'm looking for where you can see the whole thing
I see ok. Is there any way I can get the Charge_id from payment_intent_id?
Sure: ch_3KyzsLEna0Ypzfuf18DmpZP9
You can also query the API by the Payment Intent to receive the full object: https://stripe.com/docs/api/payment_intents/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Even in this link, the response shown doe snot have charge_id in it.
What do you mean "in this link"? This page is just trying to show you how you would use the API to retrieve a Payment Intent and an example of what one would look like
I meant that example response. On that example, I do not see Charge_Id
It's not expected that there is always a charge. If the Payment Intent has not created a charge yet
Payment Intents can have 0, 1, or more charges associated with them
When the payment is successful, would not there be a Charge? The payment was successful for this payment intent.
Nope then there is a charge, which I can see and you would if you retrieved the object from the API
ok. I will try to pull through the API then, perhaps the example response just shows the payment_intent before the status of succeeded.
When you look at the Payment Intent in the Dashboard, what do you see in the Connections section?
Additionally, if you look in the Events and logs section, you should see the Charge in the event for the Payment Intent succeeding. You will need to expand the data view though
Where is the connections section? I just look at Logs after clicking the Developers Tab. On the Logs, I see the 200 OK for the confirm payment, but the response body I see does not have Charge_id
In fact it does not even have Charge section at all on the Response Body
Look in the Payments tab of the Dashboard and find the payment
ok I see in there. thanks for pointing me to right place to see.
How does the application_fee_amount get refunded to connected account if it is partial refund?
that is why I wanted to use the application_fee id so that I could send the correct application_fee amount to be refunded.
It's automatically proportional to the amount refunded/total amount
Will there not be rounding issues?
I get "message": "Received unknown parameter: id", when I try to retrieve payment_intent object using the id.
https://api.stripe.com/v1/payment_intents/retrieve?id=pi_3KyzsLEna0Ypzfuf13YQh9gR is what I use as the end point
The pattern for the URL is as follows: GET /v1/payment_intents/:id. where :id is the id you passed ( no "retrieve", no "?id=")
I see thanks