Giter VIP home page Giter VIP logo

cashier-register's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar djuki avatar rennokki avatar spekulatius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cashier-register's Issues

Replacing models is not very flexible, let's discuss improvements

I have a situation that all my models need to extend
Jenssegers\Mongodb\Eloquent\Model
because I am using MongoDB.

I set the configuration file to use my models:

    'models' => [

        'usage' => \App\Entities\App\Subscription\Usage::class,

    ],

The issue is my model can't extend RenokiCo\CashierRegister\Models, and for that reason, I can exceptions like this one when resetting quotas.

TypeError: Argument 1 passed to App\Entities\App\Subscription\Subscription::RenokiCo\CashierRegister\Concerns\{closure}() must be an instance of RenokiCo\CashierRegister\Models\Usage, instance of App\Entities\App\Subscription\Usage given, called in /var/www/saas-starter/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php on line 230

Reason Is the package has a type check and expect models to extend RenokiCo\CashierRegister\Models. As I explained in some cases we do not want to use Eloquent, so I want to propose a change that instead of type check for models, we add Contracts (interfaces), and type check interfaces, which would make it more flexible.

I would like to hear other opinions first, and I can propose PR when we make a plan.

cc @rennokki

paddle support

Thanks for the package, can you merge the paddle branch?

Error Installing on Laravel 8 \ Jetstream 2

When installing on a fresh Laravel 8 / JetStream 2 :

composer require renoki-co/jetstream-cashier-billing-portal

Using version ^1.2 for renoki-co/jetstream-cashier-billing-portal
./composer.json has been updated
Running composer update renoki-co/jetstream-cashier-billing-portal
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - renoki-co/jetstream-cashier-billing-portal[1.2.0, ..., 1.2.1] require renoki-co/cashier-register ^3.4.0 -> satisfiable by renoki-co/cashier-register[3.4.0, 3.4.1].
    - renoki-co/cashier-register[3.4.0, ..., 3.4.1] require doctrine/dbal ^2.9 -> found doctrine/dbal[v2.9.0, ..., 2.12.x-dev] but it conflicts with your root composer.json require (^3.0).
    - Root composer.json requires renoki-co/jetstream-cashier-billing-portal ^1.2 -> satisfiable by renoki-co/jetstream-cashier-billing-portal[1.2.0, 1.2.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Cashier uses stripe_product rather than stripe_plan

https://github.com/laravel/cashier-stripe/blob/17a514225a524f50466a6c270aab4566646bf1c4/database/migrations/2019_05_03_000003_create_subscription_items_table.php#L20

return $this->stripe_plan;

return $this->stripe_plan;

Could we get a PR to fix this, because currently, it's returning the free plan even if the user has another plan due to a mixup of table names?

Is there anyway to decrease feature usage?

Hi, just found out this awesome package but i was wondering if it can decrease the feature usage. For example I have a plan which limit user to create up to 5 photos. I can count them up as the docs say by use $subscription->recordFeatureUsage(1) everytime user create a new photo. But if they remove photo should we release the slot so they can use up again?

Question: syncFeatureUsage over monthly usage

Perhaps a silly question with an obvious answer:

When I am syncing metered feature use, that is resettable within each billing period, I should account for that in the closure, correct? Something along those lines:

Saas::syncFeatureUsage('minutes', function ($subscription, Feature $feature) {
    return $subscription->billable->minutes()->withinCurrentBillingPeriod()->count();
});

Is there a way to pass in the period boundaries to the scope?

Question: DBAL dependency

Laravel 8 throws an error when I try to require doctrine/dbal:^3.0
Not a problem to for me to require is as ^2.9, but I checked the migrations folder... why is there a dbal dependency anyway?

Update to new cashier

Hi, just came across this package, when i'm installing it apart from failing in dependencies cashier now has useSubscriptionModel witch makes BillableWithXXX redundant and they changed to polymorfic relations. Be nice to have it in a future update

Compatibility to laravel 8

Hi,

Great package as usual, any plan to support laravel 8, try to give it a shot and not work ?
Keep on the great work !!

Best,

[bug] `used_total` does not increment correctly once quota is reached

used & used_total get incremented correctly with

$subscription->recordFeatureUsage('feature', 100)

however, once qouta is reached 'used' stops incrementing (which might be expected since there is an overflow handler), but 'used_total' increments x2

steps to replicate,

cold run:

definition

  • feature: mails, 300

$subscription->recordFeatureUsage('mails', 100); // used = 100, used_total = 100
$subscription->recordFeatureUsage('mails', 100); // used = 200, used_total = 200
$subscription->recordFeatureUsage('mails', 100); // used = 300, used_total = 300
$subscription->recordFeatureUsage('mails', 100); // used = 300, used_total = 500

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.