PHPackages                             albert-finaru/php-card-composer - 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. albert-finaru/php-card-composer

ActiveLibrary[Payment Processing](/categories/payments)

albert-finaru/php-card-composer
===============================

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

09PHP

Since Sep 1Pushed 2y agoCompare

[ Source](https://github.com/albert-finaru/php-card-composer)[ Packagist](https://packagist.org/packages/albert-finaru/php-card-composer)[ RSS](/packages/albert-finaru-php-card-composer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Parsedown](https://camo.githubusercontent.com/524370e3204c8d57aa045d6117a1d1baddfc53f8b699d0b5b4349b9cd1c19e61/68747470733a2f2f7375706f72742e6d6f62696c7061792e726f2f6e702d6c6f676f2d626c75652e737667)](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.0",      ...  }  `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\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);            /*             * encrypting             */            $paymentRequest->encrypt($this->x509FilePath);            /**             * send the following data to NETOPIA Payments server             * Method : POST             * URL : $paymentUrl             */            $EnvKey = $paymentRequest->getEnvKey();            $data   = $paymentRequest->getEncData();        }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 function index()    {    ...            $this->errorType = PaymentAbstract::CONFIRM_ERROR_TYPE_NONE;        $this->errorCode = 0;        $this->errorMessage = '';        $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);                    $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->errorMessag = '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}";        }    }}`##### 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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/63bafbf158e21694c642016ea6449d0f638ec8601d89a7a13dffd42bf9dd569e?d=identicon)[albert-finaru](/maintainers/albert-finaru)

---

Top Contributors

[![navid59](https://avatars.githubusercontent.com/u/4462714?v=4)](https://github.com/navid59 "navid59 (30 commits)")[![fixone](https://avatars.githubusercontent.com/u/196430?v=4)](https://github.com/fixone "fixone (3 commits)")[![albert-finaru](https://avatars.githubusercontent.com/u/109789278?v=4)](https://github.com/albert-finaru "albert-finaru (1 commits)")

### Embed Badge

![Health badge](/badges/albert-finaru-php-card-composer/health.svg)

```
[![Health](https://phpackages.com/badges/albert-finaru-php-card-composer/health.svg)](https://phpackages.com/packages/albert-finaru-php-card-composer)
```

###  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)
