#pauline_best-practices

1 messages ยท Page 1 of 1 (latest)

long forgeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1405727063947870339

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

quasi mantle
#

We collected a fee of $17.70 from a payment of $70 instead of $15.49

Expected Behavior
our commission is $20% so should be $14
and then Stripe fee is only 1.70% + 30c (as it's an AU card)
so should be $1.19 + 0.$30c = $1.49
which means that we should only collect a fee of $15.49

Actual Behavior
for this booking, client used the $10 discount code so initial price was $80 but they paid $70
and it looks like we calculcated our commission & Stripe fee from this amount --> $80_20%= $16 + 80_1.70% +0.30 = 1.7 so total deducted = 17.7

gaunt dome
#

hello, thanks for the details. give me some time to take a look

quasi mantle
#

thank you

gaunt dome
#

thanks for waiting, so the behaviour you're sharing is actually expected. the application fee is always calculated from the charge amount ($80) when you set it while creating the payment, not charge amount after discount ($70)

quasi mantle
#

there is no way to make this work, I'm for sure not the only one using your system for this

#

or is there a way to auto-refund the difference?

gaunt dome
#

sorry I haven't finish, give me some time to share

quasi mantle
#

ok sorry

gaunt dome
#

I can see that you are using Stripe Checkout in payment mode, so what you can do is.

Step 1: create the Checkout Session with with the product amount: $80, and tell Stripe to authorize the payment only: https://docs.stripe.com/payments/place-a-hold-on-a-payment-method#authorize-only
At this step, you do not need to specify the application_fee yet
If the customer use a discount in the Checkout Session, you will know what's the final authorized amount once the customer completes the payment session

Step 2: With the final authorized amount (e.g. $70), you can take the payment intent from the Checkout Session, and specifying the application fee while capturing it:
https://docs.stripe.com/api/payment_intents/capture#capture_payment_intent-application_fee_amount
This allows your integration to know the final payment amount, and set the correct application_fee

quasi mantle
#

ok sounds good, I'll give it a go!

#

Another question if you don't mind

gaunt dome
#

sure

quasi mantle
#

in the scenario, I shared above, the discount code impacts the amount received by the connected account

#

if we wanted to offer a discount to clients without affecting the amount received by the connected account (so us the marketplace would be offering a discount but not the supplier) - for example,we have clients who buy gift card from us & then use these to book/pay on the platform using a coupon code

#

how could we pay the connected account (and charge the fee) as if no coupon was used

gaunt dome
#

So the customers will use a coupon, offer by yourself (the marketplace) to transact with your suppliers, but you do not want to affect the money your marketplace transfers to suppliers โ€” is this correct?

#

Will there ever be an instance where the customer pays less than what you transfer to your suppliers?

#

To be clear, the definitions are:
Marketplace - your Platform Stripe account
Suppliers - the connected accounts created by your Platform
Customers - end customers making the payment

quasi mantle
#

yes that's correct

gaunt dome
#

If there will never be an instance where the customers pays less than what your Platform transfers to suppliers, then your current payment setup using Destination Charge would still work, this is because application_fee (money you transfer to suppliers) will always be less or equal to the final charge amount customer pays.

quasi mantle
#

my issue in this case is no the application fee

#

the application fee is correct but it is deducted from the amount paid

#

by the customer

#

post coupon being used

#

and I'd like to be deducted from original amount pre coupon

gaunt dome
#

The application_fee is an integer set by your payment integration. So your integration will have to handle the calculation of what is the exact application fee to set on the payment (whether its calculated pre or post coupon)
But what I want to highlight is if application_fee becomes more than charge amount, then you cannot create a Destination charge and would have to use seperate charge and transfer: https://docs.stripe.com/connect/separate-charges-and-transfers