PHPackages                             fall1600/suntech - 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. fall1600/suntech

ActiveLibrary[Payment Processing](/categories/payments)

fall1600/suntech
================

Payment solution of SunTech(紅陽科技), implementing by pure PHP

v1.0.2(5y ago)7402MITPHP

Since May 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fall1600/suntech)[ Packagist](https://packagist.org/packages/fall1600/suntech)[ RSS](/packages/fall1600-suntech/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Suntech 紅陽金流
============

[](#suntech-紅陽金流)

[Official Doc](https://www.esafe.com.tw/Question_Fd/DownloadPapers.aspx)

簡述: 在紅陽金流裡商城與付款方式綁定, 一個商城id 代表一種付款方式, 轉導至結帳頁時也只會顯示一種付款方式

#### 支援付款方式

[](#支援付款方式)

- 信用卡
- 銀聯卡
- 虛擬ATM
- 超商代收(條碼繳費單)
- 超商代碼
- WebATM
- 台灣pay
- 超商取貨付款

How to use
----------

[](#how-to-use)

#### 控制交易方式

[](#控制交易方式)

- $merchantId: 你在紅陽申請的商店代號
- $order: 你的訂單物件, 務必實作package 中的OrderInterface
- $payer: 你的付款人物件, 務必實作package 中的PayerInterface

```
// 信用卡付款
$info = new CreditInfo($creditMerchantId, $order, $payer);
```

```
// 銀聯卡付款, 與信用卡共用merchantId, webhook url設定; 文件第7頁
$info = new UnionPayInfo($unionMerchantId, $order, $payer);
```

```
// 虛擬Atm 付款, 與超商代收(條碼繳費單) 共用merchantId, webhook url設定; 文件第8頁
$info = (new AtmInfo($atmMerchantId, $order, $payer))
        ->appendProduct($product1)
        ->appendProduct($product2);
```

```
// 超商代收(條碼繳費單)
$info = (new CvsBarcodeInfo($barcodeMerchantId, $order, $payer))
        ->appendProduct($product1)
        ->appendProduct($product2);
```

```
// 超商代碼(ibon, FamiPort 那種)
$info = new CvsPaycodeInfo($paycodeMerchantId, $order, $payer);
```

```
// 台灣pay
$info = new TaiwanPayInfo($twpayMerchantId, $order, $payer);
```

#### 建立Suntech 物件, 注入商店資訊, 帶著交易資訊前往紅陽付款

[](#建立suntech-物件-注入商店資訊-帶著交易資訊前往紅陽付款)

- $merchantId: 你在紅陽商店代號
- $tradePassword: 交易密碼

```
$suntech = new Suntech();
$suntech
    ->setIsProduction(false) // 設定環境, 預設就是走正式機
    ->setMerchant(new Merchant($merchantId, $tradePassword))
    ->checkout($info);
```

#### 請在你的訂單物件實作 OrderInterface

[](#請在你的訂單物件實作-orderinterface)

```
