Skip to content

Simple PHP class to generate URLs for the K&H Bank's payment gateway system.

Notifications You must be signed in to change notification settings

davidzoli/khbankpayment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP class for K&H Bank payment integration

Unofficial release. Made by an independent developer.

Simple PHP class to generate URLs for the K&H Bank's payment gateway system.
Contact the K&H Bank for integration details and for necessary setting values before using this.

Information about the integration, codes and the payment process can be found in the official documentation given by the K&H Bank.
This readme contains info about generating URLs for redirect the user to the payment system and getting transaction info.

Configuration

require 'KHbank.php';

$khtest = new \Payment\KHbank(
    1111111111111111,                       // mid - Given by the bank.
    '/folder_to/private_key.pem',           // Private key - Public pair is at the Bank
    'http://url.to.the.payment.system'      // Test or live url - Given by the Bank.
);

Payment URL

// Transaction (order) id - 1
// Amount to pay - 100 HUF
$pu = $khtest->getPayUrl(1, 10000);

Reserve URL

// Transaction (order) id - 1
// Amount to reserve - 10 HUF
$re = $khtest->getReserveUrl(1, 1000);

Result URL

// Transaction (order) id - 1
$te = $khtest->getResultUrl(1);

Get the payment result

// Transaction (order) id - 1
$tr = $khtest->getResult(1);

Result example

Successful transaction

XXXXXX is an integer (6 digits)

ACK
1
ELFOGADVA / ENGEDELYEZVE
XXXXXX B
Unsuccessful transaction
NAK
64
A 2. SAV ADATAI HIBASAK !
00000000

About

Simple PHP class to generate URLs for the K&H Bank's payment gateway system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages