#Prabu

1 messages · Page 1 of 1 (latest)

neon wadiBOT
hoary python
#

How to get actual Net price show in dashboard screen?

solar pine
#

Um how does the fee_details look like?

hoary python
#

[#Stripe::StripeObject:0x6c7f0 JSON: {
"amount": 373,
"application": null,
"currency": "usd",
"description": "Stripe processing fees",
"type": "stripe_fee"
},
#Stripe::StripeObject:0x6c804 JSON: {
"amount": 4594,
"application": "ca_HmPhBnh4mJ6myHFh5dGlBv3Cjw1vwGM2",
"currency": "usd",
"description": "Atrium Innovations Inc application fee",
"type": "application_fee"
}]

#

the above detail only in fee_details

#

unable to see this information also Stripe processing fee refund:-US$1.11

#

please help me on get value of actual net price i.e 3140

solar pine
#

So we are missing the $1.11 part

hoary python
#

yes

solar pine
#

I think $3.73-$1.11 is the actual fee, since you only capture $79.96 out of $118.2

hoary python
#

only in partial refund transaction

solar pine
#

So the "re-calculate" fee would be calculated based of $79.96 = $2.62, hence it's displayed as $3.73 processing fee and -$1.11 refunded

hoary python
#

how to get refunded stripe fees ?

#

Amount is US$ 118.20
Captured only US$ 79.96
Refunded US$38.24
How to get net price after refund.

solar pine
#

Hmm let me look a bit closer

hoary python
#

ok sure

solar pine
#

So just purely calculating it. Stripe fee = 2.9% + $0.3. So the Stripe fee is (2.9%+0.3) of $79.96 = $2.62. You take that with $45.94 application fee = $48.56.

#

Then take the total $118.20 - $48.56 = $31.40

#

But I am looking at how to calculate the $2.62 based on API property 🤔

hoary python
#

Refunded $38.24
captured $79.96
API returned Net Price is $68.53
re_calculate_stripe_fees = (((79.96 * 2.9) / 100) + 0.3) = 2.62
net_price = 68.53 - 38.24 + (3.73-2.62)

#

Shall I get using above calculation manually?

#

it would be helpful if i get everything in api response for partial refund.

solar pine
#

Yep I agree, yes the calculation matches but I am searching on the API surface if there is anything can let you avoid the 2.9% + 0.3 calculation

hoary python
#

yes

solar pine
#

And what if you Retrieve the Balance Transaction of that Refund?

hoary python
#

i will check

solar pine
#

I think it should have $1.11 inside

hoary python
#

#Stripe::ListObject:0x6c8a4 JSON: {
"object": "list",
"count": 1,
"data": [
{"id":"re_3N0kPWIISZpAKYWE0WT59gZS","object":"refund","amount":3824,"balance_transaction":{"id":"txn_3N0kPWIISZpAKYWE0uTAnqbu","object":"balance_transaction","amount":-3824,"available_on":1682985600,"created":1682423665,"currency":"usd","description":"REFUND FOR CHARGE (Order ID: 19415963)","exchange_rate":null,"fee":-111,"fee_details":[{"amount":-111,"application":null,"currency":"usd","description":"Stripe processing fee refund","type":"stripe_fee"}],"net":-3713,"reporting_category":"partial_capture_reversal","source":"re_3N0kPWIISZpAKYWE0WT59gZS","status":"pending","type":"refund"},"charge":"ch_3N0kPWIISZpAKYWE0wNZ4woK","created":1682423665,"currency":"usd","metadata":{},"payment_intent":"pi_3N0kPWIISZpAKYWE0Ln9a7Xw","reason":null,"receipt_number":null,"source_transfer_reversal":null,"status":"succeeded","transfer_reversal":null}
],
"has_more": false,
"url": "/v1/refunds"
}

solar pine
#

Yep that's is -111 !

#

So you take that directly and feed into your calculation ealier

#

net_price = 68.53 - 38.24 + 1.11

neon wadiBOT