Handler
extends SecuredServerPlugin
in package
Implement PayPal handler This class provides interfaces for PayPal interactions
Tags
Table of Contents
- $config : stdClass|null
- Buffer for configuration
- $defaultPermissions : array<string|int, mixed>
- The default permission set
- $dir : string
- The implementation directory
- $name : string
- Name of the plugin
- $handler : Braintree|null
- $req : Request|null
- Store request
- __construct() : mixed
- Handler constructor.
- BasketChangeStatus() : mixed
- Called on basket status change, reaction is needed on cancel
- GetAccessList() : array<string|int, mixed>
- Handler() : Braintree|null
- Get handler instance
- Name() : string
- OnAddOrUpdateContent() : mixed
- Called on save an object
- OnBeforeGetEntityAttributes() : mixed
- Called in the attributes resolver
- OnBeforeMarkSubscriptionForSwitch() : void
- OnDeleteContent() : mixed
- React on basket delete
- OnGetEntityAttributes() : void
- Add input field to core object
- OnMapArrayIncludes() : mixed
- Add some scripts to the backend to interact with system frontend hooks
- OnRegisterWidgetIncludes() : mixed
- Add custom scripts to certain widgets when present
- OnSubscriptionChangePaymentMethod() : void
- OnSubscriptionSwitch() : void
- Handle a subscription model change operation
- RegisterHooks() : array<string|int, mixed>
- Register system hooks Register a set of handler functions to be called in certain positions.
- RegisterPublicAssetBasePath() : mixed
- Provide deep link access to js template files
- RequestOnUrlParsed() : mixed
- On request by http
- ServeRequest() : void
- Serve request Serve the request and return appropriate result.
- settings() : Result|object
- Get/Set the settings
- SetupTemplate() : mixed
- handleConfig() : void
- Handle the context requests
- hasAccess() : bool
- Check if endpoint is accessible for this user group
- isInContext() : bool
- Is in certain context?
- setupAttributes() : void
- Set up the permission attribute table
- basePath() : string|null
- Resolve the stripe dashboard base path
- handleClassicClientToken() : void
- Classic token for paypal direct integration
- handleClientToken() : void
- handleConfigPreset() : mixed
- Handle the context requests
- handleHookSubscription() : void
- The subscription was either paid or failed to be paid
- handleHookTransaction() : mixed
- handlePaymentMethods() : void
- handleRegisterCustomer() : mixed
- mapPaymentMethods() : void
- Map the found payment methods to our structures signature
- request() : Request|null
- Get request Get the stored request object of the http call.
Properties
$config
Buffer for configuration
protected
stdClass|null
$config
= null
$defaultPermissions
The default permission set
protected
array<string|int, mixed>
$defaultPermissions
= [['endpoint' => 'config', 'root' => true, 'admin' => true]]
$dir
The implementation directory
protected
string
$dir
= ''
$name
Name of the plugin
protected
string
$name
= ''
$handler
private
Braintree|null
$handler
= null
$req
Store request
private
Request|null
$req
= null
Holds the request object instance
A system request instance
Methods
__construct()
Handler constructor.
public
__construct() : mixed
Return values
mixed —BasketChangeStatus()
Called on basket status change, reaction is needed on cancel
public
BasketChangeStatus( $req) : mixed
Parameters
Return values
mixed —GetAccessList()
public
GetAccessList(User $user) : array<string|int, mixed>
Parameters
- $user : User
Return values
array<string|int, mixed> —Handler()
Get handler instance
public
Handler() : Braintree|null
Return values
Braintree|null —Name()
public
Name() : string
Return values
string —OnAddOrUpdateContent()
Called on save an object
public
OnAddOrUpdateContent(HookArgument $param) : mixed
Update the user data in stripe on users modification
Parameters
- $param : HookArgument
-
A hook argument with user and result
Return values
mixed —OnBeforeGetEntityAttributes()
Called in the attributes resolver
public
OnBeforeGetEntityAttributes(HookArgument $param) : mixed
Used to add some additional fields to the users basket
Parameters
- $param : HookArgument
Return values
mixed —OnBeforeMarkSubscriptionForSwitch()
public
OnBeforeMarkSubscriptionForSwitch(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —OnDeleteContent()
React on basket delete
public
OnDeleteContent( $param) : mixed
Parameters
Return values
mixed —OnGetEntityAttributes()
Add input field to core object
public
OnGetEntityAttributes(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnMapArrayIncludes()
Add some scripts to the backend to interact with system frontend hooks
public
OnMapArrayIncludes( $param) : mixed
Parameters
Return values
mixed —OnRegisterWidgetIncludes()
Add custom scripts to certain widgets when present
public
OnRegisterWidgetIncludes( $param) : mixed
Parameters
Return values
mixed —OnSubscriptionChangePaymentMethod()
public
OnSubscriptionChangePaymentMethod(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —OnSubscriptionSwitch()
Handle a subscription model change operation
public
OnSubscriptionSwitch(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —RegisterHooks()
Register system hooks Register a set of handler functions to be called in certain positions.
public
RegisterHooks() : array<string|int, mixed>
Return values
array<string|int, mixed> —A list of hooks to register
RegisterPublicAssetBasePath()
Provide deep link access to js template files
public
RegisterPublicAssetBasePath(HookArgument $reference) : mixed
Parameters
- $reference : HookArgument
Return values
mixed —RequestOnUrlParsed()
On request by http
public
RequestOnUrlParsed(HookArgument $param) : mixed
Parameters
- $param : HookArgument
Return values
mixed —ServeRequest()
Serve request Serve the request and return appropriate result.
public
ServeRequest(Request $request, Response $response) : void
Parameters
Return values
void —settings()
Get/Set the settings
public
settings([null|object $new = null ]) : Result|object
This method is cached per instance
Parameters
- $new : null|object = null
-
New set of settings to store
Return values
Result|object —SetupTemplate()
public
SetupTemplate([mixed $data = null ]) : mixed
Parameters
- $data : mixed = null
Tags
Return values
mixed —handleConfig()
Handle the context requests
protected
handleConfig(Request &$request, Response &$response) : void
Parameters
Return values
void —hasAccess()
Check if endpoint is accessible for this user group
protected
hasAccess(string|array<string|int, string> $right[, Response|null $response = null ][, User|null $user = null ]) : bool
Parameters
Return values
bool —isInContext()
Is in certain context?
protected
isInContext(HookArgument $param, string $type, string $widget) : bool
Parameters
- $param : HookArgument
-
The hook argument
- $type : string
-
The type can be scss, css and js to search in widgets or _ to search in global includes
- $widget : string
-
The widget to search for
Return values
bool —setupAttributes()
Set up the permission attribute table
protected
setupAttributes( &$attributes, $l) : void
Parameters
Return values
void —basePath()
Resolve the stripe dashboard base path
private
basePath([string|null $mode = null ]) : string|null
Parameters
- $mode : string|null = null
-
Either test or live, when not set we use the configured default
Return values
string|null —The base path with domain and protocol
handleClassicClientToken()
Classic token for paypal direct integration
private
handleClassicClientToken(string $id, Response $resp) : void
Parameters
- $id : string
- $resp : Response
Return values
void —handleClientToken()
private
handleClientToken(string|null $id, Response $resp) : void
Parameters
- $id : string|null
- $resp : Response
Return values
void —handleConfigPreset()
Handle the context requests
private
handleConfigPreset(Request $request, Response $response) : mixed
Parameters
Return values
mixed —handleHookSubscription()
The subscription was either paid or failed to be paid
private
handleHookSubscription(Subscription $subscription, bool $paid) : void
Parameters
- $subscription : Subscription
- $paid : bool
Return values
void —handleHookTransaction()
private
handleHookTransaction(Transaction $transaction, bool $settled) : mixed
Parameters
- $transaction : Transaction
- $settled : bool
Return values
mixed —handlePaymentMethods()
private
handlePaymentMethods(string|null $id, Response $resp) : void
Parameters
- $id : string|null
- $resp : Response
Return values
void —handleRegisterCustomer()
private
handleRegisterCustomer(string $id, Response $response) : mixed
Parameters
- $id : string
- $response : Response
Return values
mixed —mapPaymentMethods()
Map the found payment methods to our structures signature
private
mapPaymentMethods(Result $res, Response $resp, int|string $echo) : void
Parameters
- $res : Result
-
The fetch result
- $resp : Response
-
The response to write to
- $echo : int|string
-
The data tables echo param
Return values
void —request()
Get request Get the stored request object of the http call.
private
request() : Request|null
Return values
Request|null —The request object