From bddcdd561dbec5a7d60ce45ff8eca64260a23a47 Mon Sep 17 00:00:00 2001 From: Nikola Cirkovic Date: Fri, 10 Jun 2022 00:29:34 +0200 Subject: [PATCH 1/3] INA-9 | imdhemy/laravel-purchases package installed --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index dd97adf32f13..3e77c6608e99 100644 --- a/composer.json +++ b/composer.json @@ -51,6 +51,7 @@ "halaxa/json-machine": "^0.7.0", "hashids/hashids": "^4.0", "hedii/laravel-gelf-logger": "^6.0", + "imdhemy/laravel-purchases": "^0.10.3", "intervention/image": "^2.5", "invoiceninja/inspector": "dev-main", "laracasts/presenter": "^0.2.1", From 0de69b6b7438b278789d8f65c45f7cd82194c6d7 Mon Sep 17 00:00:00 2001 From: Nikola Cirkovic Date: Fri, 10 Jun 2022 00:29:47 +0200 Subject: [PATCH 2/3] INA-9 | updated .env.example with keys required for imdhemy/laravel-purchases --- .env.example | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 16c30973aae4..b41f9a522156 100644 --- a/.env.example +++ b/.env.example @@ -46,7 +46,7 @@ TRUSTED_PROXIES= NINJA_ENVIRONMENT=selfhost #options - snappdf / phantom / hosted_ninja -PDF_GENERATOR=hosted_ninja +PDF_GENERATOR=hosted_ninja PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address' PHANTOMJS_SECRET=secret @@ -57,4 +57,7 @@ DELETE_PDF_DAYS=60 DELETE_BACKUP_DAYS=60 COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' -SENTRY_LARAVEL_DSN=https://39389664f3f14969b4c43dadda00a40b@sentry2.invoicing.co/5 \ No newline at end of file +SENTRY_LARAVEL_DSN=https://39389664f3f14969b4c43dadda00a40b@sentry2.invoicing.co/5 + +GOOGLE_PLAY_PACKAGE_NAME= +APPSTORE_PASSWORD= From dd3e1d8c13ec2d56fad588b6401f318c7aa14249 Mon Sep 17 00:00:00 2001 From: Nikola Cirkovic Date: Fri, 10 Jun 2022 00:29:56 +0200 Subject: [PATCH 3/3] INA-9 | purchase.php config for imdhemy/laravel-purchases package --- config/purchase.php | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 config/purchase.php diff --git a/config/purchase.php b/config/purchase.php new file mode 100644 index 000000000000..38a6c52dd3fa --- /dev/null +++ b/config/purchase.php @@ -0,0 +1,72 @@ + [], + + 'google_play_package_name' => env('GOOGLE_PLAY_PACKAGE_NAME', 'com.example.name'), + + 'appstore_password' => env('APPSTORE_PASSWORD', ''), + + 'eventListeners' => [ + /** + * -------------------------------------------------------- + * Google Play Events + * -------------------------------------------------------- + */ + SubscriptionPurchased::class => [], + SubscriptionRenewed::class => [], + SubscriptionInGracePeriod::class => [], + SubscriptionExpired::class => [], + SubscriptionCanceled::class => [], + SubscriptionPaused::class => [], + SubscriptionRestarted::class => [], + SubscriptionDeferred::class => [], + SubscriptionRevoked::class => [], + SubscriptionOnHold::class => [], + SubscriptionRecovered::class => [], + SubscriptionPauseScheduleChanged::class => [], + SubscriptionPriceChangeConfirmed::class => [], + + /** + * -------------------------------------------------------- + * Appstore Events + * -------------------------------------------------------- + */ + Cancel::class => [], + DidChangeRenewalPref::class => [], + DidChangeRenewalStatus::class => [], + DidFailToRenew::class => [], + DidRecover::class => [], + DidRenew::class => [], + InitialBuy::class => [], + InteractiveRenewal::class => [], + PriceIncreaseConsent::class => [], + Refund::class => [], + Revoke::class => [], + ], +];