Stripe plugin – Problems with charging app fee

I’m wondering if anyone can help me with a problem I’m having getting setup with Stripe using @bubble’s own Stripe plugin. I am using the ‘Charge the current user’ action, and testing with a test seller who is set up with Stripe Connect under a ‘Standard’ account (not ‘Express’). I have completed the user’s Stripe onboarding all the way to the end (submission of test documents, bank details, etc.). Every time I press the purple ‘Pay Now’ button in the screenshot, I get this error:

Stripe error: Can only apply an application_fee_amount when the Paymentintent is attempting a direct payment (using an Auth key or Stripe-Account header) or destination payment (using transfer_data[destination]).

Also, in my Stripe dashboard, I see the following error (400 ERR):

parameter_missing - application_fee_amount

Looks like you are missing the application_fee_amount field. This field allows the platform to take an application fee on direct charges. It can be any positive number up to the amount of the charge.

When I uncheck the box ‘The payee of this transaction is another user’, there is no error and the user is taken to Stripe to enter card details. However, this will not work for me because I need to deduct my app’s commission and then transfer the rest to the seller.

I tried making the app fee zero, just to see what would happen. When I did that, I got a different error:

Payee either does not have a stripe account setup or else has a privacy rule blocking access to social networks, which prevents this action from working.

Neither of these statements is true. The Stripe account is setup and the Stripe account ID is in the database. I have also checked that there is no privacy rule blocking access to social networks. As an extreme test, I even tried deleting all my privacy rules, but still got the same error.

1 Like

In debug mode have you checked both these expressions are producing values? to rule out privacy rules etc, and ensured the user give has done the sign up etc.

Hi @Oliver-wholegraintech, nice to have your help again! Yes, I have checked that. Here’s a screenshot:

Hellooo :slightly_smiling_face:

Tbh I can’t see anything you’ve done incorrectly, but personally I tend to just use the stripe API directly to avoid potential limitations I’ve had in the past.

You could potentially troubleshoot this, or you could just spend the time setting up the API calls direct and have it all perfect :sweat_smile:

Ah yes, I would be very happy to do that. But I find it quite difficult. Can you recommend a great tutorial anywhere online? I have struggled to find one.

Shoot me a DM and we can line up a quick screen share, I’ll get you on the right track

That’s very kind of you, @Oliver-wholegraintech. However, could we do it here? One of the beauties of this forum is that one person finding a resolution here enables many others to solve the same problem. I have seen many Bubblers posting on the same issue, but none ultimately finding the answers they’re looking for. :slight_smile:

Sure thing, its just fairly generic then, I would suggest:

1 - Learn how to use Postman - Postman documentation overview | Postman Learning Center
2 - Check out the Stripe API docs and read through the connect marketplace setup guides etc- Stripe API Reference + Stripe Connect | Stripe Documentation
3 - Start testing out these calls and processes in postman, with the help of the Stripe Postman collection - Postman
4 - Now learn about the Bubble API connector so you can transfer your api knowledge to bubble - The API Connector - Bubble Docs
5 - you’ll be all set to implement connect or anything else from stripe into your app!

Ok, I heard back from Bubble Support on this. What I didn’t realise is that I had to set the default redirection URL in Stripe to Stripe Authentication (different to what I was doing with the plugin I was previously using), and Stripe will then redirect the user to the page where they left my app, where the same workflow where I charged the Current User would then continue. I then needed to add a condition to the next action that the ‘Result of Step x’s Charge ID is not empty’, so that my app would know that the transaction was successful and therefore know what to do next.

As so often, it’s easy when you know how!! The error message I was seeing was not exactly very revealing as to the cause of the problem.