README.md in yandex-money-sdk-0.9.5 vs README.md in yandex-money-sdk-0.10.0
- old
+ new
@@ -1,10 +1,12 @@
# Yandex Money Ruby SDK Ruby
[![Build Status](https://travis-ci.org/yandex-money/yandex-money-sdk-ruby.svg)](https://travis-ci.org/yandex-money/yandex-money-sdk-ruby)
[![Coverage Status](https://img.shields.io/coveralls/yandex-money/yandex-money-sdk-ruby.svg)](https://coveralls.io/r/yandex-money/yandex-money-sdk-ruby)
[![Code Climate](https://codeclimate.com/github/yandex-money/yandex-money-sdk-ruby/badges/gpa.svg)](https://codeclimate.com/github/yandex-money/yandex-money-sdk-ruby)
+[![Gem Version](https://badge.fury.io/rb/yandex-money-sdk.svg)](http://badge.fury.io/rb/yandex-money-sdk)
+[![Dependency Status](https://gemnasium.com/yandex-money/yandex-money-sdk-ruby.svg)](https://gemnasium.com/yandex-money/yandex-money-sdk-ruby)
Ruby gem for Yandex Money API usage.
## Example application
@@ -96,10 +98,11 @@
Required permissions: `operation-history`.
```ruby
api.operation_history
#<OpenStruct next_record="30", operations=[{"operation_id"=>"462449992116028008", "title"=>"Возврат средств от:", "amount"=>1.0, "direction"=>"in", "datetime"=>"2014-08-27T10:19:52Z", "status"=>"success", "type"=>"deposition"}, ..., {"pattern_id"=>"p2p", "operation_id"=>"460970888534110007", "title"=>"Перевод на счет 410011700000000", "amount"=>3.02, "direction"=>"out", "datetime"=>"2014-08-10T07:28:15Z", "status"=>"success", "type"=>"outgoing-transfer"}]>
+
# you could pass params:
api.operation_history(records: 1)
#<OpenStruct next_record="1", operations=[{"pattern_id"=>"p2p", "operation_id"=>"463947376678019004", "title"=>"Перевод от 410011285000000", "amount"=>0.99, "direction"=>"in", "datetime"=>"2014-09-13T18:16:16Z", "status"=>"refused", "type"=>"incoming-transfer-protected"}]>
```
@@ -116,21 +119,21 @@
If operation doesn't exist, exception will be raised:
```ruby
api.operation_details "unknown"
- # RuntimeError:
- # Illegal param operation id
+ # YandexMoney::ApiError:
+ # Illegal param operation id
```
If scope is insufficient, expcetion will be raised:
```ruby
api = YandexMoney::Api.new(token: TOKEN)
api.operation_details(OPERATION_ID)
- # RuntimeError:
- # Insufficient Scope
+ # YandexMoney::InsufficientScopeError:
+ # YandexMoney::InsufficientScopeError
```
### Payments from the Yandex.Money wallet
#### request-payment method
@@ -180,11 +183,11 @@
```ruby
api = YandexMoney::Api.new(token: TOKEN)
api.incoming_transfer_accept "463937708331015004", "0208"
# true
api.incoming_transfer_accept "463937708331015004", "WRONG"
- # RuntimeError:
+ # YandexMoney::ApiError:
# Illegal param protection code, attemps available: 2
```
#### incoming-transfer-reject method
@@ -195,11 +198,11 @@
```ruby
api = YandexMoney::Api.new(token: TOKEN)
api.incoming_transfer_reject "463947376678019004"
# true
api.incoming_transfer_reject ""
- # RuntimeError:
+ # YandexMoney::ApiError:
# Illegal param operation id
```
### Payments from bank cards without authorization
@@ -244,9 +247,13 @@
ext_auth_success_uri: "http://example.com/success",
ext_auth_fail_uri: "http://example.com/fail"
})
#<OpenStruct status="ext_auth_required", acs_params={"cps_context_id"=>"31323039373...93134623165", "paymentType"=>"FC"}, acs_uri="https://m.sp-money.yandex.ru/internal/public-api/to-payment-type">
```
+
+## Running tests
+
+Just run it with `rake` command.
## Caveats
This library is very unstable. Pull requests welcome!