Forum Academy Marketplace Showcase Pricing Features

Issue a refund stripe.js - Single charge


I am trying to implement a refund action in the workflow using Stripe.js 2.

I used the “Stripe.js - Refund - Create” action, but when I look in Stripe’s dashboard, there are no refunds there.

The paymenntIntent/charge ID I used the charge ID. According to the documentation, you can use either.

Can someone help?

thank you

I found the solution. in case someone has the same problem in future and comes accross my initial post here’s the fix that I found:

This applies to a single charge, meaning that someone pays for something on your web app like food or buying clothes, etc. (not subscriptions).

When I charged a user for x$, I was saving the amount in my database.
1- charge current user x$/
2- Save in database result of step 1’s amount
For some reason, when a user is charged using the Stripe plugin built by Bubble, Bubble saved the amount as x00. example: charge user 5$, bubble will save 500 in the databse.
Now, when I was trying to refund the amount in the database, I was trying to refund 500$. Since Stripe sees the charge as 5$ with the charge ID, it wasn’t going through.
To fix this, when you save the amount in the database, save it as:
Result of step 1 (or wtv step number)'s amount/100.
Now Stripe will be able to refund the amount that was charged.

This is because of how Stripe handles number values associated with prices. In Stripe it is all done as in cents, so $5 USD is 500 cents. They also handle dates differently. Stripe uses the number of seconds since Epoch time while Bubble uses milliseconds…makes it necessary to have conversions for these when wanting to display the proper values in your Bubble app, as well as creating the filtering and pagination features to display list of things from Stripe.

Learn More

Boston85719 is an expert Bubbler with a decade experience as an educator. Real name Matthew, he has been actively building SaaS apps, marketplace apps, scheduling apps and more for clients, himself and for sale as templates.

As an official Bubble Bootcamp Instructor, he leads Bubble Bootcamps on a regular basis.

Always willing to offer advice via the Bubble Forum, Matthew also offers Private Personal and Group Training Sessions.

Through his site, NoCodeTrainer, Matthew provides a range of tutorials with editor access to help you jumpstart your Bubble development.

Always accessible you can send Matthew a private message via the forum or send an email directly with your requests.

Be sure to checkout the Stripe Integration Course when you are ready to integrate Stripe payments to start monetizing your application via product sales or subscriptions.

Stripe Integration Course

This topic was automatically closed after 70 days. New replies are no longer allowed.