check

Create payment link (paymentLinkCreate)

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);

$paymentLinkCreateRequest = new \BigFish\PaymentGateway\Request\PaymentLinkCreate();

$paymentLinkCreateRequest
->setProviderName('')
->setAmount($data['amount'])
->setCurrency($data['currency'])
->setOrderId($data['orderId'])
->setUserId($data['userId'])
->setLanguage($data['language'])
->setExpirationTime($data['expirationTime'])
->setNotificationEmail($data['notificationEmail'])
->setEmailNotificationOnlySuccess($data['emailNotificationOnlySuccess']);

/**
 * If you want to start 2-step payment
 */

$paymentLinkCreateRequest->setAutoCommit(false);

/**
 * MKB SZÉP Cafeteria IDs:
 *
 * accommodation => 1111
 * hospitality => 2222
 * leisure => 3333
 */

$data['extra']['MkbSzepCafeteriaId'] = $data['szepPocketId'];

/**
 * KHB SZÉP Pocket IDs:
 *
 * accommodation => 1
 * hospitality => 2
 * leisure => 3
 */

$data['extra']['KhbCardPocketId'] = $data['szepPocketId'];

if (isset($data['szepPocketId']) && !empty($data['szepPocketId'])) {
/**
 * OTP SZÉP Pocket IDs:
 *
 * accommodation => 09
 * hospitality => 07
 * leisure => 08
 */

$data['extra']['OtpCardPocketId'] = $data['szepPocketId'];
}

/**
 * Send custom data if you want
 */

$data['extra'] = array(
'ORDER_PNAME' => 'Product name',
'ORDER_PCODE' => 'Product unique id',
'ORDER_PINFO' => Product description'',
'BILL_FNAME' => 'Customer first name',
'BILL_LNAME' => 'Customer last name',
'BILL_PHONE' => 'Customer phone number',
'BILL_FAX' => 'Customer fax',
'BILL_ADDRESS' => 'Customer billing address',
'BILL_ADDRESS2' => 'More customer billing address',
'BILL_ZIPCODE' => 'Customer billing zip code',
'BILL_CITY' => 'Customer billing city',
'BILL_STATE' => 'Customer billing state',
'BILL_COUNTRYCODE' => 'Customer billing country code',
'BILL_EMAIL' => 'Customer billing email',
'DELIVERY_FNAME' => 'Customer delivery first name',
'DELIVERY_LNAME' => 'Customer delivery last name',
'DELIVERY_PHONE' => 'Customer delivery phone number',
'DELIVERY_ADDRESS' => 'Customer delivery address',
'DELIVERY_ADDRESS2' => 'More customer delivery address',
'DELIVERY_ZIPCODE' => 'Customer delivery zip code',
'DELIVERY_CITY' => 'Customer delivery city',
'DELIVERY_STATE' => 'Customer delivery state',
'DELIVERY_COUNTRYCODE' => 'Customer delivery country code',
);

/**
 * Send more than one product
 */

$data['extra']['productItems'] = array(
array(
'Name' => 'Product name 1',
'SKU' => 'Product ID 1',
'Description' => 'Product description 1',
'Price' => 'Product price',
'Quantity' => 'Ordered quantity'
),
array(
'Name' => 'Product name 2',
'SKU' => 'Product ID 2',
'Description' => 'Product description 2',
'Price' => 'Product price',
'Quantity' => 'Ordered quantity'
),
...
);

/**
 * Set product data if you want
 */

$data['extra']['productItems'] = array(
array(
'Name' => 'Product name 1',
'Price' => 'Product price',
'Quantity' => 'Ordered quantity'
),
array(
'Name' => 'Product name 2',
'Price' => 'Product price',
'Quantity' => 'Ordered quantity'
),
...
);

/**
 * Set customer email if you want
 */

$data['extra']['email'] = $data['email'];

if (isset($data['SaferpayPaymentMethods']) && !empty($data['SaferpayPaymentMethods'])) {
/**
 * Set payment methods if you want
 */

$data['extra']['SaferpayPaymentMethods'] = $data['SaferpayPaymentMethods'][];
}

if (isset($data['SaferpayWallets']) && !empty($data['SaferpayWallets'])) {
/**
 * Set wallets if you want
 */

$data['extra']['SaferpayWallets'] = $data['SaferpayWallets'][];
}

if (isset($data['QpayPaymentType']) && !empty($data['QpayPaymentType'])) {
/**
 * Set payment type if you want
 */

$data['extra']['QpayPaymentType'] = $data['QpayPaymentType'];
}

if (isset($data['Barion2']) && is_array($data['Barion2']) && !empty($data['Barion2'])) {
/**
 * If you want to set custom data
 */

$data['extra']['Barion2'] = $data['Barion2'];
}

if (isset($data['extra']) && is_array($data['extra'])) {
$paymentLinkCreateRequest->setExtra($data['extra']);
}

$paymentLinkCreateResponse = \BigFish\PaymentGateway::paymentLinkCreate($paymentLinkCreateRequest);

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");


Create payment link:

Required data (HTTP POST):

method = PaymentLinkCreate
json = {json encoded variables}

Parameters (* if necessary):

StoreName*
ProviderName*
Amount*
Currency*
OrderId
UserId
Language
AutoCommit (2-step payment if false)
ExpirationTime (YYYY-MM-DD HH:MM:SS)
NotificationUrl
NotificationEmail*
EmailNotificationOnlySuccess
Extra
ModuleName
ModuleVersion

Example:

method=PaymentLinkCreate&json={"StoreName":"sdk_test","ProviderName":"OTP","Amount":"100","Currency":"HUF","OrderId":"DEMO_ORDER","UserId":"DEMO_USER","Language":"HU","NotificationEmail":"somebody@domain.com"}

Response data (JSON format):

PaymentLinkName
PaymentLinkUrl
ResultCode
ResultMessage
ProviderName
Amount
Currency
Language
OrderId
UserId
AutoCommit
ExpirationTime
NotificationEmail
Status
Created
LastModified