Accounts
Accounts
- Full name:
\kennethormandy\marketplace\services\Accounts
- Parent class:
Component
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
EVENT_BEFORE_ACCOUNT_ACCESS | public | 'beforeAccountAccess' | |
EVENT_AFTER_ACCOUNT_ACCESS | public | 'afterAccountAccess' |
Methods
init
public init(): void
createLoginLink
public createLoginLink(mixed $elementRef = null, mixed $params = ['redirect' => null, 'referrer' => null]): null|\Stripe\LoginLink
Parameters:
Parameter | Type | Description |
---|---|---|
$elementRef | mixed | An element or element UID that could be used as an account, falling back to the current user. |
$params | mixed | Parameters to pass along to the gateway, namely redirect and referrer . |
Return Value:
A Stripe login link
See Also:
- https://docs.stripe.com/api/accounts/login_link/create - Stripe documentation
createAccountLink
public createAccountLink(mixed $elementRef = null, mixed $params = ['redirect' => null, 'referrer' => null]): null|\Stripe\AccountLink
Parameters:
Parameter | Type | Description |
---|---|---|
$elementRef | mixed | An element or element UID that could be used as an account, falling back to the current user. |
$params | mixed | Parameters to pass along to the gateway, namely redirect and referrer . |
Return Value:
A Stripe account link
See Also:
createAccount
public createAccount(mixed $elementRef = null, mixed $params = []): null|\Stripe\AccountLink
Parameters:
Parameter | Type | Description |
---|---|---|
$elementRef | mixed | An element or element UID that could be used as an account, falling back to the current user. |
$params | mixed | Parameters to pass along to the gateway, namely redirect and referrer . |
Return Value:
A Stripe account link
getAccount
Get an element with a MarketplaceConnectButton field, which holds the gateway account ID.
public getAccount(mixed $elementRef, mixed $fallbackToCurrentUser = true): \craft\base\Element
Parameters:
Parameter | Type | Description |
---|---|---|
$elementRef | mixed | - An element or element UID that could be used as an account, falling back to the current user. |
$fallbackToCurrentUser | mixed | - Whether or not the current user should be returned when no valid account is found. Defaults to true . |
Return Value:
- An element with an account ID on the field, if valid (ie. it exists, and has the field with a value).
isConnected
Determine whether or not an element is connected to the gateway (ie. Stripe).
public isConnected(mixed $elementRef): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$elementRef | mixed | - An element or element UID that could be used as an account, falling back to the current user. |
Automatically generated on 2024-11-04