lamp-of-god/sberbank-processing
Composer 安装命令:
composer require lamp-of-god/sberbank-processing
包简介
Utility to work with Sberbank API
README 文档
README
Overview
Very simple small utility to work with Sberbank API.
It supports one-stage payment for russian rubles orders.
How to use
-
Instantiate client:
$client = new SberbankClient('username', 'password'); -
Register your order in Sberbank processing system:
list($sberOrderID, $formURL) = $client->registerOrder( $order_id, $amount, 'http://return_url' ); -
Redirect user to the payment page (url received on previous step)
-
Check order status on callback page (specified on previous step):
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.
-
Do something depend on status:
switch($status) { case IOrderStatus::COMPLETED: ... case IOrderStatus::FAILED: ... }
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: WTFPL
- 更新时间: 2017-04-25