#Yul

1 messages ยท Page 1 of 1 (latest)

warm viperBOT
tame niche
#

Hi there

open zephyr
#

Hi

tame niche
#

If a Sub has been moved to a status of canceled then it can't be un-canceled and a new one needs to be created

open zephyr
#

okay, ty for that

tame niche
#

In terms of renewing the Sub before it is moved to canceled, if the most recent Invoice is successfully paid then the Sub will move back to active

open zephyr
#

So... If the sub is not canceled then I should try to update it

#

Is that what you're saying?

tame niche
#

Well you don't really need to update it, you just pay the invoice

open zephyr
#

I'm talking about API...

tame niche
#

Unless you want to change the Price

#

But yeah, I wouldn't create a new one unless the Sub is canceled.

open zephyr
#

Does this code:
$session = $stripe->checkout->sessions->create([
'customer' => $cus_id,
'success_url' => 'https://example.com/',
'cancel_url' => 'https://example.com/',
'mode' => 'subscription',
'line_items' => [[
'price' => $priceId,
// For metered billing, do not pass quantity
'quantity' => 1,
]],
]);

handle the subscription upgrade?

tame niche
#

A Checkout Session will always create a new Subscription

open zephyr
#

okay..

tame niche
open zephyr
#

But this code updates the sub immedeitely?

tame niche
#

Yes

open zephyr
#

And he needs to pay before that

tame niche
#

What are you trying to update exactly?

#

Like if all you want is the Subscription to move to active then you don't need to update it at all

#

It will automatically move to active once the most recent Invoice is paid

open zephyr
#

I want to upgrade it for someone from silver to gold

#

user already has silver but he wants to upgrade to gold...

tame niche
#

Oh okay then yeah that would involve changing the Price

#

So yes that is the right endpoint

open zephyr
#

Immediate payment
Stripe immediately attempts payment for these subscription changes:

#

okay I see this..

tame niche
#

Yep

open zephyr
#

But how do I redirect him to payment?

#

As I understood correctly he will pay just extra, not the full price..

tame niche
#

Well that depends. Is the customer on your site when this update occurs?

open zephyr
#

yeah

tame niche
#

And do you already have a saved PaymentMethod?

#

Or you want to collect a new one?

open zephyr
#

yes

#

I think new

tame niche
#

Gotcha I got to step away but my colleague will hop on and can talk to you about how to do that

open zephyr
#

ok

open zephyr
#

but I have his cus_ID

indigo rivet
#

Hi there ๐Ÿ‘‹ taking over.

So if you're doing an upgrade/downgrade of a Subscription, you should already have a payment method on file for that Customer correct?

open zephyr
#

Nah, I'm not saving it. The only things I'm saving are: sub_ID and cus_ID

#

on my end

#

Things are in the development stage.. ๐Ÿ˜„

indigo rivet
#

Wait, so you're going to manually recollect payment details everytime the Subscription comes due? Or are you going to email them an Invoice?

open zephyr
#

customers pay with cc..

#

click buy -> go to the payment page -> enter CC -> redirect to merchant

#

I don't even know whats the policy on sub upgrades.. Is it full or only extra? Subs are going to pay yearly

indigo rivet
#

I have no idea what that question means. I would recommend building out the simpler parts of this integration first to familiarize yourself with how this stuff works before asking questions about advanced billing scenarios.

open zephyr
#

For example my sub is on silver subscription and pays 50 eur / month and he wants to upgrade it to gold which is 100 eur / month. How do I do that?

#

He payed with a CC and I would like him to pay extra immediately

indigo rivet
#

Have you built the regular subscription flow yet?

open zephyr
#

ye

indigo rivet
#

Can you send me an example of a test mode subscription ID that you created so I can see how it's being done so far?

open zephyr
#

Well I'm refering but I want him to pay the extra first, then update the subscription

#

sub_1MeLe1HbqfWKlyWy3apBlXCH

#

I dont actually know, maybe upgrade for free and pay more on next cycle is the default way..

indigo rivet
#

I mean, if you create prorations and choose invoice_immediately when you update the Subscription, you can create a charge for the proration. But I have no idea if that's what you're asking about

open zephyr
#

Is it possible to charge the customer immediately after sub upgrade and if he doesn't pay the no upgrade? Same as on new subscription?

indigo rivet
#

No. The upgrade will still happen, but the Invoice will have status: "requires_payment_method" so you would then do whatever action you normally would when a payment fails

open zephyr
#

So you're saying I should check on my end not only the expiry date, but also the payment method in order to check if the subscription is active?

indigo rivet
#

No that's not what I said at all. I'm saying you would handle the failed payment like you handle your other failed payments

open zephyr
#

The key here is that the payment will be charged automatically like on sub renew... This I was thinking wrong.

indigo rivet
#

You said you were not going to have a Payment Method on file to charge automatically. So now you are?

open zephyr
#

Isn't that what Stripe do?

indigo rivet
#

Yup

open zephyr
#

Are you saying that I need to charge subscribers manually from my end on each billing cycle?

indigo rivet
#

It is

#

No

open zephyr
#

Thank god. You got me scared there

indigo rivet
#

The answers to these questions are readily available in our docs, and your questions are consistently ambiguous. You should already know how Payment Methods are handled before you ask about advanced billing scenarios. Please read our docs before asking additional questions. We cannot walk you through every single step of the process.

open zephyr
#

yeah