Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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 ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading