From 87daf01c95085a5a8a66aceb0c3c6a0881cb6804 Mon Sep 17 00:00:00 2001 From: Tareq Hasan Date: Tue, 17 Jan 2023 15:02:23 +0600 Subject: [PATCH 1/7] update composer name and dependency versions --- composer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index d59fd54..9714185 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "22digital/laravel-cashier-fastspring", + "name": "wedevsofficial/laravel-cashier-fastspring", "description": "Cashier Fastspring is a cashier-like laravel package which provides an interface to Fastspring subscription and payment services.", "keywords": ["laravel", "fastspring", "billing", "cashier"], "license": "MIT", @@ -18,20 +18,20 @@ } ], "require": { - "php": ">=7.1.3", - "illuminate/database": "~5.6", - "illuminate/support": "~5.6", + "php": "^8.0", + "illuminate/database": "^9.21|^10.0", + "illuminate/support": "^9.21|^10.0", "nesbot/carbon": "^2.0", - "symfony/http-kernel": "~2.7|~3.0|~4.0", + "symfony/http-kernel": "^6.0", "guzzlehttp/guzzle": "^6.0" }, "require-dev": { - "illuminate/http": "~5.6", - "illuminate/routing": "~5.6", + "illuminate/http": "^9.21|^10.0", + "illuminate/routing": "^9.21|^10.0", "mockery/mockery": "~1.0", - "phpunit/phpunit": "~7.0", + "phpunit/phpunit": "^9.0" "vlucas/phpdotenv": "^3.3", - "orchestra/testbench": "~3.6" + "orchestra/testbench": "^7.0|^8.0", }, "autoload": { "psr-4": { From 9c7e210a4ebb757c3882fd0fb76ab4ddff62941e Mon Sep 17 00:00:00 2001 From: Tareq Hasan Date: Tue, 17 Jan 2023 15:03:11 +0600 Subject: [PATCH 2/7] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9714185..7a210f7 100644 --- a/composer.json +++ b/composer.json @@ -29,9 +29,9 @@ "illuminate/http": "^9.21|^10.0", "illuminate/routing": "^9.21|^10.0", "mockery/mockery": "~1.0", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.0", "vlucas/phpdotenv": "^3.3", - "orchestra/testbench": "^7.0|^8.0", + "orchestra/testbench": "^7.0|^8.0" }, "autoload": { "psr-4": { From 51fca95125bf057e8b41e251d6dbf2fdbd198f1c Mon Sep 17 00:00:00 2001 From: Tareq Hasan Date: Tue, 17 Jan 2023 15:10:28 +0600 Subject: [PATCH 3/7] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7a210f7..3596a06 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "wedevsofficial/laravel-cashier-fastspring", + "name": "22digital/laravel-cashier-fastspring", "description": "Cashier Fastspring is a cashier-like laravel package which provides an interface to Fastspring subscription and payment services.", "keywords": ["laravel", "fastspring", "billing", "cashier"], "license": "MIT", From 561d016a237fef02476f09655acaccc1013cf842 Mon Sep 17 00:00:00 2001 From: Tareq Hasan Date: Tue, 17 Jan 2023 15:11:53 +0600 Subject: [PATCH 4/7] update guzzle --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3596a06..cdebc0c 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "illuminate/support": "^9.21|^10.0", "nesbot/carbon": "^2.0", "symfony/http-kernel": "^6.0", - "guzzlehttp/guzzle": "^6.0" + "guzzlehttp/guzzle": "^7.2" }, "require-dev": { "illuminate/http": "^9.21|^10.0", From 8210a54b00fc67b8564a5acab05069a050370a35 Mon Sep 17 00:00:00 2001 From: Tareq Hasan Date: Wed, 18 Jan 2023 22:11:26 +0300 Subject: [PATCH 5/7] Added support for SubscriptionUncanceled event --- src/Events/SubscriptionUncanceled.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/Events/SubscriptionUncanceled.php diff --git a/src/Events/SubscriptionUncanceled.php b/src/Events/SubscriptionUncanceled.php new file mode 100644 index 0000000..246a232 --- /dev/null +++ b/src/Events/SubscriptionUncanceled.php @@ -0,0 +1,7 @@ + Date: Thu, 19 Jan 2023 01:16:25 +0600 Subject: [PATCH 6/7] Update readme instructions --- readme.md | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/readme.md b/readme.md index 888266d..440c912 100644 --- a/readme.md +++ b/readme.md @@ -91,7 +91,7 @@ After publishing them, you can find migration files in your `database/migrations Next, add the Billable trait to your model definition. This trait provides various methods to allow you to perform common billing tasks, such as creating and checking subscriptions, getting orders etc. ```php -use Laravel\Cashier\Billable; +use TwentyTwoDigital\CashierFastspring\Billable; class User extends Authenticatable { @@ -108,7 +108,6 @@ You should add Fastspring configuration to `config/services.php` file. 'model' => App\User::class, 'username' => env('FASTSPRING_USERNAME'), 'password' => env('FASTSPRING_PASSWORD'), - 'store_id' => env('FASTSPRING_STORE_ID'), // strongly recommend to set hmac secret in webhook configuration // to prevent webhook spoofing @@ -121,10 +120,9 @@ You should add Fastspring configuration to `config/services.php` file. Fastspring can notify your application of a variety of events via webhooks. To handle webhooks, define a route and also set it in Fastspring settings. ```php -Route::post( - 'fastspring/webhook', - '\TwentyTwoDigital\CashierFastspring\Http\Controllers\WebhookController@handleWebhook' -)->name('fastspringWebhook'); +use TwentyTwoDigital\CashierFastspring\Http\Controllers\WebhookController; + +Route::post('/webhook/fastspring', [WebhookController::class, 'handleWebhook'])->name('webhook.fastspring'); ``` #### Webhooks & CSRF Protection @@ -150,26 +148,37 @@ Remember that you can create and use your listeners and database structure accor In Cashier Fastspring, every webhook request fires related events. You can register listeners to webhook events in `app/providers/EventServiceProvider.php`. You can see more at [Webhooks](#webhooks). ```php +use TwentyTwoDigital\CashierFastspring\Events\OrderCompleted; +use TwentyTwoDigital\CashierFastspring\Events\SubscriptionActivated; +use TwentyTwoDigital\CashierFastspring\Events\SubscriptionCanceled; +use TwentyTwoDigital\CashierFastspring\Events\SubscriptionChargeCompleted; +use TwentyTwoDigital\CashierFastspring\Events\SubscriptionDeactivated; +use TwentyTwoDigital\CashierFastspring\Events\SubscriptionPaymentOverdue; +use TwentyTwoDigital\CashierFastspring\Listeners\OrderCompleted as OrderCompletedListener; +use TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionChargeCompleted as SubscriptionChargeCompletedListener; +use TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionDeactivated as SubscriptionDeactivatedListener; +use TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionStateChanged; + protected $listen = [ // some others - 'TwentyTwoDigital\CashierFastspring\Events\SubscriptionCanceled' => [ - 'TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionStateChanged' + SubscriptionCanceled::class => [ + SubscriptionStateChanged::class, ], - 'TwentyTwoDigital\CashierFastspring\Events\SubscriptionDeactivated' => [ - 'TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionDeactivated' + SubscriptionDeactivated::class => [ + SubscriptionDeactivatedListener::class, ], - 'TwentyTwoDigital\CashierFastspring\Events\SubscriptionPaymentOverdue' => [ - 'TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionStateChanged' + SubscriptionPaymentOverdue::class => [ + SubscriptionStateChanged::class, ], - 'TwentyTwoDigital\CashierFastspring\Events\OrderCompleted' => [ - 'TwentyTwoDigital\CashierFastspring\Listeners\OrderCompleted' + OrderCompleted::class => [ + OrderCompletedListener::class, ], - 'TwentyTwoDigital\CashierFastspring\Events\SubscriptionActivated' => [ - 'TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionActivated' + SubscriptionActivated::class => [ + SubscriptionActivatedListener::class, + ], + SubscriptionChargeCompleted::class => [ + SubscriptionChargeCompletedListener::class, ], - 'TwentyTwoDigital\CashierFastspring\Events\SubscriptionChargeCompleted' => [ - 'TwentyTwoDigital\CashierFastspring\Listeners\SubscriptionChargeCompleted' - ] ]; ``` From 6ce49273b41cbbdb0cfe02b35b2b8f4b2e470ceb Mon Sep 17 00:00:00 2001 From: Mohammad Emran Date: Mon, 29 Jul 2024 14:30:41 +0600 Subject: [PATCH 7/7] Laravel 11 Compatibility (#1) --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index cdebc0c..92a363d 100644 --- a/composer.json +++ b/composer.json @@ -19,15 +19,15 @@ ], "require": { "php": "^8.0", - "illuminate/database": "^9.21|^10.0", - "illuminate/support": "^9.21|^10.0", - "nesbot/carbon": "^2.0", - "symfony/http-kernel": "^6.0", + "illuminate/database": "^9.21|^10.0|^11.0", + "illuminate/support": "^9.21|^10.0|^11.0", + "nesbot/carbon": "^2.0|^3.0", + "symfony/http-kernel": "^6.0|^7.0", "guzzlehttp/guzzle": "^7.2" }, "require-dev": { - "illuminate/http": "^9.21|^10.0", - "illuminate/routing": "^9.21|^10.0", + "illuminate/http": "^9.21|^10.0|^11.0", + "illuminate/routing": "^9.21|^10.0|^11.0", "mockery/mockery": "~1.0", "phpunit/phpunit": "^9.0", "vlucas/phpdotenv": "^3.3",