essam/laravel-tap-payment

PHP Laravel Tap Payment SDK 包

v0.0.3 2021-04-03 16:19 UTC

This package is auto-updated.

Last update: 2024-09-25 12:37:49 UTC


README

PHP Laravel Tap Payment SDK 包 New Project (20)

Laravel 兼容性

安装

使用包管理器 composer 安装。

composer require essam/laravel-tap-payment

用法

创建充值交易

$TapPay = new Payment(['secret_api_Key'=> $secret_api_Key]);

$redirect = false; // return response as json , you can use it form mobile web view application

return $TapPay->charge([
        'amount' => 200,
        'currency' => 'AED',
        'threeDSecure' => 'true',
        'description' => 'test description',
        'statement_descriptor' => 'sample',
        'customer' => [
           'first_name' => 'customer',
           'email' => 'customer@gmail.com',
        ],
        'source' => [
          'id' => 'src_card'
        ],
        'post' => [
           'url' => null
        ],
        'merchant' => [
           'id' => 'YOUR-MERCHANT-ID'  //Include this when you are going to live
        ],
        'redirect' => [
           'url' => url('check_payment.php')
        ]
   ],$redirect);

如果信息正确,您将被引导到支付页面

通过充值ID获取充值

$TapPay = new Payment(['secret_api_Key'=> $secret_api_Key]);
$Charge =  $TapPay->getCharge($charge_id);

获取充值列表

$TapPay = new Payment(['secret_api_Key'=> $secret_api_Key]);

$ChargesList = $TapPay->chargesList([
'period' => [
  'date' => [
      'from' => Date('Y-m-d H:i:s'),
      'to' => Date('Y-m-d H:i:s'),
     ]
  ],
  'status' => 'INITIATED',
  'limit' => 30
]);

创建退款交易

$TapPay = new Payment(['secret_api_Key'=> $secret_api_Key]);

$Refund = $TapPay->refund([
    'charge_id' => $charge_id,
     'amount' => 2,
     'currency' => 'AED',
     'reason' => 'type the refund reason',
     'post' => [
        'url' => 'http://post_after_refund_page.php'
   ]);

通过退款ID获取退款

$TapPay = new Payment(['secret_api_Key'=> $secret_api_Key]);

$Refund = $TapPay->getRefund($refund_id);

获取退款列表

$TapPay = new Payment(['secret_api_Key'=> $secret_api_Key]);

$RefundList = $TapPay->refundList([
'period' => [
  'date' => [
      'from' => Date('Y-m-d H:i:s'),
      'to' => Date('Y-m-d H:i:s'),
     ]
  ],
  'limit' => 30
]);

一些教程,了解如何使用此API

https://medium.com/@sfwanessam9/how-to-use-laravel-tap-payment-sdk-cc9e583f84a4

贡献

欢迎提交拉取请求。对于重大更改,请首先提交一个问题以讨论您想要更改的内容。

请确保适当地更新测试。

许可协议

MIT