In my app, I have a marketplace where one user accepts payment from another user through Stripe.
I want to save the amount the the Payee receives, so that he/she can look up that amount and also view the total amount they have collected. I created Amount Paid as a field in a data type - and have it save as a Number. However, when I use the dynamic data to take the “Amount Charged” from the Stripe workflow, it does not include decimal places, and shows $399.00 as 39900.
Example:
I have tried having the “Amount Charged” field save formatted as currency or with decimal places, however, I get a message saying this conflicts with the field type I have set for the field (number), and it should be text. However, if I do that will I not be able to sum the number and get total amounts?
Here is the workflow of saving the amount. It includes the calculation of the app fee as the buyer pays it but I do not want it showing up as revenue for the Payee. Regardless, whether there is a calculation or just “Amount Charged” I come across this.
When you display the data for the user, you should be able to use :formatted as then select currency as number type. The number stored in the database will always be a number, but on display, you can format it how you want. So, do ":formatted as’ in the text element of your user interface rather than within your saving workflow.
Edit: Also, it looks like it records the amount with 2 decimal places, so use that with the formatting (although I believe 2 decimal places is the default anyway when selecting currency as number type).
Thanks for the reply.
However, when I display the amount it does not move the decimal places.
The amount being recorded as data from Stripe was for $399.00, and is going into the database as 39900. When I display this data as text, if I use 2 decimal places it becomes “39900.00”. If I use no decimal places it is “39900” regardless if it is set up to show as currency. I cannot show or use the number as its actual value of 399.
This makes me think I am saving the info in the field incorrectly?
Unless the information coming from Stripe’s Amount Charged is in a poor format, but I would think someone else would have come across this by now if that was the case.
I am saving them as a number and currently there are no decimal places in this case the $399, was saved simply as the number “399”. If I try and save this number formatted as currency or a decimal, it says the field type must be text, not a number?
Hopefully someone else who has used it more can jump in. I just tested myself by manually typing in a number and it saved it properly, so that’s why I’m asking about sources for those amounts.
@gf_wolfer Was this ever resolved? I’m running into this issue and my users are receiving emails stating they were charged 100x more than they actually were O_o
What I ended up doing was calculating and saving the Stripe Fee before this happens.
So if my app will charge 2%, then I calculate the 2% before the Charge a User workflow
Then in the Charge a User Workflow I put the Stripe Fee as the data point saved
And for any future reference to the Stripe Fee I use the saved amount that I calculated in the beginning.
So essentially I no longer save a number from the ‘Charge a User’ workflow
If you need to save the amount from the Charge workflow, I have seen before that Stripe returns the dollar amounts in Cents - so you would need to divide the amount from the Charge a User workflow by 100.
Thanks for that explanation, that is actually my next step.
As you can see below, I have set up an App fee for payments made to Trans. payee. I have set up a seller account for Trans. payee and I see test payments being processed by Stripe for the seller, but Stripe pays the seller for all of the Amount while no App fee is paid to me,
How can I make sure the App fee is charged and Stripe pays it to me? thanks
It all looks good.
Have you double checked the Stripe Payment information on the dashboard?
Specifically, it will show up under the Seller’s payments as the full amount, and the seller can see the fee and who it goes to when they hover over the information (breaks down Stripe and application fee)