PHPackages                             2pay-co/2pay-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. 2pay-co/2pay-php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

2pay-co/2pay-php-sdk
====================

2pay php sdk

v1.0.2(3y ago)015MITPHP

Since Aug 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/2pay-co/2pay-php-sdk)[ Packagist](https://packagist.org/packages/2pay-co/2pay-php-sdk)[ RSS](/packages/2pay-co-2pay-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

2PAY PHP SDK
============

[](#2pay-php-sdk)

[2Pay Online Api](https://2pay.gitbook.io/2pay-api-docs-en/notes)

### Requirements

[](#requirements)

- CURL extension

### Installation

[](#installation)

1. Install composer:

    ```
    $ curl -sS https://getcomposer.org/installer | php
    ```

    More info about installation on [Linux / Unix / OSX](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) and [Windows](https://getcomposer.org/doc/00-intro.md#installation-windows).
2. Run the Composer command to install the latest version of SDK:

    ```
    php composer.phar require 2pay-co/2pay-php-sdk
    ```
3. Require Composer's autoloader in your PHP script (assuming it is in the same directory where you installed Composer):

    ```
    require('vendor/autoload.php');
    ```

### Usage

[](#usage)

Please see [examples](https://github.com/2pay-co/2pay-php-sdk/tree/master/examples)

### demo

[](#demo)

```
use Pay\TwoPay;
use Pay\SecurePay;

$secure_param = new SecurePay();
$secure_param->amount = "3.2";
$secure_param->callbackUrl = "";
$secure_param->currency ="USD";
$secure_param->goodsInfo = "";
$secure_param->note = "test order";
$secure_param->description = "order test";
$secure_param->terminal = "ONLINE";
$secure_param->vendor = "alipay";
$secure_param->ipnUrl = '';
$secure_param->reference = (string)time();
$secure_param->timeout = "120";

$two_pay = new TwoPay("merchant_no", "token");
// $res is json string
$res = $two_pay->SecurePay($secure_param);

var_dump($res);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

1371d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13a5deb823a7edad6ff7394610f0267dc64109982597e826cb57245fd50e3d8e?d=identicon)[2pay](/maintainers/2pay)

---

Top Contributors

[![2pay-co](https://avatars.githubusercontent.com/u/110549101?v=4)](https://github.com/2pay-co "2pay-co (11 commits)")

### Embed Badge

![Health badge](/badges/2pay-co-2pay-php-sdk/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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