#MarceloOlandim

1 messages · Page 1 of 1 (latest)

zinc sailBOT
harsh relic
#

Hi,
In fact there are multiple way to achieve this, using coupons, subscription schedule... I personally recommend using Subscription Schedule.
When creating a Subscription Schedule you are creating a schedule with 2 phases I assume, first 3 month with 1 pound and 9 months with normal price, right ?

#

Now I didn't understand correctly what is the exact issue with that? collecting the customer payment method ?

fierce fulcrum
#

The problem is that when u create a subscription using scheduler, its status is automatically active, without the user payment

#

The user would have to pay the invoice to change the status to active.

harsh relic
fierce fulcrum
#

There is no way to have the subscription scheduler to start inactive and then extract the payment secret from the subscription created ?

harsh relic
#

No.

fierce fulcrum
#

If I use the PaymentMethod, what price the user will see on the payment form?

harsh relic
#

I don't understand you. you mean using SetupIntent ? you show them what the total price of what they want to purchase.

zinc sailBOT
fierce fulcrum
#

At the moment I using stripeApi.subscriptions.create

I extract the payment secret from the subscription object created by this operation.

So the price to be charged would also be picked by this subscription object.

However with that your approach, the paymentIntent does have any price attached to it, so what to inform the user on the form?

chilly dragon
#

Hi! I'm taking over this thread.

fierce fulcrum
#

Thanks Soma

chilly dragon
#

Are you creating a Subscription or a Subscription Schedule?

fierce fulcrum
#

I tried both.

#

I just want to implement a subscription that is paid annually, but we want to offer the 3 first months for just 1 pound.

chilly dragon
#

For this you need to use a Subscription Schedule with 2 phases.

fierce fulcrum
#

I tried this:

const schedule = await stripeApi.subscriptionSchedules.create({
//from_subscription: createdSubscriptionId,
customer: stripeCustomerId,
start_date: 'now',
phases: [
{
items: [{ price: annualStripePriceId, quantity: 1 }],
end_date: getUnixTime(addMonths(new Date(), 3)),
coupon: 'BbdJi0Th',
},
{
items: [{ price: annualStripePriceId, quantity: 1 }],
end_date: getUnixTime(addMonths(new Date(), 9)),
},
],
});

chilly dragon
#

And what is the issue with this code?

fierce fulcrum
#

It says the next invoice will be in one year, but what about the second charge that should happen after 3 months?

chilly dragon
fierce fulcrum
#

Ahh.. thanks.

Quick question.. can I apply a scheduler with phases in a subscription that already exists ?

chilly dragon
fierce fulcrum
#

Just read this in the documentation:

optional
Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription’s item(s), set to auto-renew using the subscription’s interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls.
chilly dragon
#

Yes, so what's the question?

fierce fulcrum
#

So, I can't use phases to subscription that already exists ?

chilly dragon
#

Yes you can.

#

It's a two step process:

  • Create the subscription schedule with the existing subscription
  • Then edit the subscription schedule
#

That's why the text you shared above mention this:

To create a subscription schedule with other modifications, we recommend making two separate API calls.

fierce fulcrum
#

Ahh. perfect

#

Okay.. so.

If I am going to a strategy where I am going to use subscription already paid by a customer and apply different phases, the first phase in my business case (initial payment of 1 pound), that would already by paid , so this 'phase" should not be on the scheduler update right?

chilly dragon
#

That sounds correct to me. But I recommend doing some tests in test mode with Test Clocks to make sure everything is working as expected.