payuni/sdk

payuni sdk

v1.2.1 2023-08-02 07:25 UTC

This package is auto-updated.

Last update: 2024-05-01 00:10:16 UTC


README

環境需求

  • PHP:^7.1 || ^8.0

安裝

請使用Composer安裝

composer require payuni/sdk

使用方式

  • 正式區
$payuniApi = new \Payuni\Sdk\PayuniApi($merKey, $merIV);
  • 測試區
$payuniApi = new \Payuni\Sdk\PayuniApi($merKey, $merIV, $type);
  • API串接
$result = $payuniApi->UniversalTrade($encryptInfo, $mode);
  • upp ReturnURL、NotifyURL接收到回傳參數後處理方式
$result = $payuniApi->ResultProcess($requestData);
  • 參數說明

    $encryptInfo = [
              'MerID' => 'ABC',
              'Timestamp' => time(),
              ...
          ];
    • 若要使用代理商功能請在encryptInfo裡多加上IsPlatForm參數且值給1
    $encryptInfo = [
              'IsPlatForm' => 1,
              'MerID' => 'ABC',
              'Timestamp' => time(),
              ...
          ];
    • $merKey
      • 請登入PAYUNi平台檢視商店串接資訊取得 Hash Key
    • $merIV
      • 請登入PAYUNi平台檢視商店串接資訊取得 Hash IV
    • $type (非必填)
      • 連線測試區 => t
      • 連線正式區 => 不給該參數或給空值
    • $mode
      • 整合式支付頁 => upp
      • 虛擬帳號幕後 => atm
      • 超商代碼幕後 => cvs
      • 信用卡幕後  => credit
      • 交易查詢   => trade_query
      • 交易請退款  => trade_close
      • 交易取消授權 => trade_cancel
      • 信用卡Token(約定) => credit_bind_query
      • 信用卡Token取消(約定/記憶卡號) => credit_bind_cancel
      • 愛金卡退款(ICASH) => trade_refund_icash
      • 後支付退款(AFTEE) => trade_refund_aftee
  • 其餘請參考範例

  • 原生php

    • your file path => 請自行填入程式所放置之路徑
namespace Payuni\Sdk;
require_once('<your file path>/PayuniApi.php');
$merKey = '12345678901234567890123456789012';
$merIV  = '1234567890123456';
$payuni = new PayuniApi($merKey, $merIV);

$encryptInfo = [
    'MerID' => 'ABC',
    'TradeNo'   => '16614190477810373246',
    'Timestamp' => time()
];
$result = $payuni->UniversalTrade($encryptInfo, 'trade_query');

LICENSE

Copyright 2022 PRESCO. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.