dipnot/ptt-akilliesnaf-php
Composer 安装命令:
composer require dipnot/ptt-akilliesnaf-php
包简介
Unofficial PHP wrapper for PTT Akıllı Esnaf API
README 文档
README
PTT Akıllı Esnaf API Wrapper for PHP
Unofficial PHP wrapper for PTT Akıllı Esnaf API
We got a lot of help from the sample codes.
Only covers threeDSecure (Ortak Ödeme Sayfası) and inquiry (Ödeme Sorgulama)
threeDPayment (3D ile Ödeme), void (İptal), refund (İade) or history (İşlem Listeleme) are not our goal currently. We would be happy to see your contributions!
Dependencies
- PHP 5.6.36 or higher
- ext-curl
- ext-json
Installation
You can install via Composer.
composer require dipnot/ptt-akilliesnaf-php
Usage
You can see the full example in examples folder.
Config
All request are needs a Config.
use Dipnot\PttAkilliEsnaf\Config; $config = new Config(true); // Don't forget to change it to "false" in production :) $config->setClientId("1000000032"); $config->setApiUser("Entegrasyon_01"); $config->setApiPass("gkk4l2*TY112");
Making a threeDPayment request
use Dipnot\PttAkilliEsnaf\Enum\Currency; use Dipnot\PttAkilliEsnaf\Request\ThreeDPaymentRequest; // $config = ...; $orderId = "ORDERCODE" . time(); $threeDPaymentRequest = new ThreeDPaymentRequest($config); $threeDPaymentRequest->setCallbackUrl("http://localhost/ptt-akilliesnaf-php/examples/callback.php"); $threeDPaymentRequest->setOrderId($orderId); $threeDPaymentRequest->setAmount(1000); $threeDPaymentRequest->setCurrency(Currency::TL); $threeDPaymentRequest->setInstallmentCount(1); try { $request = $threeDPaymentRequest->execute(); ?> <h1>Response:</h1> <?php echo "<pre>"; print_r($request->getResponse()); echo "</pre>"; ?> <hr /> <h1>Payment iframe:</h1> <iframe src="<?= $request->getIframeUrl() ?>" width="1010" height="480"></iframe> <?php } catch(Exception $e) { echo $e->getMessage(); }
Making an inquiry request
use Dipnot\PttAkilliEsnaf\Request\InquiryRequest; // $config = ...; $orderId = "SAMPLEORDERCODE"; $inquiryRequest = new InquiryRequest($config); $inquiryRequest->setOrderId($orderId); try { $request = $inquiryRequest->execute(); ?> <h1>Response:</h1> <?php echo "<pre>"; print_r($request->getResponse()); echo "</pre>"; } catch(Exception $e) { echo $e->getMessage(); }
Test cards
While developing the package, the test cards in the official documentation were not working. So we contacted the authorities and got the following values for testing.
| Value | |
|---|---|
| Card holder | Fill randomly |
| Card number | 4159560047417732 |
| Card expiry date (Month/Year) | 08/24 |
| Card CVV | 123 |
| 3D Secure code | You can get it under the countdown timer on the 3D Secure page |
License
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-06