Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
336 stars 99 forks source link

Allow multiple one-time charges from the same app #216

Closed Manojraj closed 4 months ago

Manojraj commented 9 months ago

I'm working on an app that offers a basic free version and multiple add-ons that users can purchase with a one-time fee. I've set up separate plans for each add-on on the plans table. To allow users to purchase these add-ons, I've created links like the following in my app:

<a href="{{ route('billing', ['plan' => 1, 'shop' => Auth::user()->name, 'host' =>  app('request')->input('host') ]) }}">Buy Add-on 1</a>
<a href="{{ route('billing', ['plan' => 2, 'shop' => Auth::user()->name, 'host' =>  app('request')->input('host') ]) }}">Buy Add-on 2</a>

However, I've noticed that when a user purchases Add-on 2 after already purchasing Add-on 1, the status of Add-on 1 in the charges table changes to 'Cancelled.' How can I prevent this from happening?

stevesweets commented 9 months ago

Usage charges is probably what you're looking for, and not plans.

https://github.com/Kyon147/laravel-shopify/wiki/Creating-a-Billable-App#creating-usage-charges

Kyon147 commented 4 months ago

Closing as inactive and potential solution given.