PHP code example of ttimot24 / teya-payment-client
1. Go to this page and download the library: Download ttimot24/teya-payment-client library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ttimot24 / teya-payment-client example snippets
$client = new Redwello\TeyaPayment\TeyaPaymentGatewayClient([
'PrivateKey' => '856293_pr0lxnW8PG1SeCwVJ3WPH0lXCeU0/sYLtX'
]);
$client->payment([
'Amount' => 100,
'Currency' => 352,
'OrderId' => 'ORDER1230001',
'PaymentMethod' => [
'PaymentType' => 'Card',
'PAN' => '4176669999000104',
'ExpYear' => 2031,
'ExpMonth' => 12
]
]);
$client = new Redwello\TeyaPayment\TeyaSecurePayClient([
'MerchantId' => '9256684',
'PaymentGatewayId' => 7,
'SecretKey' => 'cdedfbb6ecab4a4994ac880144dd92dc',
'RedirectSuccess' => '/SecurePay/SuccessPage.aspx',
'RedirectSuccessServer' => 'SUCCESS_SERVER',
"Currency" => "HUF"
]);
$this->client->addItems([
new \Redwello\TeyaPayment\Model\TeyaItem('Test Item', 1, 10000)
]);
//prepare transaction and redirect user
$response = $this->client->start([
"reference" => "TEST00000001",
]);
header('Location: '.$response['paymentUrl']);
//or a shortcut:
$this->client->open([
"reference" => "TEST00000001",
]);
$logger = new Logger('TeyaSecurePayClient');
$logger->pushHandler(new StreamHandler('teya_secure_pay_client.log'), \Monolog\Level::Debug);
$client = new Redwello\TeyaPayment\TeyaPaymentGatewayClient([
'PrivateKey' => '856293_pr0lxnW8PG1SeCwVJ3WPH0lXCeU0/sYLtX'
'logger' => $logger
]);
sh
playground.php