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

ActiveLibrary[Payment Processing](/categories/payments)

mingjshk/laravel-newebpay
=========================

台灣藍新(智付通) Laravel API

1.0.2(5y ago)22.0k2MITPHPPHP &gt;=5.6

Since Mar 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MingJSHK/laravel-newebpay)[ Packagist](https://packagist.org/packages/mingjshk/laravel-newebpay)[ Docs](https://github.com/MingJSHK/laravel-newebpay)[ RSS](/packages/mingjshk-laravel-newebpay/feed)WikiDiscussions main Synced 1mo ago

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

Laravel NewebPay - 藍新金流
=======================

[](#laravel-newebpay---藍新金流)

> Fork from [ycs77/laravel-newebpay](https://github.com/ycs77/laravel-newebpay)

[![Latest Stable Version](https://camo.githubusercontent.com/aa5e69c85391ca4b0c44cbe11f92b17274e097d598b2fa2883decade5af5bb14/68747470733a2f2f706f7365722e707567782e6f72672f6d696e676a73686b2f6c61726176656c2d6e657765627061792f76)](//packagist.org/packages/mingjshk/laravel-newebpay)[![Total Downloads](https://camo.githubusercontent.com/db149b2d809956f3ab62dddcfb5a756872a63407a3ed5a4fb442de3466fa19f5/68747470733a2f2f706f7365722e707567782e6f72672f6d696e676a73686b2f6c61726176656c2d6e657765627061792f646f776e6c6f616473)](//packagist.org/packages/mingjshk/laravel-newebpay)[![License](https://camo.githubusercontent.com/7a263d7ade76653059b71b57ca1a2ce75bfc90843bd7fe51e6cc860cc6aed476/68747470733a2f2f706f7365722e707567782e6f72672f6d696e676a73686b2f6c61726176656c2d6e657765627061792f6c6963656e7365)](//packagist.org/packages/mingjshk/laravel-newebpay)

Laravel NewebPay 為針對 Laravel 所寫的金流套件，主要實作藍新金流（原智付通）功能。 Now Support Laravel 8

主要實作項目：

- NewebPay MPG - 多功能收款
- NewebPay Cancel - 信用卡取消授權
- NewebPay Close - 信用卡請退款
- NewebPay Period - 信用卡定期定額委託
- NewebPay Alter Period Status- 信用卡定期定額委託修改狀態
- NewebPay Alter Period Amt - 信用卡定期定額修改委託

安裝
--

[](#安裝)

```
composer require mingjshk/laravel-newebpay

```

### 註冊套件

[](#註冊套件)

> Laravel 5.5 以上會自動註冊套件，可以跳過此步驟

在 `config/app.php` 註冊套件和增加別名：

```
    'providers' => [
        ...

        /*
         * Package Service Providers...
         */
        MingJSHK\NewebPay\NewebPayServiceProvider::class,

        ...
    ],

    'aliases' => [
        ...

        'NewebPay' => MingJSHK\NewebPay\Facades\NewebPay::class,
    ]
```

### 發布設置檔案

[](#發布設置檔案)

```
php artisan vendor:publish --provider="MingJSHK\NewebPay\NewebPayServiceProvider"

```

使用
--

[](#使用)

### 設定 `.env` 檔

[](#設定-env-檔)

```
// .env

NEWEBPAY_MERCHANT_ID=""
NEWEBPAY_HASH_KEY=""
NEWEBPAY_HASH_IV=""
NEWEBPAY_DEBUG=true/false

NEWEBPAY_RETURN_URL=""
NEWEBPAY_NOTIFY_URL=""
NEWEBPAY_PERIOD_NOTIFY_URL=""
NEWEBPAY_CLIENT_BACK_URL=""

```

### 設定 `config/newebpay.php`

[](#設定-confignewebpayphp)

可依據個人商業使用上做調整。

### 引用、初始化類別：

[](#引用初始化類別)

```
use MingJSHK\NewebPay\NewebPay;

$newebpay = new NewebPay();

```

### NewebPay MPG - 多功能支付

[](#newebpay-mpg---多功能支付)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function order()
{
    return NewebPay::payment(
        no, // 訂單編號
        amt, // 交易金額
        desc, // 交易描述
        email // 付款人信箱
    )->submit();
}
```

基本上一般交易可直接在 `config/newebpay.php`做設定，裡面有詳細的解說，但若遇到特殊情況，可依據個別交易做個別 function 設定。

```
use MingJSHK\NewebPay\Facades\NewebPay;

return NewebPay::payment(
    no, // 訂單編號
    amt, // 交易金額
    desc, // 交易描述
    email // 付款人信箱
)
    ->setRespondType() // 回傳格式
    ->setLangType() // 語言設定
    ->setTradeLimit() // 交易秒數限制
    ->setExpireDate() // 交易截止日
    ->setReturnURL() // 由藍新回傳後前景畫面要接收資料顯示的網址
    ->setNotifyURL() // 由藍新回傳後背景處理資料的接收網址
    ->setCutomerURL() // 商店取號網址
    ->setClientBackURL() // 付款取消後返回的網址
    ->setEmailModify() // 是否開放 email 修改
    ->setLoginType() // 是否需要登入智付寶會員
    ->setOrderComment() //商店備註
    ->setPaymentMethod() //付款方式 *依照 config 格式傳送*
    ->setCVSCOM() // 物流方式
    ->setTokenTerm() // 快速付款 token
    ->submit();
```

*此版本1.5由籃新金流回傳後為加密訊息，所以回傳後需要進行解碼！*

```
use Illuminate\Http\Request;
use MingJSHK\NewebPay\Facades\NewebPay;

function returnURL(Request $request)
{
    return NewebPay::decode($request->input('TradeInfo'));
}
```

### NewebPay Cancel - 信用卡取消授權

[](#newebpay-cancel---信用卡取消授權)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function creditCancel()
{
    return NewebPay::creditCancel(
        no, // 該筆交易的訂單編號
        amt,  // 該筆交易的金額
        'order' // 可選擇是由 order->訂單編號 或是 trade->藍新交易編號來做申請
    )->submit();
}
```

### NewebPay Close - 信用卡請款

[](#newebpay-close---信用卡請款)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function requestPayment()
{
    return NewebPay::requestPayment(
        no, // 該筆交易的訂單編號
        amt,  // 該筆交易的金額
        'order' // 可選擇是由 order->訂單編號 或是 trade->藍新交易編號來做申請
    )->submit();
}
```

### NewebPay close - 信用卡退款

[](#newebpay-close---信用卡退款)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function requestRefund()
{
    return NewebPay::requestRefund(
        no, // 該筆交易的訂單編號
        amt,  // 該筆交易的金額
        'order' // 可選擇是由 order->訂單編號 或是 trade->藍新交易編號來做申請
    )->submit();
}
```

### NewebPay Period - 定期定額委託

[](#newebpay-period---定期定額委託)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function period()
{
    return NewebPay::period(
            $no,        //訂單編號
            $amt,       //訂單金額
            $desc,      //產品名稱
            $type,      //週期類別 (D, W, M, Y)
            $point,     //交易週期授權時間
            $starttype, //檢查卡號模式
            $times,     //授權期數
            $email      //連絡信箱
        )->submit();
}
```

### NewebPay Period Status- 修改定期定額委託狀態

[](#newebpay-period-status--修改定期定額委託狀態)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function alterPeriodStatus()
{
    return NewebPay::alterStatus(
            $no,        //訂單編號
            $periodno,  //委託編號
            $type       //狀態類別 (suspend, terminate, restart)
        )->submitAndDecode('period');
}
```

### NewebPay Period - 修改定期定額委託內容

[](#newebpay-period---修改定期定額委託內容)

```
use MingJSHK\NewebPay\Facades\NewebPay;

function alterPeriodAmt()
{
    return NewebPay::alterPeriodAmt(
            $no,        //訂單編號
            $periodno,  //委託編號
            $amt,       //訂單金額
            $type,      //週期類別 (D, W, M, Y)
            $point,     //交易週期授權時間
            $times,     //授權期數
            $extday     //信用卡到期日 (2021 年 5 月則填入『0521』)
        )->submitAndDecode('period');
}
```

Official Reference
------------------

[](#official-reference)

[NewebPay Payment API](https://www.newebpay.com/website/Page/content/download_api#1)

License
-------

[](#license)

[MIT](./LICENSE)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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 ~1 days

Total

3

Last Release

1896d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28005020?v=4)[MingJ](/maintainers/MingJSHK)[@MingJSHK](https://github.com/MingJSHK)

---

Top Contributors

[![pkpk520](https://avatars.githubusercontent.com/u/8897294?v=4)](https://github.com/pkpk520 "pkpk520 (9 commits)")[![MingJSHK](https://avatars.githubusercontent.com/u/28005020?v=4)](https://github.com/MingJSHK "MingJSHK (4 commits)")

### Embed Badge

![Health badge](/badges/mingjshk-laravel-newebpay/health.svg)

```
[![Health](https://phpackages.com/badges/mingjshk-laravel-newebpay/health.svg)](https://phpackages.com/packages/mingjshk-laravel-newebpay)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)

PHPackages © 2026

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