#mckeemi_unexpected

1 messages ยท Page 1 of 1 (latest)

feral roverBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

plucky horizonBOT
#

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.

gleaming loom
#

๐Ÿ‘‹ happy to help

sonic crystal
#

Thank you so much

gleaming loom
#

that's the expected behavior

#

if you want to receive the invoice.paid before the hour span, you need to manually finalize the invoice

sonic crystal
#

Thank you, so I have 2 phases in my subscription schedule ... an initial one (where the amount might be different), if I set it to manual in the setup would the remaining recurring payments in the other phase occur automatically?

#

I mean if I set the payment behaviour to manual in the first phase or can I do that?

#

I just not sure why the behaviour differs from CreateSubscription on the initial invoice

gleaming loom
#

you don't have to put anything to manual

#

you keep the subscription schedule as it was

#

and you just finalize the first invoice

#

which makes the payment happen automatically

#

without waiting 1 hour

sonic crystal
#

OK, so my flow would be:

#

Create the subscription Schedule & pass the clientsecret back to the UI

#

Display the card elements on screen (associated with the clientSecret)

#

Enter card details & confirm payment

gleaming loom
#

yes

sonic crystal
#

Do I finalize the invoice on receiving a webhook then

gleaming loom
#

actually if you confirm the invoice payment on the frontend the payment will happen automatically

#

you wouldn't wait for 1h

sonic crystal
#

What would I call for that to happen on the front end?

gleaming loom
#

confirmPayment

sonic crystal
#

Here is my front end when I receive the clientsecret: I retrieve the setupintet & check the status:

#

if (clientSecret.startsWith("seti")) {
stripeLib
.retrieveSetupIntent(clientSecret)
.then(({ setupIntent }) => {
status.value = setupIntent.status;

              switch (setupIntent.status) {
                case "succeeded":
                  confirmationMessage.value =
                    "Payment scheduled! We have saved your payment details & you will receive a confirmation email when each payment is taken. Please check your Junk Mail folder as it may be in there.";
                  loading.value = false;
                  break;

                case "processing":
                  confirmationMessage.value =
                    "Processing payment details. We'll update you when processing is complete.";
                  loading.value = false;
                  break;

                case "requires_payment_method":
                  status.value = "failed";
                  confirmationMessage.value =
                    "Failed to process payment details. Please try another payment method.";
                  loading.value = false;
                  break;

                case "requires_confirmation":
                  status.value = "processing";
                  this.stripeLib
                    .confirmSetupIntent(clientSecret)
                    .then(() => {
                      location.reload();
                    });
                  loading.value = false;
                  break;
gleaming loom
#

you're creating a SetupIntent before creating the subscription?

sonic crystal
#

So on doing this id the status is succeeded then I just call the confirmPaymnet?

#

Yes we were using setup_intents before

gleaming loom
#

you shouldn't

#

instead you need to integrate by creating the subscription and confirmPayment of the first invoice

#

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

Create and manage subscriptions to accept recurring payments.

#

but in both cases, once you confirm the Invoice on the frontend the invoice gets automatically paid

sonic crystal
#

Previously we created the subscription then collected the payment & if we had a trual used the pending_setup_intent to initialise elements

gleaming loom
#

that's the way to go

sonic crystal
#

OK but subscription schedules seem to fit our scenarios better... do they behave in the same way

#

I'm not sure what I'm doing wrong?

gleaming loom
#

actually you can start by creating a subscription

sonic crystal
#

OK

gleaming loom
#

and then once the first invoice is created

#

you can create a schedule from the subscription

sonic crystal
#

Is that the best way to do it?

gleaming loom
#

I think so, yes, that's the easiest way

sonic crystal
sonic crystal
#

Can I ask one last question around schedules?

gleaming loom
#

yes of course

sonic crystal
#

If you want the phase to be ongoing (i.e. never ending until it's manually cancelled), is there a way to do that? or do all phases have to have either an enddate or iterations set?

#

what I could do is create the subscription with out the schedule if it's ongoing?

gleaming loom
#

and set the iteration to 1 for the last phase

sonic crystal
#

yeah but I don't want the payments to stop coming out

gleaming loom
gleaming loom
sonic crystal
#

ah I see, so it's like detaching the schedule?

gleaming loom
#

yes exactly

#

but the subscription will still be ongoing

sonic crystal
#

Thank you, you have been so helpful, I think I have it ...I'll go back to the way we were creating the subscription & then update the subscription to have a schedule if we need to define the number of iterations/end date. Thanks a million for all your help

feral roverBOT