ttimot24 / teya-payment-client
PHP Teya Payment Client Library
Requires
- guzzlehttp/guzzle: ^7.9
Requires (Dev)
- monolog/monolog: ^3.8
- phpunit/phpunit: *
README
Teya Payment PHP Client Library
Teya PHP Client Library is a PHP package designed to interact with the Teya API, enabling seamless integration of Teya's services into PHP applications. It provides a structured and easy-to-use interface for making API requests, handling authentication, and managing data exchanges. The library simplifies complex API interactions by offering pre-built methods for common operations, ensuring developers can efficiently integrate Teya's features with minimal effort. Ideal for businesses and developers looking to incorporate Teya's payment and transactional services into their PHP-based systems.
Install
composer require ttimot24/teya-payment-client
RPG Payment Gateway
$client = new Ttimot24\TeyaPayment\TeyaPaymentGatewayClient([ 'PrivateKey' => '856293_pr0lxnW8PG1SeCwVJ3WPH0lXCeU0/sYLtX' ]); $client->payment([ 'Amount' => 100, 'Currency' => 352, 'OrderId' => 'ORDER1230001', 'PaymentMethod' => [ 'PaymentType' => 'Card', 'PAN' => '4176669999000104', 'ExpYear' => 2031, 'ExpMonth' => 12 ] ]);
SecurePay
$client = new Ttimot24\TeyaPayment\TeyaSecurePayClient([ 'MerchantId' => '9256684', 'PaymentGatewayId' => 7, 'SecretKey' => 'cdedfbb6ecab4a4994ac880144dd92dc', 'RedirectSuccess' => '/SecurePay/SuccessPage.aspx', 'RedirectSuccessServer' => 'SUCCESS_SERVER', "Currency" => "HUF" ]); $this->client->addItems([ new \Ttimot24\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", ]);
Logging
$logger = new Logger('TeyaSecurePayClient'); $logger->pushHandler(new StreamHandler('teya_secure_pay_client.log'), \Monolog\Level::Debug); $client = new Ttimot24\TeyaPayment\TeyaPaymentGatewayClient([ 'PrivateKey' => '856293_pr0lxnW8PG1SeCwVJ3WPH0lXCeU0/sYLtX' 'logger' => $logger ]);
SecurePay Playground
playground.php
Contribution
Contributions are welcome! If you'd like to improve this project, fork the repository, create a new branch, and submit a pull request. Please follow best practices and ensure your code is clean and well-documented.