Memberships
What a member holds in a project, as a connector's member surface reads it — who an account is, their live memberships in the core's own words, and the one write a member may ask for.
Subscriby\Connector\Core\Memberships. A bot's home screen, a status command and a "refresh my access" button all begin with the same question: who is this account in the project the installation serves, and what do they hold right now? The answer comes from the core's own rules, so every connector's surface says what the portal says.
standingOf()
$standing = $memberships->standingOf($installation, $account->identityRecord());
if ($standing === null) {
return $this->tellThemToConnectOnThePortal();
}
foreach ($standing->memberships as $membership) {
// $membership->planName, ->status, ->price, ->renewsAt, ->resources, ->grants, ->pass
}Reads the record's connector and externalId, finds the member who linked that account in the installation's project, and answers a MemberStanding: the MemberRef, the member's display name, the ProjectRef and the project's name, the portal's address (null while the project has no handle), and their live memberships oldest first. Null means the account is nobody's in that project; holdsAccess() says whether a member holds anything right now.
Each MembershipSummary carries the subscription's id, the plan's id, name and PlanKind, the status word as the portal prints it, the price formatted in the plan's currency with the billing cycle for a recurring plan, renewsAt (null when it does not renew: a plan paid once, a pass, a canceled subscription) and endsAt, the canceled and trialing flags, the titles of the places the plan grants, the live grants on it (a pending bearer link is a door the member still has to walk through, so show its reference as a Join button), and for a pass a PassStanding with the state, the headline, the window's dates and what the member must still do to get in.
reissueGrants()
$minted = $memberships->reissueGrants($installation, $account->identityRecord());Mints fresh grants for everything the member's live subscriptions entitle them to, through the action the portal's "refresh my access" runs, and answers how many were minted; zero for an account that is nobody's in the project. This is what MemberCommand::ReissueGrants means when the core puts that button on a message.
cancel()
try {
$cancelled = $memberships->cancel($installation, $account->identityRecord());
} catch (MembershipRefused $refused) {
// $refused->reason: not_a_member, subscription_unknown, not_cancellable
}Cancels the member's live membership the way the portal's last step does: access runs to the end of what was paid, and the MembershipCancellation says which subscription, which plan and until when. Show the retention screen from Retention first on a surface that offers one; this is the write after the member has said no to the offer. The refusal carries a stable reason: the account is nobody's in the project, the member holds nothing live, or holds a membership that cannot be cancelled here (already cancelled, a pass, or not theirs).
Both calls act as nobody on the member's behalf: the project is the boundary, and an account linked in another project answers null here. A connector never needs the member's id to ask; the account it is talking to is enough.
The member's recovery email
$standing = $this->memberships->recoveryEmailOf($installation, $account); // null for a stranger; ->email, ->verified, ->isSet()
$this->memberships->setRecoveryEmail($installation, $account, $typed);
$this->memberships->resendRecoveryEmailVerification($installation, $account);
$this->memberships->removeRecoveryEmail($installation, $account);The address that lets a member sign in to the portal when they lose the platform account they bought through, as the portal's account screen keeps it, for a member surface where the platform is the member's only door. Setting it mails the verification link through the portal's own write and answers the address unverified; an address that fails the portal's checks or that another member of the project has verified is invalid with the core's sentence; resending needs an address that is set and not yet verified, and removing one that is set, else no_email; a stranger is not_a_member.
How is this guide?
Last updated on
Creator sessions
Signing a creator in from a connector's own login door — the one call that turns an account the platform just vouched for into a dashboard session, a second-factor challenge, or the sign-up page.
Storefront
What a project sells, as a connector's member surface offers it — the plans on offer by the core's own rule, the portal checkout that opens each, and the one purchase that completes on the connector, an access code.