How to upgrade plan in Stripe for a customer already having a plan, but suddenly wanting to upgrade to a new plan?
Stripe::setApiKey(Yii::app()->params['secret_key']);
$cus = Stripe_Customer::retrieve("cus_7SR4oHy8NwS1DE");
$subscription = $cus->subscriptions->retrieve("sub_7SR4kA30QUQTE9");
$subscription->plan = sliver;
$subscription->save();
With the code above,
when a customer already has a silver plan subscription it's working fine, but when I change to the gold plan it shows the error below.
Can't combine currencies on a single customer. This customer has had a subscription, coupon, or invoice item with currency usd
When users upgrade plan, can I update subscriptions_current_period_end and subscriptions_current_period_start?
Unfortunately, once a subscription or an invoice is created for a customer, they are "locked" into that currency. It isn't possible to create a new subscription or update an existing subscription to switch to a plan in a different currency for that customer.
The only easy solution here would be to ask your customer for his card details again and create a new customer object so that you can subscribe them to a plan in a different currency.
There are other options involving Connect platform, but they may require additional elaborate effort.
Related
Is there any way to show active subscription plan on stripe's embeddable table, like passing customer, subscription or price id?
https://stripe.com/docs/payments/checkout/pricing-table
How on client side, where stripe pricing table is used, can be prevented for user/customer to select another (or same) plan and do any sort of action except updating current plan with upgrade or downgrade?
The pricing table product is built for first time purchases and it allows you to easily drop an iframe on your webpage that shows the different price options that you offer to your new customers. Once you have a Customer that has already made a purchase, the pricing table product is not what should be used.
Instead, separately, you can let your existing customers manage their subscriptions with the Customer Portal here which has a full Stripe redirect page. You can pass the list of Price ids when creating the portal configuration so your customers are able to upgrade or downgrade to different prices.
Earlier, We have separate subscription for every products. And we came to know that we can create single subscription with multiple product by creating subscription with subscription items. Now we need to combine old subscription with new subscription's item. Is there any way to achieve this?
You can always update existing subscriptions with new items. You don't have to worry about old items on that subscription since this API will create new items and add them to that subscription.
On the other hand, if you pass the id of an existing item, you will be able to update its price as described in this Stripe guide.
With this in mind, I would recommend you updating one of the subscriptions to add new items with Prices from the other subscription. Note that there are many options in Stripe for how or if to prorate and charge for the changes to the two subscriptions, so be sure to experiment in test mode to find what matches your needs.
If an Express Connect Account holder creates a Product with a Recurring Price of say $10/month. And a customer signs up for this, a Subscription is created and Stripe will automatically bill the customer $10/month until they cancel. So here is my question...if the Connect Account holder wants to increase their Price from $10/month to say $12/month...can they do this such that the price increase will be billed to existing customers as well as new customers? I am thinking of an example where the Connected Account has say 100 existing subscribers, so manually changing each one, doesn't really work. Looking for something automated. From what I have read, it seems, that only new customers will see the new $12/month Price, and existing customers will see the original $10/month price until they cancel. Is this correct? Seems odd that Stripe would have no way of allowing Connect Account holders a way to increase their recurring Prices for existing users. I get they can create a new price..and hope users voluntarily switch to the new high price, but that seems odd.
You would want to think Subscription as per-customer object. Let's say you have 100 existing Customers already subscribed to a $10 monthly plan, there are 100 existing Subscriptions object, tights to each of those Customers.
Now if the Connected Account created a new price of $12/month, all new Customers will subscribe to this new price, and create separated new Subscription objects.
If you want to upgrade the currently existing Subscriptions, you would need to update each of them, changing the old price to the new price, by Stripe's Subscription Update API. Make sure to read the note about Proration, or refer to Proration Doc
suppose i have a membership service which cost $10/month in a subscription way
but some users can not have a reusable source to make a subscription via plan api ,alternatively i will let him to do an one-time payment via order api.(at least accept one month's money)
it is the same product,same amount,difference is one is for plan,another is for order,so question is, should i create two products one is goods type(for order),one is service(for plan/subscription). or one service type product is enough?
As a concept in the Stripe Dashboard, product SKUs are only used for recurring plans or invoicing. Any one time purchase can just be a charge, and does not need to be associated with any "Product" within your Stripe configuration.
If the product in this case is literally just one month of the plan, then you should probably use the same Product you have specified.
If the payment method will only work once, you could do nothing, and when the first period is up, and Stripe tries to renew, the payment will fail and the subscription will be canceled.
Or, if you're positive beforehand that it should only be charged once, you could cancel the subscription right after the first payment is completed. The customer would still have an active subscription for the period they paid for, but Stripe would not try to charge them automatically when that first period expired.
I basically want to know whether Stripe is automaticall refunding customers a prorated amount.
My process for updating a customer to a new plan:
Delete the old plan.
Create the new plan.
Create the new subscription.
Update user to new subscription.
If you create a new subscription then cancel the old one, the customer will be billed for the new subscription but will not gain any credit or refund for the unused time on the old subscription.
If you update the existing subscription to switch from the old plan to the new one, then by default Stripe will compute the proration (you can disable this by setting prorate to false in the subscription update request).
If the proration ends in favor of the customer, they will be granted credit in the form of a negative account balance. Customers' account balances are applied to future invoices before trying to actually charge the customer. Stripe will not partially or totally refund any past charges.
You can read more about subscription updates and proration in this paragraph of the subscription integration guide.