PHPackages                             guanhui07/newebpay - 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. guanhui07/newebpay

ActiveLibrary[Payment Processing](/categories/payments)

guanhui07/newebpay
==================

Payment solution of NewebPay(藍新金流), implementing by pure PHP

v1.1.2(4y ago)011MITPHP

Since May 8Pushed 1y agoCompare

[ Source](https://github.com/guanhui07/newebpay)[ Packagist](https://packagist.org/packages/guanhui07/newebpay)[ RSS](/packages/guanhui07-newebpay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (12)Used By (0)

Newebpay 藍新金流
=============

[](#newebpay-藍新金流)

程式版本 1.5
文件版本 1.0.4
[Official Doc](https://www.newebpay.com/website/Page/content/download_api#1)

feature
-------

[](#feature)

- 多功能收款 MPG
- 單筆交易狀態查詢
- 信用卡取消授權
- 信用卡請退款
- 信用卡定期定額

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

[](#how-to-use)

### 信用卡定期定額

[](#信用卡定期定額)

#### 建立交易資訊 (BasicInfo)

[](#建立交易資訊-basicinfo)

- $order: 你的訂單物件, 務必實作package 中的OrderInterface
- $contact: 你的付款人物件, 務必實作package 中的ContactInterface
- $periodStartType: 檢查卡號模式, 參閱文件p.13
- $version: 串接程式版本
    - 帶入 1.0 版本,則\[背面末三碼\]將為必填欄位
    - 帶入 1.1 版本,則\[背面末三碼\]將為非必填

```
$info = new \fall1600\Package\Newebpay\Info\Period\BasicInfo($order, $payer, $periodStartType, $version);
```

#### 選填參數

[](#選填參數)

```
$info = new ReturnUrl($info, 'https://your.return.url');
$info = new NotifyUrl($info, 'https://your.notify.url');
$info = new BackUrl($info, 'https://your.back.url');
$info = new Memo($info, 'your memo here');
```

#### 建立NewebPay 物件, 注入商店資訊, 帶著交易資訊前往藍新申請定期定額

[](#建立newebpay-物件-注入商店資訊-帶著交易資訊前往藍新申請定期定額)

- $merchantId: 你在藍新商店代號
- $hashKey: 你在藍新商店專屬的HashKey
- $hashIv: 你在藍新商店專屬的HashIV

```
$newebpay = new NewebPay();
$newebpay
    ->setIsProduction(false) // 設定環境, 預設就是走正式機
    ->setMerchant(new Merchant($merchantId, $hashKey, $hashIv))
    ->issue($info);
```

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

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

```
