Stripe Embeddable pricing table - show active subscription plan - stripe-payments

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.

Related

Stripe Customer Portal - show specific subscription

I have one Stripe Customer, that attached to many companies into my project. Every company has its own subscription. So one Customer has many Subscriptions.
But during manage subscriptions on Customer Portal page I want to see just one subscription related to company (for now I see all Subscriptions related to the Customer).
Is there way (param) to show just one subscription related to specific Company (maybe by its ID) on Customer Portal page?
It's not possible right now to restrict the subscriptions managed in a Customer Portal session. You pass the customer parameter on creation and all subscriptions associated to that Customer object are manageable.

Is it possible to alter a recurring price that an existing customer is charged with Stripe API?

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

Programatic shipping and taxes with Stripe Subscription

I would like to use Stripe for a physical subscription site.
Small number of SKUs
Some customers pick up instead of ship
Customers whose addresses are in one state are charged state and local sales tax
I'd like to use Stripe Subscriptions to do this but shipping costs and state/local taxes will be slightly different for every single customer and but unlike in the Stripe Orders API, it does not look like Subscriptions allows for me to dynamically calculate shipping and taxes. Is my reading of this correct, or is there a way for me to programatically edit recurring shipping and taxes on a per-subscription basis?
Thank you!
Answer via #mattwc in #stripe freenode: An invoice is created by the subscription each period 1 hour before it is charged. You can subscribe to this event via webhook and edit the invoice to add shipping and tax information.

can i create a sku object into a service type product?

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.

How to upgrade plan in stripe?

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.

Resources