#brave_monkey_33835_00636
1 messages · Page 1 of 1 (latest)
Which event type of your 3 webhook call backs?
Normally a Checkout Session will trigger one checkout_session.completed event
3 consecutive checkout sessions have been created
That means 3 different customer generated it
yes
They will have the same metadata yes. How do you want to distinguish them?
There can be 10 or dozens of them corresponding to your sales, in Production
The meta data will be different for each session. the above is just an example format that we used
i'm not quite sure i understand what's the problem you're trying to solve here : You asked How to identify which checkout sessions webhook received. - you should be able to identify each Checkout Session by their Checkout Session id, or metadata, or client_reference_id that you passed in
Now its working.
Is it possible to calculate the tax and stripe processing fee before the checkout session is created?
can you share more on what you're trying to achieve / do? Why do you need that information before the Checkout Session is created?
$unit_amount=100
$commission = 2.5;
$partner_amnt= $unit_amount - $commission;$session = \Stripe\Checkout\Session::create([
'client_reference_id' => $refernceid,
"success_url" => base_url("checkout/success"),
"cancel_url" => base_url("checkout/cancel"),
"mode" => 'payment',
"line_items" => [
[
"price_data" => [
"currency" => "mxn",
"product_data" => [
"name" => "Test",
"description" => "Testdata"
],
"unit_amount" => intval($unit_amount * 100)
],
"quantity" => 1
],
],
'payment_intent_data' => [
'transfer_data' => [
'amount' => intval($partner_amnt * 100),
'destination' => $destination,
],
],
'metadata' => [
'session_id' => $refernceid
],
]);
is it possible to calculate the fee (tax,stripefee) before the checkout session created.autotax disabled.
we don't provide any API for you to calculate that before the Checkout Session is created if that's what you're asking
how to collect taxes for one-time payments in Stripe Checkout?Is it possible to define ?
you might want to take a look at this guide : https://stripe.com/docs/payments/checkout/taxes
$paymentIntent = \Stripe\PaymentIntent::create([
'payment_method_types' => ['card'],
'amount' => intval($trxn_amount * 100), // Convert to cents
'customer' => $customer->id,
'currency' => 'mxn',
'transfer_data' => [
'amount' => $amountForAccount1, // co
'destination' => $destinationAccount1, // Connected account ID1
],
'transfer_data' => [
'amount' => $amountForAccount2, //receiver
'destination' => $destinationAccount2, // Connected account ID2
],
]);
Transfer not happened to firstaccount
please always provide the corresponding request id or object id - can you please share that?