PHPackages                             payuni/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. payuni/sdk

ActiveLibrary[Payment Processing](/categories/payments)

payuni/sdk
==========

payuni sdk

v1.2.4(1y ago)98.0k↑87.5%3[1 issues](https://github.com/payuni/PHP_SDK/issues)1Apache-2.0PHPPHP ^7.1|^8.0

Since Sep 2Pushed 1y ago2 watchersCompare

[ Source](https://github.com/payuni/PHP_SDK)[ Packagist](https://packagist.org/packages/payuni/sdk)[ Docs](https://github.com/payuni/PHP_SDK)[ RSS](/packages/payuni-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (16)Used By (1)

目錄
==

[](#目錄)

- [環境需求](#%E7%92%B0%E5%A2%83%E9%9C%80%E6%B1%82)
- [安裝](#%E5%AE%89%E8%A3%9D)
- [使用方式](#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F)

環境需求
====

[](#環境需求)

- PHP：^7.1 || ^8.0

安裝
==

[](#安裝)

請使用[Composer](https://getcomposer.org/)安裝

```
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, $version);
```

- upp ReturnURL、NotifyURL接收到回傳參數後處理方式

```
$result = $payuniApi->ResultProcess($requestData);
```

- 參數說明

    - $encryptInfo
        - 參數詳細內容請參考[統一金流API串接文件](https://www.payuni.com.tw/docs/web/#/7/34)對應功能請求參數的EncryptInfo

    ```
    $encryptInfo = [
              'MerID' => 'ABC',
              'Timestamp' => time(),
              ...
          ];
    ```

    - 若要使用代理商功能請在encryptInfo裡多加上IsPlatForm參數且值給1

    ```
    $encryptInfo = [
              'IsPlatForm' => 1,
              'MerID' => 'ABC',
              'Timestamp' => time(),
              ...
          ];
    ```

    - $merKey

        - 請登入PAYUNi平台檢視商店串接資訊取得 Hash Key
    - $merIV

        - 請登入PAYUNi平台檢視商店串接資訊取得 Hash IV
    - $type (非必填)

        - 連線測試區 =&gt; t
        - 連線正式區 =&gt; 不給該參數或給空值
    - $mode

        - 整合式支付頁 =&gt; upp
        - 虛擬帳號幕後 =&gt; atm
        - 超商代碼幕後 =&gt; cvs
        - 信用卡幕後 =&gt; credit
        - LINE Pay幕後 =&gt; linepay
        - AFTEE幕後 =&gt; aftee\_direct
        - 交易查詢 =&gt; trade\_query
        - 交易請退款 =&gt; trade\_close
        - 交易取消授權 =&gt; trade\_cancel
        - 信用卡Token(約定) =&gt; credit\_bind\_query
        - 信用卡Token取消(約定/記憶卡號) =&gt; credit\_bind\_cancel
        - 交易取消超商代碼(CVS) =&gt; cancel\_cvs
        - 後支付確認(AFTEE) =&gt; trade\_confirm\_aftee
        - 愛金卡退款(ICASH) =&gt; trade\_refund\_icash
        - 後支付退款(AFTEE) =&gt; trade\_refund\_aftee
        - LINE Pay退款(LINE) =&gt; trade\_refund\_linepay
    - $version (非必填)

        - 所呼叫API的版本號，預設1.0(LINE Pay預設為1.1)
        - 若需呼叫其他版本號，該參數請給字串，e.g. $payuni-&gt;UniversalTrade($encryptInfo, 'trade\_query','2.0');，而非給數字或浮點數
        - 若需呼叫新版號請參考[統一金流API串接文件](https://www.payuni.com.tw/docs/web/#/7/34)對應功能請求參數的Version備註
- 其餘請參考[範例](https://github.com/payuni/PHP_SDK/tree/main/examples)
- 原生php

    - **your file path** =&gt; 請自行填入程式所放置之路徑

```
namespace Payuni\Sdk;
require_once('/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
=======

[](#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.

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~121 days

Total

15

Last Release

567d ago

PHP version history (2 changes)v1.0PHP ^7.0|^8.0

v1.1.4PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/260af1f7aa5f339763c50a877dfe19621a8cb5d1e7e321b965a43bd4234944ce?d=identicon)[payuni](/maintainers/payuni)

---

Top Contributors

[![payuni](https://avatars.githubusercontent.com/u/111719316?v=4)](https://github.com/payuni "payuni (53 commits)")

---

Tags

payunisdk-phpsdkpayuni

### Embed Badge

![Health badge](/badges/payuni-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/payuni-sdk/health.svg)](https://phpackages.com/packages/payuni-sdk)
```

###  Alternatives

[yandex-money/yandex-money-sdk-php

Yandex.Money API SDK for PHP

105167.4k2](/packages/yandex-money-yandex-money-sdk-php)[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2713.7k](/packages/cryptonator-merchant-php-sdk)[tatter/stripe

Stripe SDK integration for CodeIgniter 4

115.3k](/packages/tatter-stripe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
