2017 © Pedro Peláez
 

library gaotongpay-php

gaotong payment gateway php package

image

jetfueltw/gaotongpay-php

gaotong payment gateway php package

  • Thursday, April 26, 2018
  • by jetfueltw
  • Repository
  • 0 Watchers
  • 0 Stars
  • 161 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 14 % Grown

The README.md

介紹

高通支付 PHP 版本封裝。, (*1)

安裝

使用 Composer 安裝。, (*2)

composer require jetfueltw/gaotongpay-php

使用方法

掃碼支付下單

使用微信支付、QQ錢包掃碼支付,下單後返回 QR Code Image網址,並在網址加上'IMG|'前綴字串。, (*3)

$merchantId = 'XXXXXXXXXXXXXXX'; // 商家號
$secretKey = 'XXXXXXXXXXXXXXX'; // md5 密鑰
$tradeNo = '20180109023351XXXXX'; // 商家產生的唯一訂單號
$channel = Channel::WECHAT; // 支付通道,支援微信支付、QQ錢包
$amount = 1.00; // 消費金額 (元)
$notifyUrl = 'https://XXX.XXX.XXX'; // 交易完成後異步通知接口

$payment = new DigitalPayment(merchantId, secretKey);
$result = $payment->order($tradeNo, $channel, $amount, $notifyUrl);
Result:
[
    'qrcodeUrl' =>'IMG|https://wgtj.gaotongpay.com/zfapi/order/getqrcode?orderid=18573XXXX&sign=XXX', // QR Code 圖片網址
];

掃碼支付交易成功通知

消費者支付成功後,平台會發出 HTTP GET 請求到你下單時填的 $notifyUrl,商家在收到通知並處理完後必須回應 ok,否則平臺會認為通知失敗,再次反覆向 $notifyUrl 發送結果,直到商戶返回“ok”或者達到和商戶約定的重複發送次數。, (*4)

  • 商家必需正確處理重複通知的情況。
  • 能使用 NotifyWebhook@successNotifyResponse 返回成功回應。
  • 務必使用 NotifyWebhook@verifyNotifyPayload 驗證簽證是否正確。
  • 通知的消費金額單位為
Post Data: 
[
    'partner' => 'XXXXXXXXXXXXXXX'; // 商家號
    'ordernumber' => '20180109023351XXXXX'; // 商家產生的唯一訂單號
    'orderstatus' => 'X'; //1:支付成功,非1為支付失敗
    'paymoney'  => 1.00; //元
    'sysnumber' => 'XXXXXXXXXXXXX' //此次交易中高通支付介面系統內的訂單ID
    'attach' => 'XXXXXXXXXX' // 備註訊息
    'sign' => 'XXXXXXXXXXXXXXXXXXXXXX' // md5簽名
]

掃碼支付訂單查詢

使用商家訂單號查詢單筆訂單狀態。, (*5)

$merchantId = 'XXXXXXXXXXXXXXX'; // 商家號
$secretKey = 'XXXXXXXXXXXXXXX'; // md5 密鑰
$tradeNo = '20180109023351XXXXX'; // 商家產生的唯一訂單號

$tradeQuery = new TradeQuery(merchantId, secretKey);
$result = $tradeQuery->find($tradeNo);
Result:
[
    'data' => //如果查詢失敗此欄會回傳 null
      [
        'r1_mchtid' => 'XXXXXXXXXXXXXXX'; // 商家號
        'r2_systemorderno' => 'XXXXXXXXXXXXXXXXX' //平台唯一流水号
        'r3_orderno' => '20180109023351XXXXX'; // 商家產生的唯一訂單號
        'r4_amount' => 1.00; //订单交易金额
        'r5_orderstate' => 'X'; //0.支付中 1.成功,2.失败,3.失败
        'r6_version' => 'v2.8';
        'sign' => 'XXXXXXXXXXXXXXXXXXXXXX' // md5簽名
      ]
    'rspCode' => '1' //1表示成功
    'rspMsg' => 'XXXXXX' // 回覆訊息
]

掃碼支付訂單支付成功查詢

使用商家訂單號查詢單筆訂單是否支付成功。, (*6)

$merchantId = 'XXXXXXXXXXXXXXX'; // 商家號
$secretKey = 'XXXXXXXXXXXXXXX'; // md5 密鑰
$tradeNo = '20180109023351XXXXX'; // 商家產生的唯一訂單號
$tradeQuery = new TradeQuery($merchantId, $secretKey);
$result = $tradeQuery->isPaid($tradeNo);

``` Result: bool(true|false), (*7)

The Versions

26/04 2018

dev-master

9999999-dev

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

26/04 2018

v1.0.13

1.0.13.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

24/04 2018

v1.0.12

1.0.12.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

05/02 2018

v1.0.11

1.0.11.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

02/02 2018

v1.0.10

1.0.10.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

01/02 2018

v1.0.9

1.0.9.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

01/02 2018

v1.0.8

1.0.8.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

01/02 2018

v1.0.7

1.0.7.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

01/02 2018

v1.0.6

1.0.6.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

01/02 2018

v1.0.5

1.0.5.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

01/02 2018

v1.0.4

1.0.4.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

31/01 2018

v1.0.3

1.0.3.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

25/01 2018

v1.0.2

1.0.2.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

22/01 2018

v1.0.1

1.0.1.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway

19/01 2018

v1.0.0

1.0.0.0

gaotong payment gateway php package

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Greene Liu

payment payment gateway