lmsqueezy / laravel

A package to easily integrate your Laravel application with Lemon Squeezy.
https://lemonsqueezy.com
MIT License
521 stars 51 forks source link

How do i pass quantity to checkout page? #66

Open simpsoncarlos3 opened 11 months ago

simpsoncarlos3 commented 11 months ago

Hello there

thanks for making this package.

I'm struggling to pass quantity here. how do i do that?

$checkout = $request->user()->checkout($this->variant);

MaheKarim commented 11 months ago

Checkout this page https://docs.lemonsqueezy.com/api/checkouts#create-a-checkout

simpsoncarlos3 commented 11 months ago

according to docs i need to send this variant_quantities - A list containing quantity data objects

but the problem is how do i send it using this lmsqueezy/laravel package?

i tried this but didn't work $request->user()->checkout($this->variant, ['variant_quantities' => [ [ 'variant_id' => $this->variant, 'quantity' => $this->unit ] ]]);

driesvints commented 6 months ago

This isn't possible yet unfortunately. I'll have to see if I can squeeze it into https://github.com/lmsqueezy/laravel/pull/39.