Upgrade
Upgrading from the Pre-release version 0.x
to the version 1.x
LTS.
High Impact Changes
Updating dependencies
PHP version
PHP 7.4 or higher is required along with extensions json
and openssl
.
Composer Dependencies
You need to use the latest version of the package.
composer require imdhemy/laravel-purchases
Service Providers
The Imdhemy\Purchases\ServiceProvider
was removed, and replaced by Imdhemy\Purchases\ServiceProviders\LiapServiceProvider
.
Configuration
The old configuration file purchase.php
is replaced with liap.php
. You need to publish the new configuration file.
php artisan liap:config:publish
Routes
The old routes for Google Play and App Store are replaced with new ones. You can use the following command to show them.
php artisan liap:url
Find more information about the new routing here.
Value Objects
The App store value object class ReceiptInfo
if replaced with LatesReceiptInfo
.
Public constants in Google Play removed
DeveloperNotification
all constants are removed.OneTimePurchaseNotification
theONE_TIME_PRODUCT_CANCELED
constant is removed.CURRENCY_CODESS
constant is removed from thePrice
value object class.
Medium Impact Changes
Return data types
- The acknowledge method in
GooglePlay
andAppStore
return type is changed fromvoid
toEmptyResponse
.
Removed classes
If your code uses any of the following classes, you need to use getter methods and public constants instead.
- The class
Imdhemy\GooglePlay\Subscriptions\Subscription
is replaced byImdhemy\GooglePlay\Subscriptions\SubscriptionClient
. - The class
AcknowledgmentState
is removed. - The class
CancelReason
is removed. - The class
CancelSurveyReason
is removed. - The class
ConsumptionState
is removed. - The class
PriceChangeState
is removed. - The class
PromotionType
is removed. - The class
PurchaseState
is removed. - The class
PurchaseType
is removed.