We recommend using Composer for installation and update management. To add CRM Apple AppStore extension to your REMP CRM application use following command:
composer require remp/crm-apple-appstore-module
Enable installed extension in your app/config/config.neon
file:
extensions:
# ...
- Crm\AppleAppstoreModule\DI\AppleAppstoreModuleExtension
Add database tables and seed Apple AppStore payment gateway and its configuration:
php bin/command.php phinx:migrate
php bin/command.php application:seed
Module uses default implementation of ServerToServerNotificationProcessorInterface
to match notification with system's user and subscription type.
- If subscription type cannot be matched, processor returns an error and doesn't acknowledge the notification.
- If user cannot be matched, processor creates anonymous unclaimed user (user with
user_meta
flagUnclaimedUser::META_KEY
set to true). This is needed to fulfill Apple's rules - user registration cannot be prerequisite of iOS in-app purchases.
If you want to control this process and match the user/subscription type based on your own criteria, or if you want to acknowledge the notification but skip the processing if user/subscription type cannot be matched, you can create your own implementation of interface and use it in your config file:
services:
serverToServerNotificationProcessor: Crm\FooModule\Models\AppleAppstore\ServerToServerNotificationProcessor
Apple Developer Documentation contains steps how to enable Server-to-Server Notification.
unified_receipt.latest_receipt_info.quantity
must be 1. We allow only one subscription per payment.