PHPackages                             netopia/payment - 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. netopia/payment

ActiveLibrary[Payment Processing](/categories/payments)

netopia/payment
===============

Set of library that give you the means to incorporate NETOPIA Payments functionality into your website applications and mobile apps.

v1.1.3(1y ago)12115.9k↓41.8%102AGPL-3.0-or-laterPHPPHP &gt;=5.5CI passing

Since Aug 31Pushed 7mo ago7 watchersCompare

[ Source](https://github.com/mobilpay/composer)[ Packagist](https://packagist.org/packages/netopia/payment)[ RSS](/packages/netopia-payment/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)DependenciesVersions (10)Used By (2)

[![Parsedown](https://camo.githubusercontent.com/4b4812e120306a26525d0a194c563cc16c0e5fab1804233820d7d6b86e37e7bc/68747470733a2f2f6e65746f7069612d7061796d656e74732e636f6d2f636f72652f6173736574732f353939333432386261622f696d616765732f6c6f676f2e706e67)](https://netopia-payments.com/)

NETOPIA Payments
================

[](#netopia-payments)

NETOPIA Payments Composer
-------------------------

[](#netopia-payments-composer)

### Installation

[](#installation)

Run the following command from root of your project

- `composer require netopia/payment`

#### or

[](#or)

- add the **"netopia/payment"** to your **composer.json** file like the following example ``

    `  "require": {      ...      "netopia/payment": "^1.1",      ...  }  `and then run the following command from your Terminal

    `composer install`

### Example

[](#example)

##### An example of Payment Request in Laravel

[](#an-example-of-payment-request-in-laravel)

`...use Netopia\Payment\Address;use Netopia\Payment\Invoice;use Netopia\Payment\Split;use Netopia\Payment\Request\Card;...class ExampleController extends Controller{    /**     * all payment requests will be sent to the NETOPIA Payments server     * SANDBOX : http://sandboxsecure.mobilpay.ro     * LIVE : https://secure.mobilpay.ro     */    public $paymentUrl;    /**     * NETOPIA Payments is working only with Certificate. Each NETOPIA partner (merchant) has a certificate.     * From your Admin panel you can download the Certificate.     * is located in Admin -> Conturi de comerciant -> Detalii -> Setari securitate     * the var $x509FilePath is path of your certificate in your platform     * i.e: /home/certificates/public.cer     */    public $x509FilePath;    /**     * Billing Address     */    public $billingAddress;    /**     * Shipping Address     */    public $shippingAddress;        ...        public function index()    {        $this->paymentUrl   = 'http://sandboxsecure.mobilpay.ro';        $this->x509FilePath = '/home/certificates/sandbox.XXXX-XXXX-XXXX-XXXX-XXXX.public.cer';        try {            $paymentRequest = new Card();            $paymentRequest->signature  = 'XXXX-XXXX-XXXX-XXXX-XXXX';//signature - generated by mobilpay.ro for every merchant account            $paymentRequest->orderId    = md5(uniqid(rand())); // order_id should be unique for a merchant account            $paymentRequest->confirmUrl = 'https://example.test/card/success'; // is where mobilPay redirects the client once the payment process is finished and is MANDATORY            $paymentRequest->returnUrl  = 'https://example.test/ipn';// is where mobilPay will send the payment result and is MANDATORY            /*             * Invoices info             */            $paymentRequest->invoice = new Invoice();            $paymentRequest->invoice->currency  = 'RON';            $paymentRequest->invoice->amount    = '20.00';            $paymentRequest->invoice->tokenId   = null;            $paymentRequest->invoice->details   = "Payment Via Composer library";            /*             * Billing Info             */            $this->billingAddress = new Address();            $this->billingAddress->type         = "person"; //should be "person" / "company"            $this->billingAddress->firstName    = "Billing name";            $this->billingAddress->lastName     = "Billing LastName";            $this->billingAddress->address      = "Bulevardul Ion Creangă, Nr 00";            $this->billingAddress->email        = "test@billing.com";            $this->billingAddress->mobilePhone  = "0732123456";            $paymentRequest->invoice->setBillingAddress($this->billingAddress);            /*             * Shipping             */            $this->shippingAddress = new Address();            $this->shippingAddress->type        = "person"; //should be "person" / "company"            $this->shippingAddress->firstName   = "Shipping Name";            $this->shippingAddress->lastName    = "Shipping LastName";            $this->shippingAddress->address     = "Bulevardul Mihai Eminescu, Nr 00";            $this->shippingAddress->email       = "test@shipping.com";            $this->shippingAddress->mobilePhone = "0721234567";            $paymentRequest->invoice->setShippingAddress($this->shippingAddress);            /**            * params             * The params is optional            */            $paymentRequest->params = [                'framework_name'=>"Laravel",                'framework_version'=>"9"            ];            /**            * Split payment            * this option is ONLY for merchants, who already have split payment settings.            * 'id' Is the SELLERA_CCOUNT_ID            * 'amount' is the splited amount             */            $paymentRequest->split = new Split();            $paymentRequest->split->destinations = [                [                'id'=>'123456',                'amount'=>"2.75"                ]            ];            /*             * encrypting             */            $paymentRequest->encrypt($this->x509FilePath);            /**             * send the following data to NETOPIA Payments server             * Method : POST             * Parameters : env_key, data, cipher, iv             * URL : $paymentUrl             */            $env_key = $paymentRequest->getEnvKey();            $data   = $paymentRequest->getEncData();            $cipher = $paymentRequest->getCipher();            $iv     = $paymentRequest->getIv();        }catch (\Exception $e)        {            return "Oops, There is a problem!";        }    }    ...}    `#### An example of IPN in Laravel

[](#an-example-of-ipn-in-laravel)

`{$this->errorMessage}";        }    }}">...use Netopia\Payment\Address;use Netopia\Payment\Invoice;use Netopia\Payment\Request\Card;use Netopia\Payment\Request\Notify;use Netopia\Payment\Request\PaymentAbstract;...class IpnsController extends Controller {    ...    public $errorCode;    public $errorType;    public $errorMessage;    public $paymentUrl;    public $x509FilePath;    public $cipher;    public $iv;    ...        public function index()    {    ...            $this->errorType = PaymentAbstract::CONFIRM_ERROR_TYPE_NONE;        $this->errorCode = 0;        $this->errorMessage = '';        $this->cipher     = 'rc4';        $this->iv         = null;        ....        if(array_key_exists('cipher', $_POST))        {            $this->cipher = $_POST['cipher'];            if(array_key_exists('iv', $_POST))            {                $this->iv = $_POST['iv'];            }        }        $this->paymentUrl = 'http://sandboxsecure.mobilpay.ro';        $this->x509FilePath = '/home/certificates/sandbox.XXXX-XXXX-XXXX-XXXX-XXXXprivate.key';        if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0){            if(isset($_POST['env_key']) && isset($_POST['data'])){                try {                    $paymentRequestIpn = PaymentAbstract::factoryFromEncrypted($_POST['env_key'], $_POST['data'], $this->x509FilePath, null, $this->cipher, $this->iv);                    $rrn = $paymentRequestIpn->objPmNotify->rrn;                    if ($paymentRequestIpn->objPmNotify->errorCode == 0) {                        switch($paymentRequestIpn->objPmNotify->action){                            case 'confirmed':                                //update DB, SET status = "confirmed/captured"                                $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                                break;                            case 'confirmed_pending':                                //update DB, SET status = "pending"                                $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                                break;                            case 'paid_pending':                                //update DB, SET status = "pending"                                $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                                break;                            case 'paid':                                //update DB, SET status = "open/preauthorized"                                $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                                break;                            case 'canceled':                                //update DB, SET status = "canceled"                                $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                                break;                            case 'credit':                                //update DB, SET status = "refunded"                                $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                                break;                            default:                                $errorType = PaymentAbstract::CONFIRM_ERROR_TYPE_PERMANENT;                                $this->errorCode = PaymentAbstract::ERROR_CONFIRM_INVALID_ACTION;                                $this->errorMessage = 'mobilpay_refference_action paramaters is invalid';                        }                    }else{                        //update DB, SET status = "rejected"                        $this->errorMessage = $paymentRequestIpn->objPmNotify->errorMessage;                    }                }catch (\Exception $e) {                    $this->errorType = PaymentAbstract::CONFIRM_ERROR_TYPE_TEMPORARY;                    $this->errorCode = $e->getCode();                    $this->errorMessage = $e->getMessage();                }            }else{                $this->errorType = PaymentAbstract::CONFIRM_ERROR_TYPE_PERMANENT;                $this->errorCode = PaymentAbstract::ERROR_CONFIRM_INVALID_POST_PARAMETERS;                $this->errorMessage = 'mobilpay.ro posted invalid parameters';            }        } else {            $this->errorType = PaymentAbstract::CONFIRM_ERROR_TYPE_PERMANENT;            $this->errorCode = PaymentAbstract::ERROR_CONFIRM_INVALID_POST_METHOD;            $this->errorMessage = 'invalid request metod for payment confirmation';        }        /**         * Communicate with NETOPIA Payments server         */        header('Content-type: application/xml');        echo "\n";        if($this->errorCode == 0)        {            echo "{$this->errorMessage}";        }        else        {            echo "{$this->errorMessage}";        }    }}`To place an order, the following parameters must be sent to our server using the POST method

- env\_key
- data
- cipher
- iv

#### An example of view

[](#an-example-of-view)

`                    document.getElementById('paymentForm').submit();`##### Note / Suggestions

[](#note--suggestions)

- if there is issue with namespace in your platform , you can solve it by getting help from Service Providers. for ex. in Laravel you can define a provider and put in your vendor and then set your namespace from the composer.json
- if in any case the Country , City , Zip code , ... is separated from the Address in your application , please merge it with Address and create full address for Billing/Shipping address.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance52

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~341 days

Total

9

Last Release

533d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/145893?v=4)[Navid](/maintainers/navid)[@navid](https://github.com/navid)

---

Top Contributors

[![fixone](https://avatars.githubusercontent.com/u/196430?v=4)](https://github.com/fixone "fixone (3 commits)")[![dummyntp](https://avatars.githubusercontent.com/u/186559336?v=4)](https://github.com/dummyntp "dummyntp (2 commits)")[![LucaConstantin](https://avatars.githubusercontent.com/u/99320381?v=4)](https://github.com/LucaConstantin "LucaConstantin (2 commits)")[![navid59](https://avatars.githubusercontent.com/u/4462714?v=4)](https://github.com/navid59 "navid59 (1 commits)")

### Embed Badge

![Health badge](/badges/netopia-payment/health.svg)

```
[![Health](https://phpackages.com/badges/netopia-payment/health.svg)](https://phpackages.com/packages/netopia-payment)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)[yenepay/php-sdk

YenePay SDK for PHP

112.7k](/packages/yenepay-php-sdk)

PHPackages © 2026

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