#muneeb-t4_code
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/1337327622387929140
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! can you share the request id [0]? it'd look like req_xxx
[0] https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site 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_WvYE7hql6w0XbR
you seem to have already deleted the price that you used : price_1QplmoGromJI4G1jJqSf1nT5, it no longer exists in your Stripe account
can you try again with a new Price?
ok
req_rvVSyzmU4Gtq9F
You must provide at least one recurring price in subscription mode when using prices.
when i use
'mode' => 'payment',
i get this error
Invalid string: {:"0"=>"subscription", :"1"=>"payment"}
req_r6a97ZInooavSw
The request shows your application passing in {:\"0\"=>\"subscription\", :\"1\"=>\"payment\"}" into the mode parameter : https://dashboard.stripe.com/test/logs/req_r6a97ZInooavSw
you should fix that
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Actually i want to make prices based on the number of months user is subscribing for, if it is for one month than it should be one-off payment but i am getting error with that. and if i am making a recurring payment how to set the end date of subscription, like one month 2 month month etc.
{
"cancel_url": "http://127.0.0.1:8000/pricing",
"customer": "cus_Riwd5xE1Jneqn9",
"line_items": {
"0": {
"price": "price_1QpmH7GromJI4G1jiG4ChjDc",
"quantity": "1"
}
},
"mode": {
"0": "subscription",
"1": "payment"
},
"subscription_data": {
"metadata": {
"name": "price_1QpmH7GromJI4G1jiG4ChjDc",
"type": "price_1QpmH7GromJI4G1jiG4ChjDc"
}
},
"success_url": "http://127.0.0.1:8000/dashboard"
}
'mode' => 'payment',
i am passing mode as payment not both, how to fix that?
{
return $request->user()
->newSubscription($plan, $plan)
->checkout([
'mode' => 'payment',
'success_url' => route('dashboard'),
'cancel_url' => route('pricing'),
'line_items' => [
[
'price' => $plan,
'quantity' => $request->params['quantity'],
],
],
]);
}```
if it is for one month than it should be one-off payment but i am getting error with that.
I don't know what error you're referring to specifically, but this logic should be defined within your own application, as Stripe cannot determine that a one month payment should be mode='payment'.
if i am making a recurring payment how to set the end date of subscription, like one month 2 month month etc.
You need to use subscription schedules for this. You can read more about this here: https://docs.stripe.com/billing/subscriptions/subscription-schedules
You would probably want to listen for the invoice.paid webhook event : https://stripe.com/docs/billing/subscriptions/webhooks#events and check the billing_reason : https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason, and after the first invoice of the Subscription is paid, you then create a subscription schedule for the existing subscription, and subsequently update the subscription schedule to end after x number of iterations
i 'll read the documentation and than let you know