#varovas
1 messages ยท Page 1 of 1 (latest)
You could check laravel spark they have a billing per seat function
They are using prorations for upgrade/downgrade as I know
So if the customer downgrades, he will get credit for next invoice, we do not want that ๐
Hi
When doing a downgrade, you can disable proration, if that's the only issue for you:
https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
If you use cashier then ->noProrate() would be the function
Yes, but then if user on the same billing cycle will upgrade, he will pay again. Example, has 2 users. Downgrades to 1. No proration. Then upgrades again to 2 users, pays extra for 1 user, despite he already paid for 2 in this billing cycle
They will pay the difference between the two prices but not the same price twice
I think you should create a simulation and test the scenario
https://stripe.com/docs/billing/testing/test-clocks
We tested this solution. 1. Customer creates subscription with 2 users and pays 10 Euros for each. Then on the same day downgrade to 1 user. On the downgrade we set noProrate(). And then the same day user upgraded again to 2 users with proration_behavior=always_invoice and was charged 10 euro, despite that he already paid for 2 users.
This is what test clock gives in this scenario
Can you share the SubscriptionId ?
sub_1MlAqLH8sY2z9xZsflMcTO3g
Thanks for sharing let me check
Thanks for your patience, unfortunately I don't think we have a way to configure proration to work the way that you want here. Credit would usually be the thing that prevents the user from re-paying for seats. So I think the way to achieve this would be custom logic on your side
The two immediate ways I can think to do that would be:
- Store the max qty of seats that the user has paid for and switch the quantity to that without proration before upgrading to a higher quantity than that.
- If the users will only have one subscription, you can give out credit and just reset it every month. This would probably make invoices more confusing but it feels like it may still be worth mentioning.
Another idea came up to my mind that if there is a way to switch subscription prices just before next billing cycle? In this way we could have max users on our side. And then just before billing we could update subscription. I mean update subscription immediately in stripe only when customer upgrades, and downgrade only before billing cycle if needed
Yes that would work way better. You can use our subscription schedules API: https://stripe.com/docs/billing/subscriptions/subscription-schedules
You can add a schedule to your existing subscription and then add a phase that will change the quantity at the end of the cycle https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#existing-subscription
Ok, I will take a look on that. And the another issue (if that's the issue), we are storing payment methods identically as shown in laravel cashier docs. But when we use test card that has 3d secure, every time user update subscription, he has to authenticate with 3d secure. Is this a normal behaviour, or we are doing something wrong.
That would definitely be the correct behavior for that bottom card
For the top one this is likely expected because you are presumably not designating this as an off-session change.
Like basically after you set it up, it won't ask for 3DS again as long as you pass the flag to designate that the user isn't arround
Do I have on upgrade and subscription create set off_session=true?
$subscription = $user->newSubscription($plan['plan_slug'], $stripePrices) ->create($attributes['payment_method'], [ 'off_session' => true ]);
We set it to true, but user still has to authenticate (top card)
Interesting. That should be what is needed to have that card not ask for 3DS auth again. Can you send the request ID of a time you made this change and got 3DS? (req_123)
Wait a minute, I will make a fresh subscription
This is request to attach payment method: req_hwX0uFaFiAFG5L
This is subscription create: req_j9Zyzx3fk61A7l
This is confirmation: req_Mgo0fTkKlf1LP0
Thank you, checking in to those requests
Hey apologies it took me a bit. It looks like that confirm call didn't include off_session: true https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-off_session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It is a per-request setting. So it needs to be set each time you make a request on the subscription (if it will result in a payment) or on the payment intent itself
This is a little bit confusing. which request should include off_session ?
The confirm call https://dashboard.stripe.com/test/logs/req_Mgo0fTkKlf1LP0
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This request is after the customer tried to create subscription. This happens when subscription throws IncompletePayment exception. If I understand correctly, when user saves payment method. And then tries to use it, he shouldnt be asked for authentication?
In test mode, with that specific test card, the rule is that it can be used without invoking 3DS again but only if the API calls related to the payment are designated as off session.
Unfortunately it looks like we don't have a 3DS test card that allows on session payments without 3DS
I think we do not include off_session attribute to card confirmation and that is the problem. I will check this. Ok, thank you for your time. I will take a look to subscription schedules and see if I can achieve what I want ๐
Yes, once you include that the 3DS should go away in test mode. In live mode obviously just pass the one that is correct for whether your user is actually on session or not. Glad that could help, good luck implementing the schedules solution!
I checked 3DS and it seems that setup inter conform has the usage: off_session for a card
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So actually that confirm call was made with your public key and off_session: true was not sent to us (I don't think you can send it with public key confirmation) https://dashboard.stripe.com/test/logs/req_CtzBbQ4QD1M3ee
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Not sure how clear this is already, but on session payments refer to when the customer is present and doing something on your webpage/app. So them filling out their card details in your form would be a classic on session setup. Off session is for when some automatic charge happens when the customer is not around. So like the subscription cycling or changing automatically
Hmm. Basically what I am doing. Customer comes to his account on our web app. Then he adds payment method to his account. Enters card number, cvc, post code, expire date. Then confirms that card with 3DS and that card then is stored to stripe as customer payment method. Then, customer goes to next page and can select Plans: free, minimum, medium, maximum. After that he select how much users does he want with that plan and then subscribes. And I thought if customer previously confirmed 3DS when saved payment method, he will not be asked to authenticate 3DS when creating a subscription
In live mode that is ultimately up to the bank. They often choose not to request 3DS again if it has just been performed but there is always the chance that they might
That is actually why we recommend avoiding using a setup intent if you intend to charge the card immediately. So if they are making a payment on the subscription immediately, it might be better to just wait until the subscription is created and use the payment intent on the first invoice of the subscription. Otherwise there will always be a chance that 3DS is requested twice
I understand that. But I remembered another scenario. For example, user create or upgrade subscription, he is requested to confirm 3DS. And the if user accidentally denies confirmation, or changed his mind for example and wants to stick with his current subscription, he cannot revert back. Because subscription in stripe was changed before he has to to confirm 3DS. How to handle that?
Hello ๐
Stepping in as Pompey needs to step away soon, looks like you'd benefit from Pending Updates here
https://stripe.com/docs/billing/subscriptions/pending-updates
If the payment fails then we don't apply the update to the subscription
I read that, but I think pending updates is not very well implemented in laravel cashier package. Because this is how laravle cashier handle pending updates:
if ($payload['payment_behavior'] !== StripeSubscription::PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE) { $payload['cancel_at_period_end'] = false; }
But cancel_at_period_end is not allowed
Ah hmm, our team unfortunately doesnt' know about laravel cashier package. We mostly work with native APIs related questions ๐ฆ
To be clear, Pending updates is exactly how you'd handle this. I'd recommend talking to our support team to see if they can provide any alternatives here (they should be able to take a look and raise it internally to the right team)
https://support.stripe.com/?contact=true