#khushal_sub-schedules
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- khushal_api, 1 hour ago, 14 messages
๐ 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/1234800865072648192
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
What specific issues are you encountering? What have you tried?
it's showing two subcription on the customer side.
firstly i have created subscription and using same plan id i have created subscription schedule
Seems expected!
Can you help me understand the issue exactly?
yes
khushal_sub-schedules
I need to directly charge cusomter to subcription shedulde using payment elment for that i need clientSecret so how i can get clientSecret ?
Same as a normal Subscription really โ you'd want to pass the expand parameter in your API call, and expand the subscription.latest_invoice.payment_intent field
like this ?
Yep!
Seems pretty verbose โ you're passing invalid parameters for that API
so we don't need payment behavior and payment settings ?
They're not supported no
so on which object i can get client_secret ?
Payment Intent
It's easier if you just share the sub_xxx ID with me
OK, it's because the behaviour of subscriptions generated by a schedule differ. The initial invoice doesn't automatically finalize immediately โ it's after ~1 hour. Until that point there's no payment intent
So you'll need to manually finalize the invoice after creating
so how i can manage it on payment element i need to charge customer immediately
Call this API after creating the schedule: https://docs.stripe.com/api/invoices/finalize
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You can pass expand: ['payment_intent'] to that endpoint and you'll have your client_secret in the response
Okay
and what if after creating subscription schedule i get subscription and update that subscription and get payment behaviour update ?
I don't know what you're asking me
okay let me chekc above things i will let you know if this work for me or not.
it's showing like this when i try to finalise invoice of subscription schedule
it should be $subscriptionS->subcription->latest_invoice->id
yaa okay got it
having issue on confirm payment in invoice
{
"type": "invalid_request_error",
"message": "The provided setup_future_usage (null) does not match the expected setup_future_usage (off_session). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements.",
"param": "setup_future_usage",
"payment_intent": {
"id": "pi_3PBEOGHDWzepBBxW018MUwoe",
"object": "payment_intent",
"amount": 200000,
"amount_details": {
"tip": {}
},
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3PBEOGHDWzepBBxW018MUwoe_secret_qaTOkMIIMY2tOdEWc6kuO92LC",
"confirmation_method": "automatic",
"created": 1714474708,
"currency": "usd",
"description": "Subscription creation",
"last_payment_error": null,
"livemode": false,
"next_action": null,
"payment_method": null,
"payment_method_configuration_details": null,
"payment_method_options": {
"us_bank_account": {
"verification_method": "automatic"
}
},
"payment_method_types": [
"card",
"cashapp",
"link",
"us_bank_account"
],
"processing": null,
"receipt_email": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"status": "requires_payment_method"
},
"request_log_url": "https://dashboard.stripe.com/test/logs/req_qbCTyYbeNra4wV?t=1714474708",
"shouldRetry": false
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
what does your frontend code for creating the elements object and calling confirmPayment look like?
you have to either
a) call https://docs.stripe.com/api/payment_intents/update#update_payment_intent-setup_future_usage to set off_session on the PaymentIntent from the schedule->subscription->invoice->payment_intent, on the backend before doing the payment on the frontend ; or
b) remove setup_future_usage from the options on the frontend