Home > database >  Stripe payment checkout mehod can we set own parameter which we will received in a webhook
Stripe payment checkout mehod can we set own parameter which we will received in a webhook

Time:10-07

I am using strip payment gateway for checkout/session api

curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_51KsbPcLB0bpOdWONCou3sXoCW4CrkCZM6X007kKQgpL6: \
-d success_url="https://google.com/success" \
-d cancel_url="https://yahoo.com/cancel" \
-d "line_items[0][price_data][currency]"=USD \
-d "line_items[0][price_data][product_data][name]"=ABC \
-d "line_items[0][price_data][unit_amount]"=150 \
-d "line_items[0][quantity]"=1 \
-d mode=payment

can i set any parameter or identifiers manually in this which I will received in success strip web-hooks ?

CodePudding user response:

curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_51KsbPcLB0bpOdWONCou39HcsIbE2NTIP0fP5fxlPa0NxFwE3919SqG6jpXHE7uCXY8vFEvnjy7sXoCW4CrkCZM6X007kKQgpL6: \
-d success_url="https://google.com/success" \
-d cancel_url="https://yahoo.com/cancel" \
-d "line_items[0][price_data][currency]"=USD \
-d "line_items[0][price_data][product_data][name]"=ABC \
-d "line_items[0][price_data][unit_amount]"=150 \
-d "line_items[0][quantity]"=1 \
-d "metadata[order_id]"=waybill \
-d mode=payment

You can set metadata and you will received it in checkout.session.completed

  • Related