#phoxhole - fees

1 messages · Page 1 of 1 (latest)

dry orchid
#

to rephrase, you want to see the fees associated with a given payment?

mighty zealot
#

yes, but without sending a second API request. Is there a way to have that sent back with the charge results?

dry orchid
#

You can use expansion to get the balance_transaction associated with a given charge:
https://stripe.com/docs/api/expanding_objects
expand[]=balance_transaction which includes the stripe fee as discussed here:
https://stripe.com/docs/expand/use-cases#stripe-fee-for-payment

Learn how to leverage expand to perform common tasks

#

(this example starts with a payment intent, but works the same if you're starting with a charge, just a shorter expansion path)

mighty zealot
#

i'm using connect and sending a charge

#

i'm also working with classic ASP

dry orchid
#

Are you using direct charges or destination?

mighty zealot
#

direct (I think)

dry orchid
#

right, so you'd make the same request then but using the same stripe-account header to retrieve as you used to create the cahrge

mighty zealot
#

meaning, a second API call

#

i'm trying to determine if i can get the fee information included in the return package from the charge

#

if not, i'll go down the path of a second call

dry orchid
#

you mean a charge post request?

mighty zealot
#

yes

dry orchid
#

sure, you can include the same expansion there

#

add expand[]=balance_transaction

#

then you can inspect the balance transaction object in the response to find the fees

mighty zealot
#

I"m constructing a URL string with data in it for the post:

data = "amount=" & totalAmt & "&currency=usd&source=" & thisToken & "&application_fee=" & cFees & "&description=" & Agency & " license charge (License No.: " & licenseNum & ")&receipt_email=" & aEmail

are you saying I can add that to this string?

dry orchid
#

ah, i see, you're not using our client library then

#

sure you should be able to add &expand[]=balance_transaction to that

mighty zealot
#

awesome - thanks for your time

#

and Discord is a great move from IRC!

dry orchid
#

my pleasure!

#

it certainly offers a fancier UI 😄

mighty zealot
#

does test mode simulate fees?

#

i can't remember

#

i'll look it up - thanks again.