Laravel Cashier Stripe Trial creates new subscriptions, allows exploit - laravel

I am using Laravel Cashier to add stripe payments (subscriptions) for the premium version of my web app. Users are offered a 5-day free trial (card in advance).
Now what happens is, I create a subscription using:
$user->newSubscription('premium','monthly')->trialDays(5)->create($stripeToken,['email' => $user->email], "")
Works really well, but let's say the user cancels his subscription within the trial period.. He will be on the 'grace' period, let's say for 4 more days..
When these days are passed, user will lose account benefits, as the trial will expire and subscription is cancelled.
But, after that, if the user wants to subscribe again, since $subscription->resume() is only available during the grace period, I would have to create a subscription using $user->newSubscription, generating a new subscription on the table and a new trial period.. allowing them to cancel again, wait 5 days, create another one and repeat this getting free trial days forever..
Is there a way to "resume" an existing subscription when it is cancelled and grace period is over?

Related

Handle downgrade strategy with stripe

i'm building an app with multiple subscriptions plan for my users.
Let's say my user as a 'free' plan, and want to upgrade to a 'pro' plan.I'm using stripe customer billing portal, which work perfectly.
But when i want to downgrade, i would like the plan to change only a the subscription period end, unfortunately, it's change immediatly.
I know i can handle it from API, but i need to do it from the customer portal generated by stripe.
Any idea how to configure my stripe customer portal to handle downgrade this way ?
i would like the plan to change only a the subscription period end, unfortunately, it's change immediately.
This is not completely supported with Subscriptions and the Customer Portal. Any change you make to the Subscription's SubscriptionItems is immediate, e.g. changing from price_123 to price_678 happens the moment you update the Subscription.
However, using the proration_behavior: 'none' parameter on a CustomerPortal Configuration, you can configure it to not create prorations or invoice the Customer immediately but instead, defer the new payment amount on to the next Invoice.

while charging one time on stripe laravel facing error

i am using cashier 10 and stripe 7 and i am creating monthly, yearly and life time subscription.
Montlhy and Yealry subscription is working fine but life time charge generate error
The provided PaymentMethod is already attached to another object. You cannot reuse PaymentMethods without attaching them to a Customer object first.
in controller
$user->charge((int)$request->plan_price*100, $request->paymentMethod);

Braintree - proration upon subscription cancellation

I have a yearly recurring subscription set up on Braintree. I am trying to cater for a scenario where the user is able to have their subscription cancelled by an admin part way into the yearly cycle.
I am aware of the discounts feature but am unsure how I would apply it in this case or even whether its possible.
Is there a way in Braintree to prorate the amount for the rest of the cycle and credit it back to the user? I would not be doing any of this directly in Braintree but rather through the API via my application that uses Braintree for payments.
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support#braintreepayments.com.
You can cancel an annual subscription mid-cycle by using the API call to cancel a subscription. Here's a Ruby example, but the Braintree developer docs show examples in all supported SDKs.
result = Braintree::Subscription.cancel("the_subscription_id")
A proration would only apply if a change is made to the subscription price in the middle of a billing cycle. In the event of a cancellation, Braintree won't automatically issue a partial refund; you would have to process the refund yourself. Here is the API call for a partial refund:
result = Braintree::Transaction.refund("transaction_id", "amount")
Also, keep in mind that a cancelled annual subscription will not renew the next year. The only way to "reactivate" the subscription is to create a new one.

How to change iOS in app purchase when changing to lifetime membership instead of subscription?

Our app allows users to either have a 1 month subscription, or a lifetime subscription. 1 Month is an auto-renew subscription, where lifetime is obviously a one time purchase.
Our issue arises when a user has a 1 month subscription, and wants to change to a lifetime subscription, we aren't sure how to cancel the user's monthly subscription for them, or if that is even possible.

Recurring Payments - Trial without card

We're developing a system whereby the user will be sign-up and have a 3 month trial without entering card details. Once the trial period is up they get sent an e-mail asking them to come back and register card details in order to setup a recurring payment in order to continue accessing the site.
Is it possible to configure recurring payments with Braintree such that we don't provide a card for the trial period and then configure one upon notification that it has expired?
Thanks!
I work at Braintree. If you want more information than you can easily get on Stack Overflow, please reach out to our support team.
Braintree subscriptions require a credit card to be created. That way, the transition from trial period to billing doesn't require any action by the customer or merchant. Since our core service is billing credit cards, that's what subscriptions are designed to do.
In your case, it sounds like you can create a subscription in your application, and only link it to a Braintree subscription if / when credit card details are entered. You'll need to handle tracking the three month time limit yourself.

Resources