Skip to main content

Accounts


Accounts

  • Full name: \kennethormandy\marketplace\services\Accounts
  • Parent class: Component

Constants

ConstantVisibilityTypeValue
EVENT_BEFORE_ACCOUNT_ACCESSpublic'beforeAccountAccess'
EVENT_AFTER_ACCOUNT_ACCESSpublic'afterAccountAccess'

Methods

init

public init(): void

public createLoginLink(mixed $elementRef = null, mixed $params = ['redirect' => null, 'referrer' => null]): null|\Stripe\LoginLink

Parameters:

ParameterTypeDescription
$elementRefmixedAn element or element UID that could be used as an account, falling back to the current user.
$paramsmixedParameters to pass along to the gateway, namely redirect and referrer.

Return Value:

A Stripe login link

See Also:


public createAccountLink(mixed $elementRef = null, mixed $params = ['redirect' => null, 'referrer' => null]): null|\Stripe\AccountLink

Parameters:

ParameterTypeDescription
$elementRefmixedAn element or element UID that could be used as an account, falling back to the current user.
$paramsmixedParameters 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:

ParameterTypeDescription
$elementRefmixedAn element or element UID that could be used as an account, falling back to the current user.
$paramsmixedParameters 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:

ParameterTypeDescription
$elementRefmixed- An element or element UID that could be used as an account, falling back to the current user.
$fallbackToCurrentUsermixed- 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:

ParameterTypeDescription
$elementRefmixed- An element or element UID that could be used as an account, falling back to the current user.


Automatically generated on 2024-11-04