#mike35x95x1-checkout
1 messages ยท Page 1 of 1 (latest)
hi! I wasn't aware we had a partial payment feature in Checkout so I'm not sure how you'd test it. Do you have a reference to this?
omg - so I misunderstood something ๐คฆโโ๏ธ
can you please explain situation when there are multiple charges on one checkout?
usually it means the customer tried to pay and it declined, and they tried again, and etc until one of them succeeds
I see... so I only can read the last one and see if it's successful, right?
well if it's Checkout you only need to look when you recieve a checkout.session.completed webhook event and at that point you know the payment was successful; the details are in the PaymentIntent and payment_intent.charges.data[0] associated with the Session.
yes, I know. I have both ways how to know the result (based which comes first). Can I rely on paymentIntent.amount_received or should I read it from successful charge? or it doesn't matter?
they both seem fine
ok, thank you
oh, one more thing
is it possible to define app commission (excluding stripe fees) before transfer to connected account? example:
- total amount = 10 USD
- commission (8%, min. 2 USD) = 2 USD
- stripe fees (based on card) = 1.5 USD
- amount to transfer 6.5 USD
the commission is defined by the integer application_fee_amount you pass to the CheckoutSession when creating it(https://stripe.com/docs/connect/collect-then-transfer-guide?platform=web&elements-or-checkout=checkout#accept-payment)
You could calculate the amount you want to take and pass it in at that point
According to the docs the application_fee_amount is regardless the stripe fees. The problem is that we don't know the fees before the payment and we don't want to pay the fees from our pocket. On the other hand we don't want to include the highest possible stripe fees (to cover all scenarios) which would make our commission too high. So we don't use auto transfer and calculate the fee on our side and create the transfer manually. Any suggestion how to do it another way?
yes you can't know the exact Stripe fee upfront since e.g. it might be different if the customer chooses a certain type of card
exactly. it would be nice to have same parameter "add_fees_in_commission"
the recommended approach is to take a blended fee amount that lets you make a profit in any circumstance (but you say you don't want that)
otherwise you can try to integrate with Separate Charges and Transfers (https://stripe.com/docs/connect/charges-transfers) yes, and that way you can read the final fee(https://stripe.com/docs/expand/use-cases#stripe-fee-for-payment) and make your transfer based on that.
ok, thanks
can you please explain this?
is the amount_captured in % or in "money"?
the reference to the "amount attribute" makes it even more confusing
Taking over for my colleague. Let me catch up.
Are you asking about this field ?
https://stripe.com/docs/api/charges/object#charge_object-amount_captured
well, yes. I am trying to find out which field(s) I should use to get amount captured by the charge on linked to the paymentIntent
there is paymentIntent.amount_received and paymentIntent.charge.amount_capture.
the sdk tells me it's in %s... ๐ฎ
You should refer to the official documentation
Amount in cents captured (can be less than the amount attribute on the charge if a partial capture was made).
based on the documentation, the amount is in cents
it mentions that the amount is in cents
well, ok. ๐ I will follow the website rather than the documentation in the code... ๐
or this field directly in the Payment Intent as you mentioned above
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount_received
back to my question - which field(s) I should use to calculate real money captured on the paymentIntent?
the amount_received or charge.amount_captured? is there safer (more correct) way?
you should just use the amount_received on the PaymentIntent
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount_received