check

Start recurring payment (initRP, startRP)

PHP SDK

$config = new \BigFish\PaymentGateway\Config();

$config->storeName = $data['storeName'];
$config->apiKey = $data['apiKey'];
$config->testMode = true; // Set to false in production environment

\BigFish\PaymentGateway::setConfig($config);

$initRPRequest = new \BigFish\PaymentGateway\Request\InitRP();

$initRPRequest
->setReferenceTransactionId($data['referenceTransactionId'])
->setResponseUrl($data['responseUrl'])
->setAmount($data['amount'])
->setCurrency($data['currency'])
->setOrderId($data['orderId'])
->setUserId($data['userId'])

$initRPResponse = \BigFish\PaymentGateway::initRP($initRPRequest);

if ($initRPResponse->ResultCode == "SUCCESSFUL" && $initRPResponse->TransactionId) {
/**
 * Save TransactionId into database before call start().
 */

$startRPResponse = \BigFish\PaymentGateway::startRP(
new \BigFish\PaymentGateway\Request\StartRP($initRPResponse->TransactionId)
);
}

REST API


Test URL: https://test.paymentgateway.hu/api/rest/

Production URL: https://www.paymentgateway.hu/api/rest/


HTTP Basic Authentication:

Send base64 encoded StoreName and ApiKey in HTTP Header.

Example:

Authorization: Basic c2RrX3Rlc3Q6ODZhZjMtODBlNGYtZjgyMjgtOTQ5OGYtOTEwYWQ=

Where the c2RrX3Rlc3Q6ODZhZjMtODBlNGYtZjgyMjgtOTQ5OGYtOTEwYWQ= string equal in PHP:

base64_encode("sdk_test:86af3-80e4f-f8228-9498f-910ad");


Init recurring payment:

Required data (HTTP POST):

method = InitRP
json = {json encoded variables}

Parameters (* if necessary):

StoreName*
ReferenceTransactionId*
ResponseUrl*
Amount
Currency
OrderId
UserId
ModuleName
ModuleVersion

Example:

method=InitRP&json={"StoreName":"sdk_test","ReferenceTransactionId":"[One Click Payment registered transaction ID]","ResponseUrl":""http:\/\/demo.paymentgateway.hu\/response.php"","Amount":"100","Currency":"HUF","OrderId":"DEMO_ORDER","UserId":"DEMO_USER"}

Response data (JSON format):

TransactionId
ResultCode
ResultMessage


Start recurring transaction:

Required data (HTTP POST):

method = StartRP
json = {json encoded variables}

Parameters (* if necessary):

TransactionId*

Example:

method=StartRP&json={"TransactionId":"[TransactionId received by InitRP]"}

Response data (JSON format):

TransactionId
ResultCode
ResultMessage
Anum
OrderId
UserId
ProviderTransactionId
AutoCommit
CommitState