定制 dipnot/ptt-akilliesnaf-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dipnot/ptt-akilliesnaf-php

Composer 安装命令:

composer require dipnot/ptt-akilliesnaf-php

包简介

Unofficial PHP wrapper for PTT Akıllı Esnaf API

README 文档

README

Latest Stable Version Total Downloads

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

License: MIT

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固