PHPackages                             howtomakeaturn/pay2go-invoice - 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. howtomakeaturn/pay2go-invoice

ActiveLibrary[Payment Processing](/categories/payments)

howtomakeaturn/pay2go-invoice
=============================

send e-invoice with pay2go

1.1.0(10y ago)147273MITPHP

Since May 21Pushed 10y ago3 watchersCompare

[ Source](https://github.com/howtomakeaturn/pay2go-invoice)[ Packagist](https://packagist.org/packages/howtomakeaturn/pay2go-invoice)[ RSS](/packages/howtomakeaturn-pay2go-invoice/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (3)Used By (0)

智付寶（pay2go）電子發票 wrapper
=======================

[](#智付寶pay2go電子發票-wrapper)

注意：目前只有實作「開立發票」API。「作廢發票」、「查詢發票」等等API，近期內尚無規劃實作。
------------------------------------------------

[](#注意目前只有實作開立發票api作廢發票查詢發票等等api近期內尚無規劃實作)

Pay2goInvoice是一個用來呼叫智付寶電子發票API的library。

請參閱智付寶電子發票文件使用本library。

[https://www.pay2go.com/info/site\_description/api\_description](https://www.pay2go.com/info/site_description/api_description)

安裝
==

[](#安裝)

您可以直接將檔案下載使用。或是使用composer安裝：

```
composer require "howtomakeaturn/pay2go-invoice:1.*"

```

使用範例
====

[](#使用範例)

```
//記得先手動、或是利用composer載入套件

$pay2go = new Howtomakeaturn\Pay2goInvoice\Pay2goInvoice();

$pay2go->setMerchantId('xxx'); //設定商店代號

$pay2go->setHashKey('xxx'); //設定hash key

$pay2go->setHashIv('xxx'); //設定hash iv

$pay2go->setTestMode(True); //測試環境請加上這行

//請參閱官方文件設定參數
//https://www.pay2go.com/info/site_description/api_description

$params = [
    "RespondType" => "JSON",
    "Version" => "1.3",
    "TimeStamp" => time(), //請以 time() 格式
    "TransNum" => "",
    "MerchantOrderNo" => "WC_TEST_" . rand(),
    "BuyerName" => "王大品",
    "BuyerUBN" => "99112233",
    "BuyerAddress" => "台北市南港區南港路一段 99 號",
    "BuyerEmail" => "abc@gmail.com",
    "BuyerPhone" => "0955221144",
    "Category" => "B2B",
    "TaxType" => "1",
    "TaxRate" => "5",
    "Amt" => "1000",
    "TaxAmt" => "50",
    "TotalAmt" => "1050",
    "CarrierType" => "",
    "CarrierNum" => rawurlencode(""),
    "LoveCode" => "",
    "PrintFlag" => "Y",
    "ItemName" => "Translation Service", //多項商品時,以「|」分開
    "ItemCount" => "1", //多項商品時,以「|」分開
    "ItemUnit" => "-", //多項商品時,以「|」分開
    "ItemPrice" => "1000", //多項商品時,以「|」分開
    "ItemAmt" => "1000", //多項商品時,以「|」分開
    "Comment" => "TEST,備註說明",
    "Status" => "1", //1=立即開立,0=待開立,3=延遲開立
    "CreateStatusTime" => "",
    "NotifyEmail" => "1", //1=通知,0=不通知
];

$result = $pay2go->send($params);
```

Exceptions
==========

[](#exceptions)

目前只會針對智付寶回傳的錯誤訊息，丟出一種通用例外。

- Howtomakeaturn\\Pay2goInvoice\\Exception\\GeneralException

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~2 days

Total

2

Last Release

3693d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/794a27b329aeea74a342351a16b6f91673cc2239b9f4f9ba07172483fffed965?d=identicon)[howtomakeaturn](/maintainers/howtomakeaturn)

---

Top Contributors

[![howtomakeaturn](https://avatars.githubusercontent.com/u/1255050?v=4)](https://github.com/howtomakeaturn "howtomakeaturn (8 commits)")[![appleboy](https://avatars.githubusercontent.com/u/21979?v=4)](https://github.com/appleboy "appleboy (1 commits)")

---

Tags

E-Invoicepay2go

### Embed Badge

![Health badge](/badges/howtomakeaturn-pay2go-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/howtomakeaturn-pay2go-invoice/health.svg)](https://phpackages.com/packages/howtomakeaturn-pay2go-invoice)
```

###  Alternatives

[num-num/ubl-invoice

A modern object-oriented PHP library to create and read valid UBL and EN 16931/Peppol BIS 3.0 files

136923.4k](/packages/num-num-ubl-invoice)[saleh7/php-zatca-xml

An unofficial PHP library for generating ZATCA Fatoora e-invoices. This library facilitates the creation of compliant e-invoices, QR Codes, and certificates, as well as the submission of e-invoices to ZATCA's servers. It provides developers with an easy-to-use, customizable, and robust toolkit to integrate and automate ZATCA e-invoicing processes in PHP applications.

5618.1k](/packages/saleh7-php-zatca-xml)[sevaske/php-zatca-xml

An unofficial PHP library for generating ZATCA Fatoora e-invoices. This library facilitates the creation of compliant e-invoices, QR Codes, and certificates, as well as the submission of e-invoices to ZATCA's servers. It provides developers with an easy-to-use, customizable, and robust toolkit to integrate and automate ZATCA e-invoicing processes in PHP applications.

2113.9k1](/packages/sevaske-php-zatca-xml)[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)

PHPackages © 2026

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