Wallogit.com
2017 © Pedro Peláez
, (*1)
Making credit card payments work on your website (through a local bank) is pain! So to make everyone's life a bit easier we are sharing this php-library on GitHub., (*2)
There are two types of transaction within this system: SMS and DMS., (*3)
SMS - is a direct payment method, money is charged in 1 event, as soon as customer enters the credit card details and clicks proceed.
DMS - is a two step method, first event blocks the money on the card (max 30 days), second event captures the money (second event can be carried out when product is shipped to the customer for example)., (*4)
Every 24 hours, a merchant must close the business day., (*5)
It is possible to simply include this library see example, but you should use composer instead., (*6)
run in terminal:, (*7)
composer require wearede/tbcpay-php
$Payment = new TbcPayProcessor('/cert/tbcpay.pem', '0DhJ4AdxVuPZmz3F4y', $_SERVER['REMOTE_ADDR']);
Method name --- | sms_start_transaction() dms_start_authorization() dms_make_transaction($trans_id) get_transaction_result($trans_id) reverse_transaction($trans_id, $amount = '', $suspected_fraud = '') refund_transaction($trans_id) credit_transaction($trans_id, $amount = '') close_day(), (*8)
Relevant to a simple example here., (*9)
example.com/ok.php and example.com/fail.php urls and communicate these to TBC.
start.example Here we start our process. We call TBC servers using sms_start_transaction() and get $trans_id in return.
ok.example url on our server.ok.example We get $trans_id back from TBC, and we plug that in get_transaction_result($trans_id).get_transaction_result($trans_id) tells us if transaction was success or not. array('RESULT' => 'OK') for example is success message, transaction went through.openssl pkcs12 -in *.p12 -out tbcpay.pem.