2017 © Pedro Peláez
 

yii2-extension rbs

Component for executing requests to HTTP Services 1C

image

mrssoft/rbs

Component for executing requests to HTTP Services 1C

  • Tuesday, May 8, 2018
  • by mrs2000
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

RBS

Component for payment through the payment gateway bank "Sber", (*1)

Sber Manual, (*2)

Latest Stable Version PHP Github Total Downloads, (*3)

Installation

The preferred way to install this extension is through composer. Either run, (*4)

php composer.phar require --prefer-dist mrssoft/rbs "*"

or add, (*5)

"mrssoft/rbs": "*"

to the require section of your composer.json file., (*6)

Usage

Register order, (*7)

    $rbs = new \mrssoft\rbs\Rbs(['userName' => '', 'password' => '']);
    $rbs->credit = true; //if credit
    $rbs->productType = \mrssoft\rbs\Rbs::TYPE_CREDIT_INSTALLMENT;

    $rbsOrder = new RbsOrder();
    $rbsOrder->orderNumber = 'NM-12874';
    $rbsOrder->email = 'test@mail.com';
    $rbsOrder->description = 'Test';
    $rbsOrder->returnUrl = 'https:/mysite.com/payment/success';
    $rbsOrder->failUrl = 'https:/mysite.com/payment/fail';
    $rbsOrder->credit = 1; //for credit payment


    $rbsOrder->addCartItem(123, 'Product name', 450.80, 2);
    $rbsOrder->addCartItem('a321', 'Product name II', 145, 2.5);
    ...

    $response = $rbs->register($rbsOrder);
    if ($response) {
        //$response['orderId'] - order number on the payment gateway
        //$response['formUrl'] - redirect url
    }

Get order status, (*8)

    $rbs = new \mrssoft\rbs\Rbs(['userName' => '', 'password' => '']);
    $response = $rbsOrder->getOrderStatus('00256ad8-xxxx-4302-xxxx-846d6c0fd6bd');
    //$response['OrderStatus'] - order state code

Get order info, (*9)

    $rbs = new \mrssoft\rbs\Rbs(['userName' => '', 'password' => '']);
    $info = $rbsOrder->getOrderInfo('00256ad8-xxxx-4302-xxxx-846d6c0fd6bd');

Usage as Yii component


// Application config ... 'components' => [ 'rbs' = > [ 'class' => \mrssoft\rbs\Rbs::class, 'auth' => [ // multiple accounts 'first' => [ 'server' => 'https://3dsec.sberbank.ru/sbercredit/', 'userName' => 'username1', 'password' => '*****', ], 'second' => [ 'userName' => 'username2', 'password' => '*****', ] ] ] ] ... // Selecting account "second" $response = Yii::$app->rbs->register($rbsOrder, 'second');

The Versions

08/05 2018

dev-master

9999999-dev

Component for executing requests to HTTP Services 1C

  Sources   Download

MIT

The Requires

 

by Melnikov Ruslan

payment yii sberbank

27/04 2018

1.0.0

1.0.0.0

Component for executing requests to HTTP Services 1C

  Sources   Download

MIT

The Requires

 

by Melnikov Ruslan

payment yii sberbank