Giter Club home page Giter Club logo

Comments (6)

mscart avatar mscart commented on May 29, 2024 1

@yuhua-chen hi there.... try to pu hour instead of day at trial interval ... works for me

from laravel-subscriptions.

yuhua-chen avatar yuhua-chen commented on May 29, 2024 1

Wow! what a tricky way. I'll give a try. Thanks.

from laravel-subscriptions.

andriasmelianus avatar andriasmelianus commented on May 29, 2024

@yuhua-chen hi there.... try to pu hour instead of day at trial interval ... works for me

Hi, I think the Period class is still put the trial duration even when we set the trial_period to 0.
What do I do to overcome this problem is to create a new method in the App\User.php also called newSubscription with a little modification:

public function newSubscription($subscription, Plan $plan, $isTrial = TRUE)
{
	$trial = new Period($plan->trial_interval, $plan->trial_period, now());
        $period = new Period($plan->invoice_interval, $plan->invoice_period, $trial->getEndDate());

        return $this->subscriptions()->create([
            'name' => $subscription,
            'plan_id' => $plan->getKey(),
            'trial_ends_at' => $isTrial ? $trial->getEndDate() : now(),
            'starts_at' => $period->getStartDate(),
            'ends_at' => $period->getEndDate(),
        ]);
}

You can see the new parameter called $isTrial you can provide to determine that the subscription is using trial period or not.

from laravel-subscriptions.

Omranic avatar Omranic commented on May 29, 2024

Thank you all for your patience, this is now fixed in a83c765

Now it should add skip trial period if it's set to 0 as expected.

from laravel-subscriptions.

abublihi avatar abublihi commented on May 29, 2024

is there a way to skip the trial period event it was set?

from laravel-subscriptions.

Omranic avatar Omranic commented on May 29, 2024

I'm planning to support that in an upcoming rewrite of this package, no ETA however! PRs are welcome 🙂

from laravel-subscriptions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.