webtoucher/omnipay-rbkmoney

RBK.money driver for the Omnipay payment processing library

dev-master 2019-01-22 04:57 UTC

This package is auto-updated.

Last update: 2024-12-23 21:30:00 UTC


README

RBK.money driver for the Omnipay payment processing library.

Latest Stable Version Total Downloads Daily Downloads Latest Unstable Version License

Installation

The preferred way to install this library is through composer.

Either run

$ php composer.phar require webtoucher/omnipay-rbkmoney "*"

or add

"webtoucher/omnipay-rbkmoney": "*"

to the require section of your composer.json file.

Usage

Configure API client:

    $gateway = \Omnipay\Omnipay::create('RbkMoney');
    $gateway->setShopId('[SHOP_ID]');
    $gateway->setApiKey('[API_PRIVATE_KEY]');
    $gateway->setLogger(function ($message, $level = 'info') {
        // You can add logging for your requests
    });

Then you can create invoice.

    $cart = new \Omnipay\RbkMoney\Cart;
    $cart->addItem(new \Omnipay\RbkMoney\CartItem('Some product', 100));
    $cart->addItem(new \Omnipay\RbkMoney\CartItem('Another product', 200, 1, 20));

    $request = $gateway->createInvoice([
        'cart' => $cart,
        'currency' => 'RUB',
        'transactionId' => 1234,
        'product' => "Заказ 1234",
    ]);

    try {
        $response = $request->send();

        if ($response->isSuccessful()) {
            // Your handler
        }
    } catch (\Omnipay\Common\Exception\OmnipayException $e) {
        // Your handler
    }

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker.