Giter Club home page Giter Club logo

php_sdk's Introduction

目錄

環境需求

  • 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.

php_sdk's People

Contributors

payuni avatar

Stargazers

Kaemiin Chang avatar 劉顥權 Haoquan Liu avatar GD-JasonWang avatar CornGuo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.