\Dalenys_Api_FormClient

Implements Dalenys payment API

Summary

Methods
Properties
Constants
__construct()
setCredentials()
setVersion()
buildAuthorizationFormButton()
buildPaymentFormButton()
hash()
checkHash()
No public properties found
No constants found
buildProcessButton()
getVersion()
$version
$identifier
$password
$renderer
$hash
N/A
No private methods found
No private properties found
N/A

Properties

$version

$version : 

API version

Type

$identifier

$identifier : string

Type

string — Dalenys identifier

$password

$password : string

Type

string — Dalenys password

Methods

__construct()

__construct(string  $identifier, string  $password, \Dalenys_Api_Renderer_Renderable  $renderer, \Dalenys_Api_Hash_Hashable  $hash) 

Instanciate

Parameters

string $identifier

The Dalenys identifier

string $password

The Dalenys password

\Dalenys_Api_Renderer_Renderable $renderer

How to render the form

\Dalenys_Api_Hash_Hashable $hash

setCredentials()

setCredentials(string  $identifier, string  $password) 

Configure credentials

Parameters

string $identifier
string $password

setVersion()

setVersion(string  $version) 

Set default Dalenys VERSION parameter

Parameters

string $version

The VERSION number (ex: 3.0)

buildAuthorizationFormButton()

buildAuthorizationFormButton(integer|array  $amount, string  $orderId, string  $clientIdentifier, string  $description, array  $htmlOptions = array(), array  $options = array()) : string

Build authorization form and submit button

Return the authorization form and all hidden input configuring the dalenys transaction.

Parameters

integer|array $amount

The transaction amount in cents. If $amount is an array it will be used as NTime transaction (fragmented payment).

In this case, the array should be formatted this way:

$amounts = array('2014-01-01' => 100, '2014-02-01' => 200, '2014-03-01' => 100)

The first entry's date should be the current date (today)

string $orderId

The orderid (should be unique by transaction, but no unicity check are performed)

string $clientIdentifier

The client identifier

string $description

The transaction description

array $htmlOptions

An array of HTML attributes to add to the submit or form button (allowing to change name, style, class attribute etc.). Example:

$htmlOptions['SUBMIT'] = array('class' => 'my_class');
$htmlOptions['FORM'] = array('class' => 'my_form', 'target' => 'my_target');
array $options

Others dalenys options. See Dalenys documentation for more information (3DS, CREATEALIAS, etc.)

Returns

string —

The HTML output to display

buildPaymentFormButton()

buildPaymentFormButton(integer|array  $amount, string  $orderId, string  $clientIdentifier, string  $description, array  $htmlOptions = array(), array  $options = array()) : string

Build payment form and submit button

Return the payment form and all hidden input configuring the dalenys transaction.

Parameters

integer|array $amount

The transaction amount in cents. If $amount is an array it will be used as NTime transaction (fragmented payment).

In this case, the array should be formatted this way:

$amounts = array('2014-01-01' => 100, '2014-02-01' => 200, '2014-03-01' => 100)

The first entry's date should be the current date (today)

string $orderId

The orderid (should be unique by transaction, but no unicity check are performed)

string $clientIdentifier

The client identifier

string $description

The transaction description

array $htmlOptions

An array of HTML attributes to add to the submit or form button (allowing to change name, style, class attribute etc.). Example:

$htmlOptions['SUBMIT'] = array('class' => 'my_class');
$htmlOptions['FORM'] = array('class' => 'my_form', 'target' => 'my_target');
array $options

Others dalenys options. See Dalenys documentation for more information (3DS, CREATEALIAS, etc.)

Returns

string —

The HTML output to display

hash()

hash(array  $params = array()) : string

Compute form hash

Parameters

array $params

Returns

string

checkHash()

checkHash(array  $params) : boolean

Check a hash received in a notification/redirection URL

Parameters

array $params

The POST or GET variable to verify

Returns

boolean

buildProcessButton()

buildProcessButton(string  $operationType, string  $orderId, string  $clientIdentifier, string  $description, array  $htmlOptions = array(), array  $options = array()) : string

Return process button html

Parameters

string $operationType
string $orderId
string $clientIdentifier
string $description
array $htmlOptions
array $options

Returns

string

getVersion()

getVersion(array  $options = array()) : string

Get Dalenys API VERSION

Parameters

array $options

Returns

string —

The version number