Open davidsket opened 9 months ago
hi david, i want to use your two pull requests in my project. as it looks like it is going to take sometime to merge. how do i include this in my project?
i tried composer require your forked project. but didn't work any help?
i tried extending the class with added functionality. but, didn't work. any idea?
`<?php
namespace App\Utilities;
use LemonSqueezy\Laravel\Checkout;
class LmMore extends Checkout { private int $quantity = 5; private array $checkoutData = [];
public function __construct(private string $store, private string $variant)
{
parent::__construct($store, $variant);
}
public function withQuantity(int $quantity): self
{
$this->quantity = $quantity;
$this->checkoutData['variant_quantities'] = [
[
'variant_id' => (int) $this->variant,
'quantity' => (int) $this->quantity,
],
];
return $this;
}
}`
Copy Subscription.php to your project (into app/Overrides/ for instance), then add this to composer.json
"psr-4": {
...
"LemonSqueezy\\Laravel\\": "app/Overrides/"
},
"exclude-from-classmap": [
"vendor/lemonsqueezy/laravel/src/Subscription.php"
]
}
This looks quite helpful, my only suggestion would be to add the ability to pass through options to invoice immediately and to prorate. However, looking at the Lemon Squeezy API, it seems there's no actual way to do this?
Any plans to merge this pull request? Would love to see that feature and it is also on the roadmap.
I really want to get metered billing into the package but struggling to find the time atm. In any case I plan to work on this package this fall still so please bear with me.
In combination with #56, this will add functionality to manage subscription quantity.