#idempotency_key
1 messages · Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_AyDYjvGuEh4jGg
🙂
Got it. I can see you are trying to pass the idempotency key to your request. However, the idempotency_key should be passed to the second array in the request. You can find an example here https://stripe.com/docs/api/idempotent_requests?lang=php
can you share with me the code?
{
"payment_method_types": {
"0": "card"
},
"payment_method": "pm_1L52MjFWb9Y3fHFEIHyJmjK1",
"amount": "6654",
"description": "Booking Id: 17112\nTour Package: Dixie's Lower Antelope Canyon Tours\nTour Date: 2022-05-30\nTour Time: 16:45:00\nTourists: 1\nEmail: john@test.com",
"metadata": {
"Booking Id": "17112",
"Tour Package": "Dixie's Lower Antelope Canyon Tours",
"Tour Date": "2022-05-30",
"Tour Time": "16:45:00",
"Tourists": "1",
"Customer Name": "John",
"Customer Phone": "01234567890",
"Email": "john@test.com"
},
"idempotency_key": "17112",
"currency": "usd",
"confirm": "true",
"statement_descriptor": "Dixies Lower Antelope",
"application_fee_amount": "592",
"transfer_data": {
"destination": "acct_1KiPPfF2s9WqF2Qr"
}
}
I mean your PHP code
Paste the code here please?
$payment_intent = \Stripe\PaymentIntent::create([
'payment_method_types' => ['card'],
'payment_method' => $method->id,
'amount' => $total * 100,
'description' => 'Booking Id: ' . $request->bookingId .
"\nTour Package: " . $bookingData->tour_operator_name.
"\nTour Date: " . $bookingData->Date .
"\nTour Time: " . $bookingData->StartTime .
"\nTourists: " . $bookingData->tourists.
"\nEmail: " . $bookingData->Email,
'metadata' => [
'Booking Id' => $request->bookingId,
'Tour Package' => $bookingData->tour_operator_name,
'Tour Date' => $bookingData->Date,
'Tour Time' => $bookingData->StartTime,
'Tourists' => $bookingData->tourists,
'Customer Name' => $bookingData->Name,
'Customer Phone' => $bookingData->ContactNumber,
'Email' => $bookingData->Email,
],
['idempotency_key' => $request->bookingId],
'currency' => 'usd',
'confirm' => true,
'statement_descriptor' => 'Dixies Lower Antelope',
'application_fee_amount' => $destination_amount * 100,
'transfer_data' => [
'destination' => 'acct_1KiPPfF2s9WqF2Qr',
],
]);
'payment_method_types' => ['card'],
'payment_method' => $method->id,
'amount' => $total * 100,
'description' => 'Booking Id: ' . $request->bookingId .
"\nTour Package: " . $bookingData->tour_operator_name.
"\nTour Date: " . $bookingData->Date .
"\nTour Time: " . $bookingData->StartTime .
"\nTourists: " . $bookingData->tourists.
"\nEmail: " . $bookingData->Email,
'metadata' => [
'Booking Id' => $request->bookingId,
'Tour Package' => $bookingData->tour_operator_name,
'Tour Date' => $bookingData->Date,
'Tour Time' => $bookingData->StartTime,
'Tourists' => $bookingData->tourists,
'Customer Name' => $bookingData->Name,
'Customer Phone' => $bookingData->ContactNumber,
'Email' => $bookingData->Email,
],
'currency' => 'usd',
'confirm' => true,
'statement_descriptor' => 'Dixies Lower Antelope',
'application_fee_amount' => $destination_amount * 100,
'transfer_data' => [
'destination' => 'acct_1KiPPfF2s9WqF2Qr',
],
],['idempotency_key' => $request->bookingId]);```
can you try this?