PHPackages                             asiabill/asiabill\_php\_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. asiabill/asiabill\_php\_sdk

Active1[Payment Processing](/categories/payments)

asiabill/asiabill\_php\_sdk
===========================

You can quickly access the PHP SDK of asiabill payment

v1.5(3y ago)25391AGPL-3.0-or-laterPHPPHP &gt;=5.6

Since May 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Asiabill/asiabill_php_sdk)[ Packagist](https://packagist.org/packages/asiabill/asiabill_php_sdk)[ RSS](/packages/asiabill-asiabill-php-sdk/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (6)DependenciesVersions (7)Used By (1)

AsiaBill PHP SDK
================

[](#asiabill-php-sdk)

一个集成了AsiaBill的payment和openApi接口的组件，通过传递指定请求类型和对应的参数即可完成接口请求。使用前请先阅读Asiabill[接口文档](https://asiabill.gitbook.io/api-explorer/)

支付演示页面访问:`asiabill_php_sdk/demo/checkout.php`

PHP要求
=====

[](#php要求)

- php &gt;= 5.6
- [curl](https://www.php.net/manual/en/book.curl.php)
- [json](https://www.php.net/manual/en/book.json.php)
- [openssl](https://www.php.net/manual/en/book.openssl.php)

使用PHP SDK
=========

[](#使用php-sdk)

1、加载AsiabillIntegration.php文件

```
include_once "Classes/AsiabillIntegration.php";
```

2、初始化对象

```
use \Asiabill\Classes\AsiabillIntegration;
$model = 'test'; // test or live
$asiabill = new AsiabillIntegration($model,$gateway_no,$sign_key);
```

3、开启日志，可以通过参数设置目录，如果不开启则跳过这一步

```
$asiabill->startLogger($bool，$dir);
```

4、发起payment请求

```
$asiabill->request($type,$data);
$asiabill->payment()->request($type,$data);
```

5、发起openapi请求

```
$asiabill->openapi()->request($type,$data);
```

6、获取站内支付jssdk脚本

```
$asiabill->getJsScript();
```

参数说明
====

[](#参数说明)

> type：请求类型：自定义字符串
> data：请求参数：数组参数，包含path，body，query三个部分

示例代码
====

[](#示例代码)

创建交易：
-----

[](#创建交易)

```
$result = $asiabill->request('checkoutPayment',['body' => [
    'billingAddress' => [
        'address' => 'address',
        'city' => 'BR',
        'country' => 'country',
        'email' => '123451234@email.com',
        'firstName' => 'firstName',
        'lastName' => 'lastName',
        'phone' => '13800138000',
        'state' => 'CE',
        'zip' => '666666'
    ],
    'callbackUrl' => $http_type.'://'.$_SERVER['HTTP_HOST'].'/Asiabill/return.php',
    'customerId' => '', // asiabill创建的客户id，非网站用户id
    'deliveryAddress' => [
        'shipAddress' => 'mfdgohmqkpocemkqwtks',
        'shipCity' => 'MQOHUPOX',
        'shipCountry' => 'BR',
        'shipFirstName' =>  'SFDMPG',
        'shipLastName' =>  'USJAXT',
        'shipPhone' => '62519594707',
        'shipState' => 'WEWBZ',
        'shipZip' => '512008'
    ],
    'goodsDetails' => [
        [
            'goodsCount' => '1',
            'goodsPrice' => '6.00',
            'goodsTitle' => 'goods_1'
        ]
    ],
    'isMobile' => $asiabill->isMobile(), // 0:web, 1:h5, 2:app_SDK
    'orderAmount' => '7.00',
    'orderCurrency' => 'USD',
    'orderNo' => getOrderNo(),
    'paymentMethod' => 'Credit Card', // 其它支付方式请参考文档说明
    'platform' => 'php_SDK', // 平台标识，用户自定义
    'remark' => '', // 订单备注信息
    'returnUrl' => $http_type.'://'.$_SERVER['HTTP_HOST'].'/Asiabill/return.php',
    'webSite' => $_SERVER['HTTP_HOST']
]]);

if($result['code'] == '0000'){
    /* Your business code */
}
```

查询交易信息：
-------

[](#查询交易信息)

```
$asiabill->openapi()->request('orderInfo',['path' => [
    'tradeNo' => $tradeNo
]]);
```

创建客户：
-----

[](#创建客户)

```
$asiabill->request('customers',['body' => [
    'description' => 'test customer',
    'email' => '123451234@email.com',
    'firstName' => 'firstName',
    'lastName' => 'lastName',
    'phone' => '13800138000'
]]);
```

删除客户：
-----

[](#删除客户)

```
$asiabill->request('customers',['path' => [
    'customerId' => $customer_id
],'delete' => true]);
```

签名校验
----

[](#签名校验)

```
$asiabill->verification()
```

获取webhook数据
-----------

[](#获取webhook数据)

```
$asiabill->getWebhookData();
```

payment类型
=========

[](#payment类型)

类型说明接口customers操作客户（包含创建、修改、删除）/customers
/customers/{customerId}sessionToken生成会话接口/sessionTokenpaymentMethods创建支付方式/payment\_methodspaymentMethods\_list根据客户获取所有支付方式/payment\_methods/list/{customerId}paymentMethods\_update更新paymentMethod信息/payment\_methods/updatepaymentMethods\_query获取支付方式/payment\_methods/{customerPaymentMethodId}paymentMethods\_detach解绑支付方式/payment\_methods/{customerPaymentMethodId}/detachpaymentMethods\_attach客户附加支付方式/payment\_methods/{customerPaymentMethodId}/{customerId}/attachconfirmCharge确认扣款/confirmChargecheckoutPayment获取支付页面地址/checkout/paymentopenApi类型
=========

[](#openapi类型)

类型说明接口Authorize预授权/AuthorizeInterfacechargebacks拒付查询/chargebacksrefund退款申请/refundrefund\_query退款查询/refund/{batchNo}logistics上传物流信息/logisticstransactions交易流水列表/transactionsorderInfo交易详情/orderInfo/{tradeNo}添加自定义类型
=======

[](#添加自定义类型)

- $request\_type 请求类型，自定义字符，与request第一个参数一致，已经存在的类型不能添加
- $request\_path 接口路径，参考asiabill接口文档

```
$asiabill->addRequest($request_type,$request_path)->request($request_type,$data);
$asiabill->addRequest($request_type,$request_path)->openapi()->request($request_type,$data);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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 ~18 days

Recently: every ~11 days

Total

6

Last Release

1356d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/059f8f7a0413a0d5a17858a80ec22f52d40559b76c68e3f9c69c2496f2b74a43?d=identicon)[Asiabill](/maintainers/Asiabill)

---

Top Contributors

[![Asiabill](https://avatars.githubusercontent.com/u/68328492?v=4)](https://github.com/Asiabill "Asiabill (29 commits)")

---

Tags

paymentcreditcardshopasiabill

### Embed Badge

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

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

###  Alternatives

[league/omnipay

Omnipay payment processing library

6.1k9.7M165](/packages/league-omnipay)[silvershop/core

Provides an ecommerce product catalog, shopping cart, and order management system

11340.0k37](/packages/silvershop-core)[freelancehunt/php-credit-card-validator

Validates popular debit and credit cards' numbers against regular expressions and Luhn algorithm. Also validates the CVC and the expiration date.

18620.4k2](/packages/freelancehunt-php-credit-card-validator)[sylius/payment-bundle

Flexible payments system for Symfony e-commerce applications.

22268.0k5](/packages/sylius-payment-bundle)[sylius/payment

Flexible payments system for PHP e-commerce applications.

17324.0k7](/packages/sylius-payment)[aimeos/ai-payments

Payment extension for Aimeos e-commerce solutions

2160.7k](/packages/aimeos-ai-payments)

PHPackages © 2026

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