GithubHelp home page GithubHelp logo

Comments (14)

msnegurski avatar msnegurski commented on May 4, 2024 1

Just to add a usecase: we have a non-linear per member pricing (so subscription quantity is not an option) and customers constantly add or remove members, so managing it all in the Dashboard would be a full-time job.

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024 1

This will be available in today's release. I'll try to add docs soon.

from cashier-paddle.

enkota avatar enkota commented on May 4, 2024

By no means great with PR's but I mocked up how this could be done by extending the subscription model.

From the API docs it seems we can't update existing modifiers, so I am wondering if the modifier_id returned should be stored on our DB so it can be deleted if the modifier was to change in the future. Only issue I see with that is you can have multiple modifiers per subscription.

May need to check if the keep_modifiers option can be set when swapping a plan too, as true by default.

    /**
    * Add a modifier to the Paddle subscription.
    *
    * @param int $plan
    * @param array $options
    * @return $this
    */
    public function modifier(array $options = [])
    {
       
         $payload = $this->billable->paddleOptions(array_merge([
         'subscription_id' => $this->paddle_id,
         'modifier_amount' => '10', //Would pass this via $options
         'recurring' => 1, //Probably make use of ->recurring()
         'modifier_description' => 'Added by Cashier'
         ], $options));
  
         $response = Cashier::post('/subscription/modifiers/create', $payload)['response'];

         $this->paddleInfo = null;

         //Ideas for modifier_id response. Maybe should be an array so we can reference to list/delete a modifier?
         $this->modifier_id = $response['modifier_id'];
         $this->save();

         return $response;
    }

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024

The reason we didn't include it in the package is because Paddle already has a full UI in their dashboard to manage these modifiers.

Can you please give some more explanation about your use case, why you'd want to use the API for these and how it would benefit you?

from cashier-paddle.

enkota avatar enkota commented on May 4, 2024

Hey @driesvints - The original idea was to make use of modifiers with volume based billing. Every level of usage would result in a price modifier being added so we didn't need to create loads of individual plans. I took the idea from their guide.

After a few discussions with Paddle, we decided modifiers would be too messy in the long run. I've setup new plans per (1000 contacts) on my app instead.

I can see some uses for it however if someone wanted to automate a modifier on an existing subscription, rather than their UI.

Happy to close this as ended up not using. For anyone that needs it, the code above should mostly work :)

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024

No worries. Closing then as there's no direct use case.

from cashier-paddle.

pawan1793 avatar pawan1793 commented on May 4, 2024

@driesvints I might have use case ...
Our subscription prices keeps on changing so can't keep adding new subscriptions in paddle instead of that if modifier is included in package we can simply change recurring prices

reference /2.0/subscription/modifiers/create

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024

@pawan1793 what prevents you from using the Paddle dashboard?

from cashier-paddle.

pawan1793 avatar pawan1793 commented on May 4, 2024

@driesvints in paddle dashboard there is just one plan of $1 ... I'll be modifying plan pricing on my application not on paddle, This way I'll not have to maintain many subscription products.

eg There are 3 plans
Basic - 5$
Gold - 10$
Pro - 15$

for all this plan i'll use subscription product i.e of $1 on paddle and set prices while creating subscription by Overriding Checkout Prices

now if user want to change Gold plan. having modifier will help to add amount on current subscription.

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024

If you can practically write down what you expect to be present in terms of a public API we could look into it maybe. Is it similar to what the OP wrote above?

from cashier-paddle.

pawan1793 avatar pawan1793 commented on May 4, 2024

yes

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024

I'll take a look at this eventually. But feel free to send in a PR in the meantime.

from cashier-paddle.

enkota avatar enkota commented on May 4, 2024

I'd like to point out when I looked at this, Paddle didn't allow you to update modifiers, so you'd need to store the ID of the one applied and remove if you were to change that amount.

from cashier-paddle.

driesvints avatar driesvints commented on May 4, 2024

Yeah we'll need to do that as well.

from cashier-paddle.

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.