Wappler’s shopping cart tutorial is based on a straight ecommerce where a client pays a store. That works well for this use case.
Our website is a platform connecting people, and taking a fee. We are using the method where the payment directly goes to the Connected Account and an Application Fee comes back to us (as opposed to our website getting paid and doing a Payout to another account)
We are following:
Enable other businesses to accept payments directly (stripe.com)
and
Creating direct charges (stripe.com)
We are able to create a checkout session, pass the title(name), currency, amount, and on_behalf_of (connected account id)
This all works well and we have gone to the checkout page, used a test card, verified payments through webhooks. All good.
But as soon as we add an Application Fee, the API returns this error: "Can only apply an application_fee_amount when the PaymentIntent is attempting a direct payment (using an OAuth key or Stripe-Account header) or destination payment (using ‘transfer_data[destination]’).
What should we do differently to allow for the Application Fee to work?