2017 © Pedro Peláez
 

library sberbank-processing

Utility to work with Sberbank API

image

lamp-of-god/sberbank-processing

Utility to work with Sberbank API

  • Tuesday, April 25, 2017
  • by SeRRgIO323
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Sberbank processing library

Overview

Very simple small utility to work with Sberbank API., (*1)

It supports one-stage payment for russian rubles orders., (*2)

How to use

1) Instantiate client:, (*3)

    $client = new SberbankClient('username', 'password');

2) Register your order in Sberbank processing system:, (*4)

    list($sberOrderID, $formURL) = $client->registerOrder(
        $order_id, $amount, 'http://return_url'
    );

3) Redirect user to the payment page (url received on previous step), (*5)

4) Check order status on callback page (specified on previous step):, (*6)

    try {
        $status = $this->client->getOrderStatus($sber_id);
    } catch(\RuntimeException $e) {
        ...
        $status = IOrderStatus::FAILED;
    }

Note that situation when payment was rejected (for example by 3D secure) counts as error, so library throws an exception like as for any other error. You may add additional check for exception reason by using exception code., (*7)

5) Do something depend on status:, (*8)

    switch($status) {
    case IOrderStatus::COMPLETED:
    ...
    case IOrderStatus::FAILED:
    ...
    }

The Versions

25/04 2017

dev-master

9999999-dev

Utility to work with Sberbank API

  Sources   Download

WTFPL

The Requires

 

The Development Requires

by SeRRg

25/04 2017

v1.0.0

1.0.0.0

Utility to work with Sberbank API

  Sources   Download

WTFPL

The Requires

 

The Development Requires

by SeRRg