Handler
extends SecuredServerPlugin
in package
Implement PayOne handler
This class provides interfaces for PayOne interactions
This class implements a cli command to update external product ids if needed ./install.sh cli payone-update-pid basket-1 2020-07-02 ./install.sh cli payone-reverse-cancel basket-1 ./install.sh cli payone-unlock basket-1
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 : BsPayOne|null
- The PayOne handler
- $req : Request|null
- $settings : stdClass|null
- The settings of the plugin
- __construct() : mixed
- Handler constructor.
- BasketChangeStatus() : mixed
- Called on basket status change, reaction is needed on cancel
- GetAccessList() : array<string|int, mixed>
- Handler() : BsPayOne
- Get handler instance
- Name() : string
- OnAddOrUpdateContent() : void
- Called on save an object
- OnBeforeGetEntityAttributes() : void
- Called in the attributes resolver
- OnBeforeMarkSubscriptionForSwitch() : void
- OnCheckBasketTransitions() : void
- Process potentially automatic changes on baskets
- OnCommandLineInterfaceCall() : void
- Provides interface to manage baskets in payone and perform some checks against these baskets transaction state
- OnDeleteContent() : void
- React on basket delete
- OnGetEntityAttributes() : void
- Add input field to core object
- OnMapArrayIncludes() : void
- Add some scripts to the backend to interact with system frontend hooks
- OnRegisterWidgetIncludes() : void
- 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() : void
- Provide deep link access to js template files
- RequestOnUrlParsed() : mixed
- ServeRequest() : void
- Serve request
- 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
- basketDocument() : mixed
- Get a single document
- checkTransactions() : Result
- Check if transaction is old
- getActiveCardTypes() : mixed
- Get the list ofd active card types for account or shop setup
- getUserInfo() : mixed
- Get payone user information
- handleBasketSession() : mixed
- Core method to handle redirect and regular calls
- handleBasketTransaction() : mixed
- handleConfigPreset() : mixed
- Handle the context requests
- isAccountPortal() : bool
- Is a call to an account portal
- isShopPortal() : bool
- Is a call to a shop portal
- listBasketDocuments() : mixed
- Get list of basket documents
- onRedirectedSessionStatus() : mixed
- On redirected request from live system
- onRedirectedTransaction() : void
- Handle transaction operation, inbound interface method
- onReturn() : mixed
- On return handler
- onSessionStatus() : void
- On callback to session status
- onTransaction() : void
- registerAccountPayment() : Result
- React on payment receive
- sendWarning() : mixed
- Send an email including the given parameters to admin
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
The PayOne handler
private
BsPayOne|null
$handler
= null
?BsPayOne
$req
private
Request|null
$req
= null
?Request A system request instance
$settings
The settings of the plugin
private
stdClass|null
$settings
= null
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() : BsPayOne
Return values
BsPayOne —Name()
public
Name() : string
Return values
string —OnAddOrUpdateContent()
Called on save an object
public
OnAddOrUpdateContent(HookArgument $param) : void
Update the user data in payone on users modification
Parameters
- $param : HookArgument
-
A hook argument with user and result
Return values
void —OnBeforeGetEntityAttributes()
Called in the attributes resolver
public
OnBeforeGetEntityAttributes(HookArgument $param) : void
Used to add some additional fields to the users basket
Parameters
- $param : HookArgument
Return values
void —OnBeforeMarkSubscriptionForSwitch()
public
OnBeforeMarkSubscriptionForSwitch(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —OnCheckBasketTransitions()
Process potentially automatic changes on baskets
public
OnCheckBasketTransitions(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —OnCommandLineInterfaceCall()
Provides interface to manage baskets in payone and perform some checks against these baskets transaction state
public
OnCommandLineInterfaceCall(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —OnDeleteContent()
React on basket delete
public
OnDeleteContent( $param) : void
Parameters
Return values
void —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) : void
Parameters
Return values
void —OnRegisterWidgetIncludes()
Add custom scripts to certain widgets when present
public
OnRegisterWidgetIncludes( $param) : void
Parameters
Return values
void —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) : void
Parameters
- $reference : HookArgument
Return values
void —RequestOnUrlParsed()
public
RequestOnUrlParsed(HookArgument $param) : mixed
Parameters
- $param : HookArgument
Return values
mixed —ServeRequest()
Serve request
public
ServeRequest(Request $request, Response $response) : void
Serve the request and patch the result on the given response
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 —basketDocument()
Get a single document
private
basketDocument(string $id, Response $res) : mixed
Parameters
- $id : string
- $res : Response
Return values
mixed —checkTransactions()
Check if transaction is old
private
checkTransactions(Basket|null $basket) : Result
Parameters
- $basket : Basket|null
Return values
Result —getActiveCardTypes()
Get the list ofd active card types for account or shop setup
private
getActiveCardTypes(Request $request, Response $response) : mixed
Parameters
Return values
mixed —getUserInfo()
Get payone user information
private
getUserInfo(User $user, Response $res) : mixed
Parameters
Return values
mixed —handleBasketSession()
Core method to handle redirect and regular calls
private
handleBasketSession(Response $response, Basket|null $basket, array<string|int, mixed> $params) : mixed
Parameters
- $response : Response
- $basket : Basket|null
- $params : array<string|int, mixed>
Return values
mixed —handleBasketTransaction()
private
handleBasketTransaction(Response $response, Basket $basket, array<string|int, mixed> $data) : mixed
Parameters
- $response : Response
- $basket : Basket
- $data : array<string|int, mixed>
Return values
mixed —handleConfigPreset()
Handle the context requests
private
handleConfigPreset(Request $request, Response $response) : mixed
Parameters
Return values
mixed —isAccountPortal()
Is a call to an account portal
private
isAccountPortal(string $id, string $key) : bool
Parameters
- $id : string
-
The target id
- $key : string
-
The signed key
Return values
bool —isShopPortal()
Is a call to a shop portal
private
isShopPortal(string $id, string $key) : bool
Parameters
- $id : string
-
The target id
- $key : string
-
The signed key
Return values
bool —listBasketDocuments()
Get list of basket documents
private
listBasketDocuments(Request $request, Response $res) : mixed
Parameters
Return values
mixed —onRedirectedSessionStatus()
On redirected request from live system
private
onRedirectedSessionStatus(Request $request, Response $response) : mixed
Parameters
Return values
mixed —onRedirectedTransaction()
Handle transaction operation, inbound interface method
private
onRedirectedTransaction(Request $request, Response $response) : void
Parameters
Return values
void —onReturn()
On return handler
private
onReturn(string $status, string $reference, Response $response) : mixed
Called either on call from 3d-secure iframe end or, when paypal was used. Will be used to process the second step of the transaction
Parameters
- $status : string
-
The status from the url, can be return, success or, error
- $reference : string
-
Unique basket reference
- $response : Response
Return values
mixed —onSessionStatus()
On callback to session status
private
onSessionStatus(Response $response) : void
Parameters
- $response : Response
Return values
void —onTransaction()
private
onTransaction(Response $response) : void
Parameters
- $response : Response
Return values
void —registerAccountPayment()
React on payment receive
private
registerAccountPayment(Basket $basket, string|null $transaction_id) : Result
Parameters
- $basket : Basket
-
The basket context
- $transaction_id : string|null
-
The payone transaction id
Return values
Result —sendWarning()
Send an email including the given parameters to admin
private
sendWarning(string $message) : mixed
Parameters
- $message : string