PaymentProviderStripe
Reference for the PaymentProviderStripe module: a complete Stripe payment provider covering purchases, merchant Connect onboarding and customer records. Its classes route onboarding URLs, receive and dispatch Stripe webhooks, wrap the Stripe API, and read and write the module's own tables.
This page is a pure reference. It documents only the classes and functions the module's source defines, with their signatures, parameters and return types.
PaymentProviderStripe- the module class; registers the onboarding HTTP route.PaymentProviderStripeOnboardingWebhook- top-level function handling Stripe onboarding return and refresh URLs.PaymentProviderStripeConnectService- orchestrates Stripe Connect account creation, onboarding and dashboard links.PaymentProviderStripeCustomerCommand- handlers for customer, payment method, setup intent and payment intent events.PaymentProviderStripeCustomerData- a Stripe Customer API response.PaymentProviderStripeCustomerDatabase- reads and writes stored Stripe customer rows.PaymentProviderStripeCustomerEventData- a Stripe customer-related event.PaymentProviderStripeCustomerRowData- a database row for a stored Stripe customer.PaymentProviderStripeCustomerWebhook- dispatches the Stripe customer webhook.PaymentProviderStripeDatabase- common Stripe API wrappers taking the secret key as a parameter.PaymentProviderStripeMerchantAccountEventData- a Stripe Connect account event.PaymentProviderStripeMerchantCommand- handlers for Stripe Connect account events.PaymentProviderStripeMerchantConnectCommand- a self-contained Stripe Connect webhook handler.PaymentProviderStripeMerchantData- a merchant's Stripe Connect onboarding and account state.PaymentProviderStripeMerchantDatabase- reads and writes stored Stripe merchant rows.PaymentProviderStripeMerchantWebhook- dispatches the Stripe Connect account webhook.PaymentProviderStripePaymentIntentData- a Stripe PaymentIntent API response.PaymentProviderStripePaymentIntentDatabase- reads and writes stored payment intent rows.PaymentProviderStripePaymentIntentRowData- a database row for a stored Stripe PaymentIntent.PaymentProviderStripePaymentMethodDatabase- reads and writes stored payment method rows.PaymentProviderStripePaymentMethodRowData- a database row for a stored Stripe payment method.PaymentProviderStripePaymentStatusAmountCapturableData- a Stripe amount-capturable status update.PaymentProviderStripePaymentStatusChargeData- a Stripe charge status update.PaymentProviderStripePaymentStatusDisputeData- a Stripe dispute status update.PaymentProviderStripePaymentStatusRefundData- a Stripe refund status update.PaymentProviderStripePaymentStatusRequiresCaptureData- a Stripe payment intent requires-capture status.PaymentProviderStripePaymentStatusTransferData- a Stripe transfer status update.PaymentProviderStripePurchaseAmountCapturableUpdatedData- a Stripe amount-capturable-updated status.PaymentProviderStripePurchaseChargeCommand- handlers for charge-level and refund and dispute events.PaymentProviderStripePurchaseCommand- handlers for payment intent completion events.PaymentProviderStripePurchaseData- Stripe-specific initial purchase provider data.PaymentProviderStripePurchaseDatabase- database operations for the Stripe purchase provider.PaymentProviderStripePurchaseEventData- basic Stripe payment intent event data.PaymentProviderStripePurchasePaymentIntentIdData- a payment intent id stored as provider data.PaymentProviderStripePurchaseRequiresActionData- a Stripe payment intent requires-action event.PaymentProviderStripePurchaseRequiresCaptureData- a Stripe payment intent requires-capture event.PaymentProviderStripePurchaseStateCommand- handlers for payment intent state-change events.PaymentProviderStripePurchaseTransferCommand- handlers for Connect transfer events.PaymentProviderStripePurchaseWebhook- registers and dispatches the purchase, state, charge and transfer webhooks.PaymentProviderStripeRedirectData- a stored Stripe redirect record.PaymentProviderStripeRedirectDatabase- reads and writes onboarding redirect rows with permalinks.PaymentProviderStripeSetupIntentDatabase- reads and writes stored setup intent rows.PaymentProviderStripeSetupIntentRowData- a database row for a stored Stripe SetupIntent.PaymentProviderStripeWebhook- the core Stripe webhook handler and command registry.
The data objects on this page are immutable records built from readonly promoted
constructor parameters. Several also expose ToJson and FromJson
methods, and a few a FromStripeObject factory or a With method;
these are documented on each class.
PaymentProviderStripe
The module class. Registers the module's HTTP routes under the current route directory.
Route
PaymentProviderStripe::Route(): void
Register the module's HTTP endpoints under the current route directory, including the onboarding handler for return and refresh URLs by permalink.
Returns void
PaymentProviderStripeOnboardingWebhook
A top-level function (not a class) registered by the module's route as the unified handler for Stripe onboarding return and refresh URLs.
PaymentProviderStripeOnboardingWebhook
PaymentProviderStripeOnboardingWebhook(string $permalink): void
Handle a Stripe onboarding return or refresh URL: look up the redirect record by permalink, and for refresh generate a new onboarding link and redirect, for return retrieve and persist the Stripe account status and redirect or return JSON, otherwise respond 400.
| Name | Type | Description |
|---|---|---|
$permalink | string | The permalink identifying the stored redirect record. |
Returns void
PaymentProviderStripeConnectService
Orchestrates Stripe Connect account creation, onboarding links, dashboard links, and account and balance retrieval.
BeginConnectOnboarding
PaymentProviderStripeConnectService::BeginConnectOnboarding(int $memberId, string $optionalRedirectUrl = ''): string
Ensure a Connect account exists and return a fresh onboarding link URL for the member.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member to onboard. |
$optionalRedirectUrl | string | A redirect URL to return to, or empty for the default. |
Returns string The onboarding link URL.
CreateAccountSession
PaymentProviderStripeConnectService::CreateAccountSession(string $connectAccountRef): string
Create a Stripe Account Session for Connect embedded components.
| Name | Type | Description |
|---|---|---|
$connectAccountRef | string | The connected account id. |
Returns string The account session client_secret.
CreateDashboardLoginLink
PaymentProviderStripeConnectService::CreateDashboardLoginLink(int $memberId): string
Create a one-time Stripe Dashboard login link for a member's connected account.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member whose connected account to link to. |
Returns string The dashboard login link URL.
CreateOnboardingLink
PaymentProviderStripeConnectService::CreateOnboardingLink(int $memberId, string $optionalRedirectUrl = ''): string
Generate and persist an onboarding URL, with return and refresh permalinks, for a member's Connect account.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member to onboard. |
$optionalRedirectUrl | string | A redirect URL to return to, or empty for the default. |
Returns string The onboarding URL.
CreateStripeConnectAccount
PaymentProviderStripeConnectService::CreateStripeConnectAccount(int $memberId): void
Begin Stripe Connect onboarding for a member by ensuring a Connect account exists, creating one if needed, and persisting its state; throws on validation or Stripe API errors.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member to create a Connect account for. |
Returns void
FetchTransactionsAndBalances
PaymentProviderStripeConnectService::FetchTransactionsAndBalances(string $connectAccountRef): array
Fetch the balance, default external payout account, and payouts for a connected account.
| Name | Type | Description |
|---|---|---|
$connectAccountRef | string | The connected account id. |
Returns array A map with the balance, default payment method and payouts.
stripeClient
PaymentProviderStripeConnectService::stripeClient(): \Stripe\StripeClient
Build and return a Stripe client using the configured secret key.
Returns \Stripe\StripeClient The Stripe client.
PaymentProviderStripeCustomerCommand
Command handlers for Stripe customer, payment method, setup intent and payment intent events, invoked by the customer webhook.
CustomerCreated
PaymentProviderStripeCustomerCommand::CustomerCreated($event, $object, $eventType): void
Handle the Stripe customer.created event by extracting customer data and member id from metadata and upserting a customer record.
Returns void
CustomerDeleted
PaymentProviderStripeCustomerCommand::CustomerDeleted($event, $object, $eventType): void
Handle customer.deleted by looking up the existing customer and logging it; the record is not deleted.
Returns void
CustomerUpdated
PaymentProviderStripeCustomerCommand::CustomerUpdated($event, $object, $eventType): void
Handle customer.updated by looking up the existing customer, updating its default payment method if changed, and upserting the record.
Returns void
PaymentIntentCanceled
PaymentProviderStripeCustomerCommand::PaymentIntentCanceled($event, $object, $eventType): void
Handle payment_intent.canceled by syncing the payment intent record from the Stripe object.
Returns void
PaymentIntentPaymentFailed
PaymentProviderStripeCustomerCommand::PaymentIntentPaymentFailed($event, $object, $eventType): void
Handle payment_intent.payment_failed by syncing the payment intent record from the Stripe object.
Returns void
PaymentIntentSucceeded
PaymentProviderStripeCustomerCommand::PaymentIntentSucceeded($event, $object, $eventType): void
Handle payment_intent.succeeded by syncing the payment intent record and, when metadata carries a ride id, notifying the ride payment intent webhook.
Returns void
PaymentMethodAttached
PaymentProviderStripeCustomerCommand::PaymentMethodAttached($event, $object, $eventType): void
Handle payment_method.attached by extracting card and billing details and upserting a payment method record.
Returns void
PaymentMethodDetached
PaymentProviderStripeCustomerCommand::PaymentMethodDetached($event, $object, $eventType): void
Handle payment_method.detached by looking up the payment method record and logging it; the record is not deleted.
Returns void
PaymentMethodUpdated
PaymentProviderStripeCustomerCommand::PaymentMethodUpdated($event, $object, $eventType): void
Handle payment_method.updated by re-extracting card and billing details and upserting the payment method record.
Returns void
SetupIntentSetupFailed
PaymentProviderStripeCustomerCommand::SetupIntentSetupFailed($event, $object, $eventType): void
Handle setup_intent.setup_failed by upserting a setup intent record with status requires_payment_method.
Returns void
SetupIntentSucceeded
PaymentProviderStripeCustomerCommand::SetupIntentSucceeded($event, $object, $eventType): void
Handle setup_intent.succeeded by upserting a setup intent record and, when metadata carries a ride id, notifying the ride setup intent webhook.
Returns void
StripeMetadataToJson
PaymentProviderStripeCustomerCommand::StripeMetadataToJson($metadataObj): ?string
Extract a Stripe metadata object's scalar key-value pairs into a JSON string, excluding SDK internals.
| Name | Type | Description |
|---|---|---|
$metadataObj | mixed | The Stripe metadata object. |
Returns ?string The metadata as JSON, or null when empty.
PaymentProviderStripeCustomerData
A Stripe Customer API response.
Properties
| Name | Type |
|---|---|
$id | string |
$email | ?string |
$name | ?string |
$phone | ?string |
$description | ?string |
$created | ?int |
$defaultSource | ?string |
$invoicePrefix | ?string |
$currency | ?string |
$delinquent | ?bool |
$balance | ?int |
__construct
PaymentProviderStripeCustomerData::__construct(string $id = '', ?string $email = null, ?string $name = null, ?string $phone = null, ?string $description = null, ?int $created = null, ?string $defaultSource = null, ?string $invoicePrefix = null, ?string $currency = null, ?bool $delinquent = null, ?int $balance = null)
Construct the customer data object from its field values.
FromJson
PaymentProviderStripeCustomerData::FromJson(string $json): self
Build a customer data object from its JSON representation.
Returns self The customer data object.
FromStripeObject
PaymentProviderStripeCustomerData::FromStripeObject(object $stripeCustomer): self
Build a customer data object from a Stripe Customer object.
| Name | Type | Description |
|---|---|---|
$stripeCustomer | object | The Stripe Customer object. |
Returns self The customer data object.
ToJson
PaymentProviderStripeCustomerData::ToJson(): string
Serialise the customer data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeCustomerDatabase
Reads and writes stored Stripe customer rows.
fromRow
PaymentProviderStripeCustomerDatabase::fromRow(stdClass $row): PaymentProviderStripeCustomerRowData
Construct the customer row data object from a database row.
| Name | Type | Description |
|---|---|---|
$row | stdClass | The raw database row. |
Returns PaymentProviderStripeCustomerRowData The mapped row.
GetById
PaymentProviderStripeCustomerDatabase::GetById(int $id): PaymentProviderStripeCustomerRowData
Get a customer by primary id.
| Name | Type | Description |
|---|---|---|
$id | int | The customer row id. |
Returns PaymentProviderStripeCustomerRowData The customer row.
GetByIds
PaymentProviderStripeCustomerDatabase::GetByIds(array $ids): array
Bulk-fetch customers by an array of ids.
| Name | Type | Description |
|---|---|---|
$ids | array | The customer row ids. |
Returns array The matching customer rows.
GetOptionalByMemberId
PaymentProviderStripeCustomerDatabase::GetOptionalByMemberId(int $memberId): PaymentProviderStripeCustomerRowData|null
Get a customer by member id, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member id. |
Returns PaymentProviderStripeCustomerRowData|null The customer row, or null.
GetOptionalByStripeReference
PaymentProviderStripeCustomerDatabase::GetOptionalByStripeReference(string $stripeReference): PaymentProviderStripeCustomerRowData|null
Get a customer by Stripe reference, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$stripeReference | string | The Stripe customer reference. |
Returns PaymentProviderStripeCustomerRowData|null The customer row, or null.
UpdateDefaultPaymentMethod
PaymentProviderStripeCustomerDatabase::UpdateDefaultPaymentMethod(int $customerId, string|null $paymentMethodRef): void
Update the default payment method reference for a customer.
| Name | Type | Description |
|---|---|---|
$customerId | int | The customer row id. |
$paymentMethodRef | string|null | The default payment method reference, or null. |
Returns void
Upsert
PaymentProviderStripeCustomerDatabase::Upsert(int $memberId, string $stripeReference, string|null $email = null, string|null $name = null, string|null $phone = null, string|null $description = null, string|null $metadata = null): int
Create or update a customer record and return its id.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member the customer belongs to. |
$stripeReference | string | The Stripe customer reference. |
$email | string|null | The customer email, or null. |
$name | string|null | The customer name, or null. |
$phone | string|null | The customer phone, or null. |
$description | string|null | The customer description, or null. |
$metadata | string|null | The metadata JSON, or null. |
Returns int The customer row id.
PaymentProviderStripeCustomerEventData
A Stripe customer-related event, with the customer id and object info extracted from the event structure.
Properties
| Name | Type |
|---|---|
$event | object |
$customerId | string |
$objectId | string|null |
$objectType | string|null |
__construct
PaymentProviderStripeCustomerEventData::__construct(object $event, string $customerId = '', string|null $objectId = null, string|null $objectType = null)
Construct the customer event data object from its field values.
FromJson
PaymentProviderStripeCustomerEventData::FromJson(string $eventJson): self
Build a customer event data object from the event JSON.
| Name | Type | Description |
|---|---|---|
$eventJson | string | The Stripe event JSON. |
Returns self The customer event data object.
ToJson
PaymentProviderStripeCustomerEventData::ToJson(): string
Serialise the customer event data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeCustomerRowData
A database row for a stored Stripe customer.
Properties
| Name | Type |
|---|---|
$id | int |
$email | string|null |
$name | string|null |
$phone | string|null |
$description | string|null |
$metadata | string|null |
$memberId | int |
$stripeReference | string |
$defaultPaymentMethodRef | string|null |
$addedDate | CalendarDateData |
$addedTimestamp | CalendarDateTimeData |
$lastSyncedAt | CalendarDateTimeData|null |
__construct
PaymentProviderStripeCustomerRowData::__construct(int $id = 0, string|null $email = null, string|null $name = null, string|null $phone = null, string|null $description = null, string|null $metadata = null, int $memberId = 0, string $stripeReference = '', string|null $defaultPaymentMethodRef = null, CalendarDateData $addedDate = new CalendarDateData(), CalendarDateTimeData $addedTimestamp = new CalendarDateTimeData(), CalendarDateTimeData|null $lastSyncedAt = null)
Construct the customer row data object from its field values.
FromJson
PaymentProviderStripeCustomerRowData::FromJson(string $json): self
Build a customer row data object from its JSON representation.
Returns self The customer row data object.
ToJson
PaymentProviderStripeCustomerRowData::ToJson(): string
Serialise the customer row data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeCustomerWebhook
Dispatches the Stripe customer webhook.
Handle
PaymentProviderStripeCustomerWebhook::Handle($requestMethod, $requestBody, $headers): void
Register the customer, payment method, setup intent and payment intent event handlers and dispatch the request through the core webhook handler using the configured webhook secret.
| Name | Type | Description |
|---|---|---|
$requestMethod | mixed | The HTTP request method. |
$requestBody | mixed | The raw request body. |
$headers | mixed | The request headers. |
Returns void
PaymentProviderStripeDatabase
Common Stripe API wrapper functions. All take the secret key as a parameter and do not read Config directly.
CreateCustomer
PaymentProviderStripeDatabase::CreateCustomer(string $secretKey, string $email, array $metadata = []): PaymentProviderStripeCustomerData
Create a Stripe Customer.
| Name | Type | Description |
|---|---|---|
$secretKey | string | The Stripe secret key. |
$email | string | The customer email. |
$metadata | array | Metadata to attach to the customer. |
Returns PaymentProviderStripeCustomerData The created customer.
CreatePaymentIntent
PaymentProviderStripeDatabase::CreatePaymentIntent(string $secretKey, int $amountInCents, string $currency, string $description, string $receiptEmail, ?string $customerId = null, array $additionalParams = []): PaymentProviderStripePaymentIntentData
Create a Stripe PaymentIntent.
| Name | Type | Description |
|---|---|---|
$secretKey | string | The Stripe secret key. |
$amountInCents | int | The amount in the currency's smallest unit. |
$currency | string | The currency code. |
$description | string | The payment description. |
$receiptEmail | string | The receipt email address. |
$customerId | ?string | The Stripe customer id, or null. |
$additionalParams | array | Extra parameters for the PaymentIntent. |
Returns PaymentProviderStripePaymentIntentData The created payment intent.
RetrieveCustomer
PaymentProviderStripeDatabase::RetrieveCustomer(string $secretKey, string $customerId): PaymentProviderStripeCustomerData
Retrieve a Stripe Customer by id.
| Name | Type | Description |
|---|---|---|
$secretKey | string | The Stripe secret key. |
$customerId | string | The Stripe customer id. |
Returns PaymentProviderStripeCustomerData The customer.
RetrievePaymentIntent
PaymentProviderStripeDatabase::RetrievePaymentIntent(string $secretKey, string $paymentIntentId): PaymentProviderStripePaymentIntentData
Retrieve a Stripe PaymentIntent by id.
| Name | Type | Description |
|---|---|---|
$secretKey | string | The Stripe secret key. |
$paymentIntentId | string | The Stripe payment intent id. |
Returns PaymentProviderStripePaymentIntentData The payment intent.
PaymentProviderStripeMerchantAccountEventData
A Stripe Connect account event, with the account id extracted from the event structure.
Properties
| Name | Type |
|---|---|
$event | object |
$accountId | string |
__construct
PaymentProviderStripeMerchantAccountEventData::__construct(object $event, string $accountId = '')
Construct the merchant account event data object from its field values.
FromJson
PaymentProviderStripeMerchantAccountEventData::FromJson(string $eventJson): self
Build a merchant account event data object from the event JSON.
| Name | Type | Description |
|---|---|---|
$eventJson | string | The Stripe event JSON. |
Returns self The merchant account event data object.
ToJson
PaymentProviderStripeMerchantAccountEventData::ToJson(): string
Serialise the merchant account event data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeMerchantCommand
Command handlers for Stripe Connect account events, invoked by the merchant webhook.
AccountDeauthorized
PaymentProviderStripeMerchantCommand::AccountDeauthorized($event, $object, $eventType): void
Handle account.application.deauthorized by adding a pending status to the merchant, marking the account disconnected.
Returns void
AccountUpdated
PaymentProviderStripeMerchantCommand::AccountUpdated($event, $object, $eventType): void
Handle Stripe Connect account.updated by looking up the merchant, deriving the charges, payouts, TOS, external-account and details flags, adding a merchant status, and updating account flags.
Returns void
ExternalAccountCreated
PaymentProviderStripeMerchantCommand::ExternalAccountCreated($event, $object, $eventType): void
Handle account.external_account.created by marking the merchant's external account status true and updating Stripe merchant flags.
Returns void
ExternalAccountDeleted
PaymentProviderStripeMerchantCommand::ExternalAccountDeleted($event, $object, $eventType): void
Handle account.external_account.deleted by marking the merchant's external account status false and updating Stripe merchant flags.
Returns void
ExternalAccountUpdated
PaymentProviderStripeMerchantCommand::ExternalAccountUpdated($event, $object, $eventType): void
Handle account.external_account.updated by marking the merchant's external account status true and updating Stripe merchant flags.
Returns void
PaymentProviderStripeMerchantConnectCommand
A self-contained Stripe Connect webhook handler.
Handle
PaymentProviderStripeMerchantConnectCommand::Handle(string $requestMethod, string $requestBody, array $headers): void
Normalise headers, verify the signature, decode JSON, resolve the connected account id, look up the merchant, extract account flags, and update merchant status and flags, writing HTTP responses directly.
| Name | Type | Description |
|---|---|---|
$requestMethod | string | The HTTP request method. |
$requestBody | string | The raw request body. |
$headers | array | The request headers. |
Returns void
PaymentProviderStripeMerchantData
A merchant's Stripe Connect onboarding and account state.
Properties
| Name | Type |
|---|---|
$id | int |
$memberId | int |
$connectAccountRef | string|null |
$onboardingCompletedAt | CalendarDateTimeData|null |
$emailVerified | bool |
$identityVerified | bool |
$externalAccountAdded | bool |
$tosAccepted | bool |
$chargesEnabled | bool |
$payoutsEnabled | bool |
$lastOnboardingUrl | string|null |
$lastOnboardingUrlExpiresAt | CalendarDateTimeData|null |
$lastSyncedAt | CalendarDateTimeData|null |
$createdAt | CalendarDateTimeData |
__construct
PaymentProviderStripeMerchantData::__construct(int $id = 0, int $memberId = 0, string|null $connectAccountRef = null, CalendarDateTimeData|null $onboardingCompletedAt = null, bool $emailVerified = false, bool $identityVerified = false, bool $externalAccountAdded = false, bool $tosAccepted = false, bool $chargesEnabled = false, bool $payoutsEnabled = false, string|null $lastOnboardingUrl = null, CalendarDateTimeData|null $lastOnboardingUrlExpiresAt = null, CalendarDateTimeData|null $lastSyncedAt = null, CalendarDateTimeData $createdAt = new CalendarDateTimeData())
Construct the merchant data object from its field values.
FromJson
PaymentProviderStripeMerchantData::FromJson(string $json): self
Build a merchant data object from its JSON representation.
Returns self The merchant data object.
ToJson
PaymentProviderStripeMerchantData::ToJson(): string
Serialise the merchant data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeMerchantDatabase
Reads and writes stored Stripe merchant and Connect account rows.
fromRow
PaymentProviderStripeMerchantDatabase::fromRow(stdClass $row): PaymentProviderStripeMerchantData
Construct the merchant data object from a database row.
| Name | Type | Description |
|---|---|---|
$row | stdClass | The raw database row. |
Returns PaymentProviderStripeMerchantData The mapped row.
GetById
PaymentProviderStripeMerchantDatabase::GetById(int $id): PaymentProviderStripeMerchantData
Get a merchant by primary id.
| Name | Type | Description |
|---|---|---|
$id | int | The merchant row id. |
Returns PaymentProviderStripeMerchantData The merchant row.
GetByIds
PaymentProviderStripeMerchantDatabase::GetByIds(array $ids): array
Bulk-fetch merchants by an array of ids.
| Name | Type | Description |
|---|---|---|
$ids | array | The merchant row ids. |
Returns array The matching merchant rows.
GetOptionalByConnectAccountRef
PaymentProviderStripeMerchantDatabase::GetOptionalByConnectAccountRef(string $connectAccountRef): PaymentProviderStripeMerchantData|null
Get a merchant by Stripe Connect account id, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$connectAccountRef | string | The Connect account id. |
Returns PaymentProviderStripeMerchantData|null The merchant row, or null.
GetOptionalByMemberId
PaymentProviderStripeMerchantDatabase::GetOptionalByMemberId(int $memberId): PaymentProviderStripeMerchantData|null
Get the latest merchant record for a member id, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member id. |
Returns PaymentProviderStripeMerchantData|null The merchant row, or null.
UpdateFlagsById
PaymentProviderStripeMerchantDatabase::UpdateFlagsById(int $id, bool $chargesEnabled, bool $payoutsEnabled, bool $tosAccepted, bool $externalAccountAdded, bool $detailsSubmitted): void
Update the Stripe capability flags for the row by primary id.
| Name | Type | Description |
|---|---|---|
$id | int | The merchant row id. |
$chargesEnabled | bool | Whether charges are enabled. |
$payoutsEnabled | bool | Whether payouts are enabled. |
$tosAccepted | bool | Whether the terms of service were accepted. |
$externalAccountAdded | bool | Whether an external account was added. |
$detailsSubmitted | bool | Whether account details were submitted. |
Returns void
UpdateFromStripeAccountByMemberId
PaymentProviderStripeMerchantDatabase::UpdateFromStripeAccountByMemberId(int $memberId, \Stripe\Account $acc): void
Update database fields for a member from a Stripe Account object.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member id. |
$acc | \Stripe\Account | The Stripe Account object. |
Returns void
UpdateOnboardingLink
PaymentProviderStripeMerchantDatabase::UpdateOnboardingLink(int $memberId, string $url, int $expiresAt): void
Update the onboarding link URL and expiry for a member.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member id. |
$url | string | The onboarding link URL. |
$expiresAt | int | The link expiry timestamp. |
Returns void
UpsertConnectAccount
PaymentProviderStripeMerchantDatabase::UpsertConnectAccount(int $memberId, string $connectAccountRef): int
Ensure a merchant row for the member and set or update the Connect account reference, returning the row id.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member id. |
$connectAccountRef | string | The Connect account id. |
Returns int The merchant row id.
PaymentProviderStripeMerchantWebhook
Dispatches the Stripe Connect account webhook.
Handle
PaymentProviderStripeMerchantWebhook::Handle($requestMethod, $requestBody, $headers): void
Register the Stripe Connect account event handlers and dispatch the request through the core webhook handler.
| Name | Type | Description |
|---|---|---|
$requestMethod | mixed | The HTTP request method. |
$requestBody | mixed | The raw request body. |
$headers | mixed | The request headers. |
Returns void
PaymentProviderStripePaymentIntentData
A Stripe PaymentIntent API response.
Properties
| Name | Type |
|---|---|
$id | string |
$clientSecret | ?string |
$status | ?string |
$amount | ?int |
$currency | ?string |
$description | ?string |
$customer | ?string |
$created | ?int |
$paymentMethod | ?string |
$latestCharge | ?string |
$amountCapturable | ?int |
$amountReceived | ?int |
$cancelReason | ?string |
$cancellationReason | ?string |
$receiptEmail | ?string |
__construct
PaymentProviderStripePaymentIntentData::__construct(string $id = '', ?string $clientSecret = null, ?string $status = null, ?int $amount = null, ?string $currency = null, ?string $description = null, ?string $customer = null, ?int $created = null, ?string $paymentMethod = null, ?string $latestCharge = null, ?int $amountCapturable = null, ?int $amountReceived = null, ?string $cancelReason = null, ?string $cancellationReason = null, ?string $receiptEmail = null)
Construct the payment intent data object from its field values.
FromJson
PaymentProviderStripePaymentIntentData::FromJson(string $json): self
Build a payment intent data object from its JSON representation.
Returns self The payment intent data object.
FromStripeObject
PaymentProviderStripePaymentIntentData::FromStripeObject(object $stripePaymentIntent): self
Build a payment intent data object from a Stripe PaymentIntent object.
| Name | Type | Description |
|---|---|---|
$stripePaymentIntent | object | The Stripe PaymentIntent object. |
Returns self The payment intent data object.
ToJson
PaymentProviderStripePaymentIntentData::ToJson(): string
Serialise the payment intent data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentIntentDatabase
Reads and writes stored Stripe payment intent rows.
fromRow
PaymentProviderStripePaymentIntentDatabase::fromRow(stdClass $row): PaymentProviderStripePaymentIntentRowData
Construct the payment intent row data object from a database row.
| Name | Type | Description |
|---|---|---|
$row | stdClass | The raw database row. |
Returns PaymentProviderStripePaymentIntentRowData The mapped row.
GetByCustomerId
PaymentProviderStripePaymentIntentDatabase::GetByCustomerId(int $customerId): array
Get payment intents by customer id.
| Name | Type | Description |
|---|---|---|
$customerId | int | The customer row id. |
Returns array The matching payment intent rows.
GetById
PaymentProviderStripePaymentIntentDatabase::GetById(int $id): PaymentProviderStripePaymentIntentRowData
Get a payment intent by primary id.
| Name | Type | Description |
|---|---|---|
$id | int | The payment intent row id. |
Returns PaymentProviderStripePaymentIntentRowData The payment intent row.
GetByIds
PaymentProviderStripePaymentIntentDatabase::GetByIds(array $ids): array
Bulk-fetch payment intents by an array of ids.
| Name | Type | Description |
|---|---|---|
$ids | array | The payment intent row ids. |
Returns array The matching payment intent rows.
GetByMerchantId
PaymentProviderStripePaymentIntentDatabase::GetByMerchantId(int $merchantId): array
Get payment intents by merchant id.
| Name | Type | Description |
|---|---|---|
$merchantId | int | The merchant row id. |
Returns array The matching payment intent rows.
GetOptionalByStripeReference
PaymentProviderStripePaymentIntentDatabase::GetOptionalByStripeReference(string $stripeReference): PaymentProviderStripePaymentIntentRowData|null
Get a payment intent by Stripe reference, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$stripeReference | string | The Stripe payment intent reference. |
Returns PaymentProviderStripePaymentIntentRowData|null The payment intent row, or null.
Upsert
PaymentProviderStripePaymentIntentDatabase::Upsert(string $stripeReference, int|null $customerId = null, int|null $merchantId = null, int|null $paymentMethodId = null, int $amountMillipence = 0, string $currency = '', string $status = '', string|null $clientSecret = null, int|null $applicationFeeAmountMillipence = null, int|null $transferAmountMillipence = null, int|null $amountReceivedMillipence = null, int|null $amountCapturableMillipence = null, string|null $description = null, string|null $receiptEmail = null, string|null $cancellationReason = null, string|null $latestChargeRef = null, string|null $metadata = null): int
Create or update a payment intent record and return its id.
Returns int The payment intent row id.
PaymentProviderStripePaymentIntentRowData
A database row for a stored Stripe PaymentIntent, with amounts in millipence.
Properties
| Name | Type |
|---|---|
$id | int |
$stripeReference | string |
$customerId | int|null |
$merchantId | int|null |
$paymentMethodId | int|null |
$amountMillipence | int |
$currency | string |
$status | string |
$clientSecret | string|null |
$applicationFeeAmountMillipence | int|null |
$transferAmountMillipence | int|null |
$amountReceivedMillipence | int|null |
$amountCapturableMillipence | int|null |
$description | string|null |
$receiptEmail | string|null |
$cancellationReason | string|null |
$latestChargeRef | string|null |
$metadata | string|null |
$createdAt | CalendarDateTimeData |
$lastSyncedAt | CalendarDateTimeData|null |
__construct
PaymentProviderStripePaymentIntentRowData::__construct(int $id = 0, string $stripeReference = '', int|null $customerId = null, int|null $merchantId = null, int|null $paymentMethodId = null, int $amountMillipence = 0, string $currency = '', string $status = '', string|null $clientSecret = null, int|null $applicationFeeAmountMillipence = null, int|null $transferAmountMillipence = null, int|null $amountReceivedMillipence = null, int|null $amountCapturableMillipence = null, string|null $description = null, string|null $receiptEmail = null, string|null $cancellationReason = null, string|null $latestChargeRef = null, string|null $metadata = null, CalendarDateTimeData $createdAt = new CalendarDateTimeData(), CalendarDateTimeData|null $lastSyncedAt = null)
Construct the payment intent row data object from its field values.
FromJson
PaymentProviderStripePaymentIntentRowData::FromJson(string $json): self
Build a payment intent row data object from its JSON representation.
Returns self The payment intent row data object.
ToJson
PaymentProviderStripePaymentIntentRowData::ToJson(): string
Serialise the payment intent row data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentMethodDatabase
Reads and writes stored Stripe payment method rows.
fromRow
PaymentProviderStripePaymentMethodDatabase::fromRow(stdClass $row): PaymentProviderStripePaymentMethodRowData
Construct the payment method row data object from a database row.
| Name | Type | Description |
|---|---|---|
$row | stdClass | The raw database row. |
Returns PaymentProviderStripePaymentMethodRowData The mapped row.
GetByCustomerId
PaymentProviderStripePaymentMethodDatabase::GetByCustomerId(int $customerId): array
Get payment methods by customer id.
| Name | Type | Description |
|---|---|---|
$customerId | int | The customer row id. |
Returns array The matching payment method rows.
GetById
PaymentProviderStripePaymentMethodDatabase::GetById(int $id): PaymentProviderStripePaymentMethodRowData
Get a payment method by primary id.
| Name | Type | Description |
|---|---|---|
$id | int | The payment method row id. |
Returns PaymentProviderStripePaymentMethodRowData The payment method row.
GetByIds
PaymentProviderStripePaymentMethodDatabase::GetByIds(array $ids): array
Bulk-fetch payment methods by an array of ids.
| Name | Type | Description |
|---|---|---|
$ids | array | The payment method row ids. |
Returns array The matching payment method rows.
GetDefaultByCustomerId
PaymentProviderStripePaymentMethodDatabase::GetDefaultByCustomerId(int $customerId): PaymentProviderStripePaymentMethodRowData|null
Get the default payment method for a customer, or null when there is none.
| Name | Type | Description |
|---|---|---|
$customerId | int | The customer row id. |
Returns PaymentProviderStripePaymentMethodRowData|null The default payment method row, or null.
GetOptionalByStripeReference
PaymentProviderStripePaymentMethodDatabase::GetOptionalByStripeReference(string $stripeReference): PaymentProviderStripePaymentMethodRowData|null
Get a payment method by Stripe reference, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$stripeReference | string | The Stripe payment method reference. |
Returns PaymentProviderStripePaymentMethodRowData|null The payment method row, or null.
SetAsDefault
PaymentProviderStripePaymentMethodDatabase::SetAsDefault(int $paymentMethodId, int $customerId): void
Set a payment method as default for a customer.
| Name | Type | Description |
|---|---|---|
$paymentMethodId | int | The payment method row id. |
$customerId | int | The customer row id. |
Returns void
Upsert
PaymentProviderStripePaymentMethodDatabase::Upsert(string $stripeReference, int $customerId, string $type, bool $isDefault = false, string|null $cardBrand = null, string|null $cardLast4 = null, int|null $cardExpMonth = null, int|null $cardExpYear = null, string|null $cardFingerprint = null, string|null $billingDetailsName = null, string|null $billingDetailsEmail = null, string|null $billingDetailsPhone = null, string|null $metadata = null): int
Create or update a payment method record and return its id.
Returns int The payment method row id.
PaymentProviderStripePaymentMethodRowData
A database row for a stored Stripe payment method or card.
Properties
| Name | Type |
|---|---|
$id | int |
$stripeReference | string |
$customerId | int |
$type | string |
$isDefault | bool |
$cardBrand | string|null |
$cardLast4 | string|null |
$cardExpMonth | int|null |
$cardExpYear | int|null |
$cardFingerprint | string|null |
$billingDetailsName | string|null |
$billingDetailsEmail | string|null |
$billingDetailsPhone | string|null |
$metadata | string|null |
$createdAt | CalendarDateTimeData |
$lastSyncedAt | CalendarDateTimeData|null |
__construct
PaymentProviderStripePaymentMethodRowData::__construct(int $id = 0, string $stripeReference = '', int $customerId = 0, string $type = '', bool $isDefault = false, string|null $cardBrand = null, string|null $cardLast4 = null, int|null $cardExpMonth = null, int|null $cardExpYear = null, string|null $cardFingerprint = null, string|null $billingDetailsName = null, string|null $billingDetailsEmail = null, string|null $billingDetailsPhone = null, string|null $metadata = null, CalendarDateTimeData $createdAt = new CalendarDateTimeData(), CalendarDateTimeData|null $lastSyncedAt = null)
Construct the payment method row data object from its field values.
FromJson
PaymentProviderStripePaymentMethodRowData::FromJson(string $json): self
Build a payment method row data object from its JSON representation.
Returns self The payment method row data object.
ToJson
PaymentProviderStripePaymentMethodRowData::ToJson(): string
Serialise the payment method row data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentStatusAmountCapturableData
A Stripe amount-capturable status update.
Properties
| Name | Type |
|---|---|
$amountCapturable | ?int |
$eventId | ?string |
__construct
PaymentProviderStripePaymentStatusAmountCapturableData::__construct(?int $amountCapturable = null, ?string $eventId = null)
Construct the amount-capturable status data object from its field values.
FromJson
PaymentProviderStripePaymentStatusAmountCapturableData::FromJson(string $json): self
Build an amount-capturable status data object from its JSON representation.
Returns self The status data object.
ToJson
PaymentProviderStripePaymentStatusAmountCapturableData::ToJson(): string
Serialise the amount-capturable status data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentStatusChargeData
A Stripe charge status update.
Properties
| Name | Type |
|---|---|
$chargeId | ?string |
$chargeStatus | ?string |
$chargeFailureReason | ?string |
$balanceTransactionId | ?string |
$eventId | ?string |
__construct
PaymentProviderStripePaymentStatusChargeData::__construct(?string $chargeId = null, ?string $chargeStatus = null, ?string $chargeFailureReason = null, ?string $balanceTransactionId = null, ?string $eventId = null)
Construct the charge status data object from its field values.
FromJson
PaymentProviderStripePaymentStatusChargeData::FromJson(string $json): self
Build a charge status data object from its JSON representation.
Returns self The status data object.
ToJson
PaymentProviderStripePaymentStatusChargeData::ToJson(): string
Serialise the charge status data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentStatusDisputeData
A Stripe dispute status update.
Properties
| Name | Type |
|---|---|
$disputeId | ?string |
$disputeStatus | ?string |
$disputeReason | ?string |
$eventId | ?string |
__construct
PaymentProviderStripePaymentStatusDisputeData::__construct(?string $disputeId = null, ?string $disputeStatus = null, ?string $disputeReason = null, ?string $eventId = null)
Construct the dispute status data object from its field values.
FromJson
PaymentProviderStripePaymentStatusDisputeData::FromJson(string $json): self
Build a dispute status data object from its JSON representation.
Returns self The status data object.
ToJson
PaymentProviderStripePaymentStatusDisputeData::ToJson(): string
Serialise the dispute status data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentStatusRefundData
A Stripe refund status update.
Properties
| Name | Type |
|---|---|
$chargeId | ?string |
$refunded | ?bool |
$amountRefunded | ?int |
$eventId | ?string |
__construct
PaymentProviderStripePaymentStatusRefundData::__construct(?string $chargeId = null, ?bool $refunded = null, ?int $amountRefunded = null, ?string $eventId = null)
Construct the refund status data object from its field values.
FromJson
PaymentProviderStripePaymentStatusRefundData::FromJson(string $json): self
Build a refund status data object from its JSON representation.
Returns self The status data object.
ToJson
PaymentProviderStripePaymentStatusRefundData::ToJson(): string
Serialise the refund status data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentStatusRequiresCaptureData
A Stripe payment intent requires-capture status.
Properties
| Name | Type |
|---|---|
$paymentIntentId | string |
$eventId | ?string |
$amountCapturable | ?int |
__construct
PaymentProviderStripePaymentStatusRequiresCaptureData::__construct(string $paymentIntentId = '', ?string $eventId = null, ?int $amountCapturable = null)
Construct the requires-capture status data object from its field values.
FromJson
PaymentProviderStripePaymentStatusRequiresCaptureData::FromJson(string $json): self
Build a requires-capture status data object from its JSON representation.
Returns self The status data object.
ToJson
PaymentProviderStripePaymentStatusRequiresCaptureData::ToJson(): string
Serialise the requires-capture status data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePaymentStatusTransferData
A Stripe transfer status update.
Properties
| Name | Type |
|---|---|
$transferId | ?string |
$transferDestination | ?string |
$transferStatus | ?string |
$transferFailureReason | ?string |
$eventId | ?string |
__construct
PaymentProviderStripePaymentStatusTransferData::__construct(?string $transferId = null, ?string $transferDestination = null, ?string $transferStatus = null, ?string $transferFailureReason = null, ?string $eventId = null)
Construct the transfer status data object from its field values.
FromJson
PaymentProviderStripePaymentStatusTransferData::FromJson(string $json): self
Build a transfer status data object from its JSON representation.
Returns self The status data object.
ToJson
PaymentProviderStripePaymentStatusTransferData::ToJson(): string
Serialise the transfer status data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePurchaseAmountCapturableUpdatedData
A Stripe amount-capturable-updated status.
Properties
| Name | Type |
|---|---|
$paymentIntentId | string |
$eventId | ?string |
$amountCapturable | ?int |
__construct
PaymentProviderStripePurchaseAmountCapturableUpdatedData::__construct(string $paymentIntentId = '', ?string $eventId = null, ?int $amountCapturable = null)
Construct the amount-capturable-updated data object from its field values.
FromJson
PaymentProviderStripePurchaseAmountCapturableUpdatedData::FromJson(string $json): self
Build an amount-capturable-updated data object from its JSON representation.
Returns self The data object.
ToJson
PaymentProviderStripePurchaseAmountCapturableUpdatedData::ToJson(): string
Serialise the amount-capturable-updated data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePurchaseChargeCommand
Command handlers for charge-level, refund and dispute events, invoked by the purchase charge webhook.
ChargeDisputeClosed
PaymentProviderStripePurchaseChargeCommand::ChargeDisputeClosed($event, $dispute, $eventType, $purchase): void
Handle charge.dispute.closed by adding a purchase status record with dispute data.
Returns void
ChargeDisputeCreated
PaymentProviderStripePurchaseChargeCommand::ChargeDisputeCreated($event, $dispute, $eventType, $purchase): void
Handle charge.dispute.created by adding a purchase status record with dispute data.
Returns void
ChargeDisputeUpdated
PaymentProviderStripePurchaseChargeCommand::ChargeDisputeUpdated($event, $dispute, $eventType, $purchase): void
Handle charge.dispute.updated by adding a purchase status record with dispute data.
Returns void
ChargeFailed
PaymentProviderStripePurchaseChargeCommand::ChargeFailed($event, $charge, $eventType, $purchase): void
Handle charge.failed by adding a purchase status record with the failure reason.
Returns void
ChargeRefunded
PaymentProviderStripePurchaseChargeCommand::ChargeRefunded($event, $charge, $eventType, $purchase): void
Handle charge.refunded by adding a purchase status record with refund data, whether full or partial.
Returns void
ChargeRefundUpdated
PaymentProviderStripePurchaseChargeCommand::ChargeRefundUpdated($event, $charge, $eventType, $purchase): void
Handle charge.refund.updated by adding a purchase status record with the refund id and status.
Returns void
ChargeSucceeded
PaymentProviderStripePurchaseChargeCommand::ChargeSucceeded($event, $charge, $eventType, $purchase): void
Handle charge.succeeded by adding a purchase status record with charge success data.
Returns void
ChargeUpdated
PaymentProviderStripePurchaseChargeCommand::ChargeUpdated($event, $charge, $eventType, $purchase): void
Handle charge.updated by adding a purchase status record with the charge status.
Returns void
PaymentProviderStripePurchaseCommand
Command handlers for payment intent completion events, invoked by the purchase webhook.
PaymentIntentCanceled
PaymentProviderStripePurchaseCommand::PaymentIntentCanceled($event, $paymentIntent, $eventType, $purchase): void
Handle payment_intent.canceled by adding a cancelled purchase status.
Returns void
PaymentIntentPaymentFailed
PaymentProviderStripePurchaseCommand::PaymentIntentPaymentFailed($event, $paymentIntent, $eventType, $purchase): void
Handle payment_intent.payment_failed by adding an error purchase status with the failure reason.
Returns void
PaymentIntentSucceeded
PaymentProviderStripePurchaseCommand::PaymentIntentSucceeded($event, $paymentIntent, $eventType, $purchase): void
Handle payment_intent.succeeded by adding a success purchase status with the payment intent id as provider data.
Returns void
PaymentProviderStripePurchaseData
Stripe-specific initial purchase provider data.
Properties
| Name | Type |
|---|---|
$customerId | ?string |
$paymentIntentId | ?string |
__construct
PaymentProviderStripePurchaseData::__construct(?string $customerId = null, ?string $paymentIntentId = null)
Construct the purchase data object from its field values.
FromJson
PaymentProviderStripePurchaseData::FromJson(string $json): self
Build a purchase data object from its JSON representation.
Returns self The purchase data object.
ToJson
PaymentProviderStripePurchaseData::ToJson(): string
Serialise the purchase data object to JSON.
Returns string The JSON representation.
WithPaymentIntentId
PaymentProviderStripePurchaseData::WithPaymentIntentId(?string $paymentIntentId): self
Return a copy of the purchase data with the given payment intent id.
| Name | Type | Description |
|---|---|---|
$paymentIntentId | ?string | The payment intent id, or null. |
Returns self A new purchase data object.
PaymentProviderStripePurchaseDatabase
Database operations for the Stripe purchase provider.
GetPaymentStatus
PaymentProviderStripePurchaseDatabase::GetPaymentStatus(string $paymentSecret): PaymentProviderPaymentStatusEnum
Retrieve and map the Stripe payment status from a client secret to a payment status enum value.
| Name | Type | Description |
|---|---|---|
$paymentSecret | string | The payment intent client secret. |
Returns PaymentProviderPaymentStatusEnum The mapped payment status.
PaymentProviderStripePurchaseEventData
Basic Stripe payment intent event data.
Properties
| Name | Type |
|---|---|
$paymentIntentId | string |
$eventId | ?string |
__construct
PaymentProviderStripePurchaseEventData::__construct(string $paymentIntentId = '', ?string $eventId = null)
Construct the purchase event data object from its field values.
FromJson
PaymentProviderStripePurchaseEventData::FromJson(string $json): self
Build a purchase event data object from its JSON representation.
Returns self The purchase event data object.
ToJson
PaymentProviderStripePurchaseEventData::ToJson(): string
Serialise the purchase event data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePurchasePaymentIntentIdData
A payment intent id stored as provider data in status records.
Properties
| Name | Type |
|---|---|
$paymentIntentId | string |
__construct
PaymentProviderStripePurchasePaymentIntentIdData::__construct(string $paymentIntentId = '')
Construct the payment intent id data object from its field value.
FromJson
PaymentProviderStripePurchasePaymentIntentIdData::FromJson(string $json): self
Build a payment intent id data object from its JSON representation.
Returns self The data object.
ToJson
PaymentProviderStripePurchasePaymentIntentIdData::ToJson(): string
Serialise the payment intent id data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePurchaseRequiresActionData
A Stripe payment intent requires-action event.
Properties
| Name | Type |
|---|---|
$paymentIntentId | string |
$eventId | ?string |
$nextActionJson | ?string |
__construct
PaymentProviderStripePurchaseRequiresActionData::__construct(string $paymentIntentId = '', ?string $eventId = null, ?string $nextActionJson = null)
Construct the requires-action data object from its field values.
FromJson
PaymentProviderStripePurchaseRequiresActionData::FromJson(string $json): self
Build a requires-action data object from its JSON representation.
Returns self The data object.
ToJson
PaymentProviderStripePurchaseRequiresActionData::ToJson(): string
Serialise the requires-action data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePurchaseRequiresCaptureData
A Stripe payment intent requires-capture event.
Properties
| Name | Type |
|---|---|
$paymentIntentId | string |
$eventId | ?string |
$amountCapturable | ?int |
__construct
PaymentProviderStripePurchaseRequiresCaptureData::__construct(string $paymentIntentId = '', ?string $eventId = null, ?int $amountCapturable = null)
Construct the requires-capture data object from its field values.
FromJson
PaymentProviderStripePurchaseRequiresCaptureData::FromJson(string $json): self
Build a requires-capture data object from its JSON representation.
Returns self The data object.
ToJson
PaymentProviderStripePurchaseRequiresCaptureData::ToJson(): string
Serialise the requires-capture data object to JSON.
Returns string The JSON representation.
PaymentProviderStripePurchaseStateCommand
Command handlers for payment intent state-change events, invoked by the purchase state webhook.
PaymentIntentAmountCapturableUpdated
PaymentProviderStripePurchaseStateCommand::PaymentIntentAmountCapturableUpdated($event, $paymentIntent, $eventType): void
Handle payment_intent.amount_capturable_updated by looking up the purchase via client secret then delegating to the with-purchase handler.
Returns void
PaymentIntentAmountCapturableUpdatedWithPurchase
PaymentProviderStripePurchaseStateCommand::PaymentIntentAmountCapturableUpdatedWithPurchase($event, $paymentIntent, $eventType, PaymentPurchaseData $purchase): void
Add a purchase status, keeping the existing status, recording the updated capturable amount.
Returns void
PaymentIntentCreated
PaymentProviderStripePurchaseStateCommand::PaymentIntentCreated($event, $paymentIntent, $eventType): void
Handle payment_intent.created by looking up the purchase via client secret then delegating to the with-purchase handler.
Returns void
PaymentIntentCreatedWithPurchase
PaymentProviderStripePurchaseStateCommand::PaymentIntentCreatedWithPurchase($event, $paymentIntent, $eventType, PaymentPurchaseData $purchase): void
Add a created purchase status storing the payment intent id.
Returns void
PaymentIntentProcessing
PaymentProviderStripePurchaseStateCommand::PaymentIntentProcessing($event, $paymentIntent, $eventType): void
Handle payment_intent.processing by looking up the purchase via client secret then delegating to the with-purchase handler.
Returns void
PaymentIntentProcessingWithPurchase
PaymentProviderStripePurchaseStateCommand::PaymentIntentProcessingWithPurchase($event, $paymentIntent, $eventType, PaymentPurchaseData $purchase): void
Add a pending purchase status while the payment is processing.
Returns void
PaymentIntentRequiresAction
PaymentProviderStripePurchaseStateCommand::PaymentIntentRequiresAction($event, $paymentIntent, $eventType): void
Handle payment_intent.requires_action by looking up the purchase via client secret then delegating to the with-purchase handler.
Returns void
PaymentIntentRequiresActionWithPurchase
PaymentProviderStripePurchaseStateCommand::PaymentIntentRequiresActionWithPurchase($event, $paymentIntent, $eventType, PaymentPurchaseData $purchase): void
Add a pending purchase status storing the next-action data, such as 3D Secure.
Returns void
PaymentIntentRequiresCapture
PaymentProviderStripePurchaseStateCommand::PaymentIntentRequiresCapture($event, $paymentIntent, $eventType): void
Handle payment_intent.requires_capture by looking up the purchase via client secret then delegating to the with-purchase handler.
Returns void
PaymentIntentRequiresCaptureWithPurchase
PaymentProviderStripePurchaseStateCommand::PaymentIntentRequiresCaptureWithPurchase($event, $paymentIntent, $eventType, PaymentPurchaseData $purchase): void
Add a reserved purchase status, authorized and ready for capture, with the capturable amount.
Returns void
PaymentProviderStripePurchaseTransferCommand
Command handlers for Connect transfer events, invoked by the Connect transfer webhook.
TransferCreated
PaymentProviderStripePurchaseTransferCommand::TransferCreated($event, $transfer, $eventType, $purchase): void
Handle transfer.created by adding a purchase status record with created transfer data including the destination.
Returns void
TransferFailed
PaymentProviderStripePurchaseTransferCommand::TransferFailed($event, $transfer, $eventType, $purchase): void
Handle transfer.failed by adding a purchase status record with failed transfer data and the failure reason.
Returns void
TransferPaid
PaymentProviderStripePurchaseTransferCommand::TransferPaid($event, $transfer, $eventType, $purchase): void
Handle transfer.paid by adding a purchase status record with paid transfer data.
Returns void
TransferReversed
PaymentProviderStripePurchaseTransferCommand::TransferReversed($event, $transfer, $eventType, $purchase): void
Handle transfer.reversed by adding a purchase status record with reversed transfer data.
Returns void
TransferUpdated
PaymentProviderStripePurchaseTransferCommand::TransferUpdated($event, $transfer, $eventType, $purchase): void
Handle transfer.updated by adding a purchase status record with transfer data reflecting the current transfer status.
Returns void
PaymentProviderStripePurchaseWebhook
Registers and dispatches the purchase, state, charge and Connect transfer webhooks.
Handle
PaymentProviderStripePurchaseWebhook::Handle($requestMethod, $requestBody, $headers): void
Register the payment intent succeeded, failed and canceled handlers and dispatch the request through the core webhook handler.
| Name | Type | Description |
|---|---|---|
$requestMethod | mixed | The HTTP request method. |
$requestBody | mixed | The raw request body. |
$headers | mixed | The request headers. |
Returns void
HandleCharge
PaymentProviderStripePurchaseWebhook::HandleCharge($requestMethod, $requestBody, $headers): void
Register the charge event handlers (succeeded, failed, refunded, refund updated, dispute created, updated and closed, and updated) and dispatch the request.
| Name | Type | Description |
|---|---|---|
$requestMethod | mixed | The HTTP request method. |
$requestBody | mixed | The raw request body. |
$headers | mixed | The request headers. |
Returns void
HandleConnectTransfer
PaymentProviderStripePurchaseWebhook::HandleConnectTransfer($requestMethod, $requestBody, $headers): void
Register the Connect transfer event handlers (created, paid, failed, reversed and updated) and dispatch the request.
| Name | Type | Description |
|---|---|---|
$requestMethod | mixed | The HTTP request method. |
$requestBody | mixed | The raw request body. |
$headers | mixed | The request headers. |
Returns void
HandleState
PaymentProviderStripePurchaseWebhook::HandleState($requestMethod, $requestBody, $headers): void
Register the payment intent state-change handlers (created, requires action, processing, requires capture and amount capturable updated) and dispatch the request.
| Name | Type | Description |
|---|---|---|
$requestMethod | mixed | The HTTP request method. |
$requestBody | mixed | The raw request body. |
$headers | mixed | The request headers. |
Returns void
PaymentProviderStripeRedirectData
A stored Stripe redirect record.
Properties
| Name | Type |
|---|---|
$id | int |
$memberId | int |
$redirectUrl | string|null |
$type | string |
$createdAt | CalendarDateTimeData |
__construct
PaymentProviderStripeRedirectData::__construct(int $id = 0, int $memberId = 0, string|null $redirectUrl = null, string $type = '', CalendarDateTimeData $createdAt = new CalendarDateTimeData())
Construct the redirect data object from its field values.
FromJson
PaymentProviderStripeRedirectData::FromJson(string $json): self
Build a redirect data object from its JSON representation.
Returns self The redirect data object.
ToJson
PaymentProviderStripeRedirectData::ToJson(): string
Serialise the redirect data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeRedirectDatabase
Reads and writes Stripe onboarding redirect rows with permalinks.
CreateRedirect
PaymentProviderStripeRedirectDatabase::CreateRedirect(int $memberId, string $type, string|null $redirectUrl = null): string
Create a redirect entry and return its permalink string.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member the redirect belongs to. |
$type | string | The redirect type, such as return or refresh. |
$redirectUrl | string|null | The redirect URL, or null. |
Returns string The redirect permalink.
fromRow
PaymentProviderStripeRedirectDatabase::fromRow(stdClass $row): PaymentProviderStripeRedirectData
Construct the redirect data object from a database row.
| Name | Type | Description |
|---|---|---|
$row | stdClass | The raw database row. |
Returns PaymentProviderStripeRedirectData The mapped row.
GetByPermalink
PaymentProviderStripeRedirectDatabase::GetByPermalink(string $permalinkString): PaymentProviderStripeRedirectData
Get redirect data by permalink string.
| Name | Type | Description |
|---|---|---|
$permalinkString | string | The redirect permalink. |
Returns PaymentProviderStripeRedirectData The redirect row.
PaymentProviderStripeSetupIntentDatabase
Reads and writes stored Stripe setup intent rows.
fromRow
PaymentProviderStripeSetupIntentDatabase::fromRow(stdClass $row): PaymentProviderStripeSetupIntentRowData
Construct the setup intent row data object from a database row.
| Name | Type | Description |
|---|---|---|
$row | stdClass | The raw database row. |
Returns PaymentProviderStripeSetupIntentRowData The mapped row.
GetByCustomerId
PaymentProviderStripeSetupIntentDatabase::GetByCustomerId(int $customerId): array
Get setup intents by customer id.
| Name | Type | Description |
|---|---|---|
$customerId | int | The customer row id. |
Returns array The matching setup intent rows.
GetById
PaymentProviderStripeSetupIntentDatabase::GetById(int $id): PaymentProviderStripeSetupIntentRowData
Get a setup intent by primary id.
| Name | Type | Description |
|---|---|---|
$id | int | The setup intent row id. |
Returns PaymentProviderStripeSetupIntentRowData The setup intent row.
GetByIds
PaymentProviderStripeSetupIntentDatabase::GetByIds(array $ids): array
Bulk-fetch setup intents by an array of ids.
| Name | Type | Description |
|---|---|---|
$ids | array | The setup intent row ids. |
Returns array The matching setup intent rows.
GetOptionalByStripeReference
PaymentProviderStripeSetupIntentDatabase::GetOptionalByStripeReference(string $stripeReference): PaymentProviderStripeSetupIntentRowData|null
Get a setup intent by Stripe reference, or null when there is no match.
| Name | Type | Description |
|---|---|---|
$stripeReference | string | The Stripe setup intent reference. |
Returns PaymentProviderStripeSetupIntentRowData|null The setup intent row, or null.
Upsert
PaymentProviderStripeSetupIntentDatabase::Upsert(string $stripeReference, int|null $customerId = null, int|null $paymentMethodId = null, string $status = '', string|null $clientSecret = null, string|null $cancellationReason = null, string|null $description = null, string|null $metadata = null, string|null $usage = null): int
Create or update a setup intent record and return its id.
Returns int The setup intent row id.
PaymentProviderStripeSetupIntentRowData
A database row for a stored Stripe SetupIntent.
Properties
| Name | Type |
|---|---|
$id | int |
$stripeReference | string |
$customerId | int|null |
$paymentMethodId | int|null |
$status | string |
$clientSecret | string|null |
$cancellationReason | string|null |
$description | string|null |
$metadata | string|null |
$usage | string|null |
$createdAt | CalendarDateTimeData |
$lastSyncedAt | CalendarDateTimeData|null |
__construct
PaymentProviderStripeSetupIntentRowData::__construct(int $id = 0, string $stripeReference = '', int|null $customerId = null, int|null $paymentMethodId = null, string $status = '', string|null $clientSecret = null, string|null $cancellationReason = null, string|null $description = null, string|null $metadata = null, string|null $usage = null, CalendarDateTimeData $createdAt = new CalendarDateTimeData(), CalendarDateTimeData|null $lastSyncedAt = null)
Construct the setup intent row data object from its field values.
FromJson
PaymentProviderStripeSetupIntentRowData::FromJson(string $json): self
Build a setup intent row data object from its JSON representation.
Returns self The setup intent row data object.
ToJson
PaymentProviderStripeSetupIntentRowData::ToJson(): string
Serialise the setup intent row data object to JSON.
Returns string The JSON representation.
PaymentProviderStripeWebhook
The core Stripe webhook handler and command registry. Registers command handlers keyed by Stripe event type and dispatches an incoming webhook to the matching handler after verifying its signature.
Command
PaymentProviderStripeWebhook::Command(string $commandName, callable $handler): void
Register a command handler keyed by Stripe event type into the static command registry.
| Name | Type | Description |
|---|---|---|
$commandName | string | The Stripe event type to handle. |
$handler | callable | The handler invoked for the event. |
Returns void
Handle
PaymentProviderStripeWebhook::Handle(string $requestMethod, string $requestBody, array $headers, string $webhookSecret, string $logIdentifier, callable $commandsCallback, ?callable $objectExtractor = null, ?callable $objectValidator = null, ?string $fromJsonFunction = null): void
Reset the registry, validate the POST, normalise headers, verify the Stripe signature, decode the JSON, invoke the commands callback to register handlers, extract and validate the event object, and route to the matching handler, writing HTTP responses.
| Name | Type | Description |
|---|---|---|
$requestMethod | string | The HTTP request method. |
$requestBody | string | The raw request body. |
$headers | array | The request headers. |
$webhookSecret | string | The Stripe webhook signing secret. |
$logIdentifier | string | An identifier used in log entries. |
$commandsCallback | callable | A callback that registers the event handlers. |
$objectExtractor | ?callable | A deprecated extractor for the event object, or null. |
$objectValidator | ?callable | A deprecated validator for the event object, or null. |
$fromJsonFunction | ?string | A callable name that parses the event JSON, or null. |
Returns void