#khushal_sub-schedules

1 messages ยท Page 1 of 1 (latest)

alpine mapleBOT
prisma wagonBOT
#

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.

alpine mapleBOT
#

๐Ÿ‘‹ 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.

prisma wagonBOT
floral goblet
#

What specific issues are you encountering? What have you tried?

orchid egret
#

it's showing two subcription on the customer side.

#

firstly i have created subscription and using same plan id i have created subscription schedule

floral goblet
#

Can you help me understand the issue exactly?

orchid egret
#

yes

alpine mapleBOT
#

khushal_sub-schedules

orchid egret
#

I need to directly charge cusomter to subcription shedulde using payment elment for that i need clientSecret so how i can get clientSecret ?

floral goblet
#

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

orchid egret
#

like this ?

floral goblet
#

Yep!

orchid egret
#

okay let me check

#

getting this error

floral goblet
#

Seems pretty verbose โ€“ you're passing invalid parameters for that API

orchid egret
#

so we don't need payment behavior and payment settings ?

floral goblet
#

They're not supported no

orchid egret
#

so on which object i can get client_secret ?

floral goblet
#

Payment Intent

orchid egret
#

yes

#

it's getting null on subscription.latest_invoice.payment_intent

floral goblet
#

It's easier if you just share the sub_xxx ID with me

orchid egret
#

yes

#

sub_1PBDWQHDWzepBBxWjvHG8Evj

floral goblet
#

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

orchid egret
#

so how i can manage it on payment element i need to charge customer immediately

floral goblet
#

You can pass expand: ['payment_intent'] to that endpoint and you'll have your client_secret in the response

orchid egret
#

Okay

#

and what if after creating subscription schedule i get subscription and update that subscription and get payment behaviour update ?

floral goblet
#

I don't know what you're asking me

orchid egret
#

okay let me chekc above things i will let you know if this work for me or not.

prisma wagonBOT
orchid egret
#

it's showing like this when i try to finalise invoice of subscription schedule

sly zealot
#

it should be $subscriptionS->subcription->latest_invoice->id

orchid egret
#

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
}

sly zealot
#

what does your frontend code for creating the elements object and calling confirmPayment look like?

orchid egret
sly zealot
orchid egret
#

okay got it

#

thanks it's worked