Skip to content

PAM Native Subscriptions

Terminal window
pam add subscriptions
pam doctor
$subscriptions = new Subscriptions();
$subscriptions->products(['pro.monthly'], function (array $products) use ($subscriptions): void {
if (($product = $products[0] ?? null) === null) return;
$subscriptions->purchase(
$product->identifier,
fn ($transaction) => sendToBackend($transaction->verification),
$product->offerToken,
);
});

Subscriptions loads products, purchases, restores, and acknowledges; SubscriptionProduct normalizes price/offers; SubscriptionTransaction carries JWS/Play verification material; SubscriptionPurchaseState separates completed, pending, cancelled, and failed.

Verify every transaction through App Store Server or Google Play Developer API, persist entitlement server-side, then acknowledge Play. Never grant durable entitlement from a device callback. Reconcile after sign-in and account restore.

SubscriptionsPluginProvider registers the store module automatically.