#yak_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1224685581972410440
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
have you read this guide on how to accept a payment? https://stripe.com/docs/payments/accept-a-payment
Thank you for your help, I will read it
I pasted the code but i got this error
The return_url parameter can only be used with ui_mode: custom or ui_mode: embedded.
Stripe\Exception\InvalidRequestException: The return_url parameter can only be used with ui_mode: custom or ui_mode: embedded.
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
'price_data' => [
'currency' => 'usd',
'product_data' => [
'name' => 'T-shirt',
],
'unit_amount' => 2000,
],
'quantity' => 1,
]],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '/test_pay/Public/success.html',
'return_url' => $YOUR_DOMAIN . '/test_pay/Public/cancel.html',
'automatic_tax' => [
'enabled' => true,
],
]);
this is my code
๐ taking over for my colleague. Let me catch up.
do you mean to use Stripe Checkout Sessions?
yes
then you don't have to use return_url
instead you use success_url and cancel_url
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-success_url
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-cancel_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.