Forum Academy Marketplace Showcase Pricing Features

Stripe Workflow Data

Hello everyone! I am currently using Stripe for payments in North America, Brazil, and Europe. However, there are varying fee structures for charges in different countries. For example, fees for charges using Brazilian credit cards are higher than American cards. Is there any way to retrieve the Stripe fee for a credit card charge via the built in Bubble Stripe plugin? If not, I guess I’ll build my own API call to call that specific transaction by ID. Just hoping to save some production time! If I don’t hear back, I’ll set up that custom API call and post the process here for future users.

UPDATE:
Okay, setting up the API was easy enough:

Use HTTP Basic Auth
Username is your live secret key with a “:” added to the end (prevents the need for a password)

To get the Stripe fee for a credit card charge, you need to set up TWO calls

Retrieve Charge:
GET https://api.stripe.com/v1/charges/[charge_id]
charge_id is a variable that you set to NOT private so you can replace it using workflows.

Retrieve Balance Transaction:
GET https://api.stripe.com/v1/balance_transactions/[transaction_id]
transaction_id is a variable that you set to NOT private so you can replace it using workflows.

NOW, when you charge a credit card using the built in Stripe plugin, you can use “results of Step X” to get the charge ID. You can also get the payment intent ID which has all sorts of data, but for this use case the charge ID works.

You then call the Retrieve Charge API call using the charge ID from the workflow above, which will return a bunch of data about that charge. You will then use the “Balance Transaction” for that charge to call the Retrieve Balance Transaction API call. This call will have a data point called “fee” which is… the Stripe fee for that Balance Transaction. Don’t forget that this will be presented in CENTS, so if you need it in dollars, divide by 100 and round to 2.

I hope this helps someone!