#mckeemi_unexpected
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/1230440105207136387
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- mckeemi_unexpected, 22 hours ago, 64 messages
- mckeemi_code, 6 days ago, 25 messages
hi! not sure I follow. If you're creating a Schedule and saying "the first phase starts in a month" for example, there is no Subscription object created right now so there's no ID, that's all expected.
I was thinking that, but what do I pass back to the front end so that I can load the elements and associate the card details entered with the future dated subscription?
well you can just directly create a SetupIntent for the Customer in question and then set invoice_setttings[default_payment_method] on the Customer after that SetupIntent completes
Thank you that's great, really appreciate your help, will give that a go ๐
On the invoice_settings .default_payment_method, it says to enter the id of a payment method .... is that the setup_intent .id?
No, that's setup_intent.payment_method
Thankyou
Happy to help.
var options = new CustomerCreateOptions
{
Email = order.Email,
Name = $"{order.ContactFirstname} {order.ContactSurname}",
Description = descriptionMessage,
InvoiceSettings = new CustomerInvoiceSettingsOptions() { DefaultPaymentMethod = setupIntent.PaymentMethod.Id}
};
but setupIntent.PaymentMehtod came back as null?
var setupIntentOptions = new SetupIntentCreateOptions
{
PaymentMethodTypes = new List<string> { "card" },
};
var setupIntentService = new SetupIntentService();
SetupIntent setupIntent = await setupIntentService.CreateAsync(setupIntentOptions, requestOptions);
Will the paymentMethod not be created until after the frontend enters their card details and confirms?
Correct.
Ok I will have to change our flow, we created the subscription first previously which had the setup intent client secret to pass back but we are changing things as we think the schedules have a better fit, with our scenarios, so we'll have to confirm on the front end and call an api after to update the customer with those details. Is that correct?