PHPackages                             netpaymx/netpay-php - 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. [API Development](/categories/api)
4. /
5. netpaymx/netpay-php

ActiveLibrary[API Development](/categories/api)

netpaymx/netpay-php
===================

NetPay PHP Library

2.0.1.2(4y ago)01.3k2[2 PRs](https://github.com/netpaymx/netpay-php/pulls)MITPHPPHP &gt;=5.4.0CI failing

Since Jun 6Pushed 4y agoCompare

[ Source](https://github.com/netpaymx/netpay-php)[ Packagist](https://packagist.org/packages/netpaymx/netpay-php)[ Docs](https://netpay.mx/)[ RSS](/packages/netpaymx-netpay-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

NetPay PHP bindings
===================

[](#netpay-php-bindings)

You can sign up for a NetPay account at .

Minimum Requirements
--------------------

[](#minimum-requirements)

PHP 5.4.0 and later.

Manual Installation
-------------------

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/netpay-ecommerce/netpay-php/releases). Then, to use the bindings, include the `init.php` file.

```
require_once('/path/to/netpay-php/init.php');
```

Getting Started
---------------

[](#getting-started)

Tokenization:

Sample code:

```
require_once('../../init.php');

use \NetPay\NetPayConfig;

define('TEST_MODE', true);
define('PRIVATE_KEY', 'sk_netpay_lyNzonHFhwqoMHXfMFmOILqgZjAAjUVOjisfSkikPkrDA');

NetPayConfig::init(TEST_MODE);

try {
    $installments = 3; //null=no MSI, 3=3 MSI, 6=6 MSI, 9=9 MSI, 12=12 MSI, 18=18 MSI
    $billing = array(
        'billing_city' => 'Panuco',
        'billing_country' => 'MX',
        'billing_first_name' => 'Jhon',
        'billing_last_name' => 'Doe',
        'billing_email' => 'accept@netpay.com.mx',
        'billing_phone' => '8461234567',
        'billing_postcode' => '93994',
        'billing_state' => 'Veracruz',
        'billing_address_1' => 'Zona Centro 123',
        'billing_address_2' => 'Col Centro',
        'reference' => '12345',
    );
    $shipping = array( //optional, for virtual products it must be empty
        'shipping_city' => 'city',
        'shipping_country' => 'MX',
        'shipping_first_name' => 'Name',
        'shipping_last_name' => 'Last',
        'shipping_phone' => '0987654321',
        'shipping_postcode' => '66478',
        'shipping_state' => 'state',
        'shipping_address_1' => 'address1',
        'shipping_address_2' => 'address2',
        'shipping_method' => 'flat',
    );
    $data = array(
        'description' => 'Cobro de colegiatura',
        'source' => 'token_AyRPMSxsOpIsEaoYywLQEQyrccUVrRLzoaPNrsic',
        'amount' => 300,
        "billing" => \NetPay\NetPayBill::format($billing),
        "shipping" => \NetPay\NetPayShip::format($shipping),
        'redirect3dsUri' => 'https://netpay.mx'
    );

    $checkout = \NetPay\Api\NetPayCheckout::post(PRIVATE_KEY, $data, $installments);
    print_r($checkout);
} catch (Exception $e) {
    $description = $e->getMessage();
    echo $description;
}
```

Documentation
-------------

[](#documentation)

Please see  for up-to-date documentation.

Custom Request Timeouts
-----------------------

[](#custom-request-timeouts)

*NOTE:* We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on NetPay's side can still complete.

File lib/NetPayConfig.php

```
//-- General settings
const CURLOPT_TIMEOUT = 40; //Timeout in seconds
```

File lib/NetPay/Api/Curl.php

```
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $http_header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, strlen($fields_string));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_ENCODING, "gzip, deflate");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, Config::$CURLOPT_TIMEOUT);
curl_setopt($ch, CURLOPT_TIMEOUT, Config::$CURLOPT_TIMEOUT);
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

4

Last Release

1783d ago

Major Versions

v1.0.2 → 2.0.1.22021-06-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/82bc55b38df650ed392faffcce7a7cecf58b5507c4709b14d46dac7822995cde?d=identicon)[felipecastillonetpay](/maintainers/felipecastillonetpay)

---

Top Contributors

[![felipecastillonetpay](https://avatars.githubusercontent.com/u/50599517?v=4)](https://github.com/felipecastillonetpay "felipecastillonetpay (28 commits)")

---

Tags

apipayment processingnetpaymx

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/netpaymx-netpay-php/health.svg)

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

###  Alternatives

[paymentwall/paymentwall-php

Paymentwall PHP Library. Paymentwall is the leading digital payments platform for globally monetizing digital goods and services.

86797.2k5](/packages/paymentwall-paymentwall-php)[ebanx/ebanx

EBANX PHP library

24648.5k](/packages/ebanx-ebanx)[pay-now/paynow-php-sdk

PHP client library for accessing Paynow API

18193.9k2](/packages/pay-now-paynow-php-sdk)[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)

PHPackages © 2026

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