Search by

remp / crm-apple-appstore-module

markoph

CRM Apple AppStore Module

Package info

github.com/remp2020/crm-apple-appstore-module

Homepage

pkg:composer/remp/crm-apple-appstore-module

Statistics

Installs: 13 021

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 1

5.2.0 2026-11-06 08:14 UTC

README

Installation

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

Configuration

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 flag UnclaimedUser::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

For the Apple App Store Server API v2 notifications, the user and the subscription type are resolved by the appleAppstoreUserResolver and appleAppstoreSubscriptionTypeResolver services. Override them to change how notifications are matched:

services:
        appleAppstoreUserResolver: Crm\FooModule\Models\AppleAppstore\UserResolver
        appleAppstoreSubscriptionTypeResolver: Crm\FooModule\Models\AppleAppstore\SubscriptionTypeResolver

UserResolver splits the matching into resolveByAppAccountToken(), resolveByOriginalTransactionId() and createUnclaimedUser(), so an extending class can replace just one of the steps.

Enable Server-To-Server notifications

Apple Developer Documentation contains steps how to enable Server-to-Server Notification.

Support Notes

  • unified_receipt.latest_receipt_info.quantity must be 1. We allow only one subscription per payment.