Properties

Methods

toJson()

toJson(integer  $options) : string

Returns a json representation of itself.

Parameters

integer $options

Returns

string

toArray()

toArray(boolean  $doSort = false) : array

Returns an array that represents the object instance.

Uses uppercase keys to be compatible with the heidelpay POST Payment API.

Parameters

boolean $doSort

sort the keys in alphabetical order

Returns

array

jsonSerialize()

jsonSerialize() 

fromJson()

fromJson(string  $json) : \Heidelpay\PhpPaymentApi\AbstractMethod

Takes a JSON representation of an instance and returns a PHP object instance representation of it.

Parameters

string $json

Returns

\Heidelpay\PhpPaymentApi\AbstractMethod

fromPost()

fromPost(array  $post) : \Heidelpay\PhpPaymentApi\AbstractMethod

Takes an array, e.g. a POST response and returns a PHP object instance representation of it.

Parameters

array $post

Returns

\Heidelpay\PhpPaymentApi\AbstractMethod

__construct()

__construct() 

Constructor will generate all necessary sub objects

authentification()

authentification(string  $securitySender = null, string  $userLogin = null, string  $userPassword = null, string  $transactionChannel = null, boolean  $sandboxRequest = false) : \Heidelpay\PhpPaymentApi\Request

Set all necessary authentication parameters for this request

Parameters

string $securitySender

security sender parameter, e.g. 31HA07BC8142C5A171745D00AD63D182

string $userLogin

user login parameter, e.g. 31ha07bc8142c5a171744e5aef11ffd3

string $userPassword

user password, e.g. 93167DE7

string $transactionChannel

channel id of the payment method, e.g. 31HA07BC8142C5A171744F3D6D155865

boolean $sandboxRequest

choose between sandbox and productive payment system

Returns

\Heidelpay\PhpPaymentApi\Request

async()

async(string  $languageCode = 'EN', string  $responseUrl = null) : \Heidelpay\PhpPaymentApi\Request

Set all necessary parameter for a asynchronous request

Parameters

string $languageCode

language code 2 letters for error messages and iframe, e.g. EN

string $responseUrl

response url of your application, e.g. https://www.url.com/response.php

Returns

\Heidelpay\PhpPaymentApi\Request

customerAddress()

customerAddress(string  $nameGiven = null, string  $nameFamily = null, string  $nameCompany = null, string  $shopperId = null, string  $addressStreet = null, string  $addressState = null, string  $addressZip = null, string  $addressCity = null, string  $addressCountry = null, string  $contactMail = null) : \Heidelpay\PhpPaymentApi\Request

Set all necessary customer parameter for a request

Parameters

string $nameGiven

customer given name, e.g. John

string $nameFamily

customer family name, e.g. Doe

string $nameCompany

company name, e.g. Heidelpay

string $shopperId

customer id in your application, e.g. 1249

string $addressStreet

address street of the customer, e.g. Vagerowstr.

string $addressState

address state ot the customer, e.g. Bayern

string $addressZip

address zip code, e.g. 69115

string $addressCity

address city, e.g. Heidelberg

string $addressCountry

address country code 2 letters, e.g. DE

string $contactMail

email adress of the customer, e.g. ab@mail.de

Returns

\Heidelpay\PhpPaymentApi\Request

basketData()

basketData(string  $shopIdentifier = null, string  $amount = null, string  $currency = null, string  $secret = null) : \Heidelpay\PhpPaymentApi\Request

Set all basket or order information

Parameters

string $shopIdentifier

id of your application, e.g. order-125454

string $amount

amount of the current basket, e.g. 20.12

string $currency

currency code 3 letters, e.g. USD

string $secret

a secret to prevent your application against fake responses

Returns

\Heidelpay\PhpPaymentApi\Request

convertToArray()

convertToArray() : array

Convert request object to post key value format

Returns

array —

request

send()

send(string  $uri = null, array  $post = null, \Heidelpay\PhpPaymentApi\Adapter\HttpAdapterInterface|null  $adapter = null) : array

Send request to payment api

Parameters

string $uri

payment api url

array $post

heidelpay request parameter

\Heidelpay\PhpPaymentApi\Adapter\HttpAdapterInterface|null $adapter

Returns

array —

response|\Heidelpay\PhpPaymentApi\Response

b2cSecured()

b2cSecured(string  $salutation = null, string  $birthdate = null, string  $basketId = null) : \Heidelpay\PhpPaymentApi\Request

Parameter used in case of b2c secured invoice or direct debit

Parameters

string $salutation

customer salutation MR/MRS (Mandatory)

string $birthdate

customer birth date YYYY-MM-DD (Mandatory)

string $basketId

id of a given basket using heidelpay basket api (Optional)

Returns

\Heidelpay\PhpPaymentApi\Request

mapFromJson()

mapFromJson(string  $json) 

Maps a JSON string into single ParameterGroup instances.

Parameters

string $json

Throws

\Heidelpay\PhpPaymentApi\Exceptions\JsonParserException

mapFromPost()

mapFromPost(array  $post) 

Maps a POST array into single ParameterGroup instances.

Parameters

array $post