privatbank 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +15 -15
- data/lib/privatbank/p24/account_statement.rb +3 -1
- data/lib/privatbank/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 052e484df8f1cd315d4bdc324f3e08ac897d1c58
|
4
|
+
data.tar.gz: 276e5b53295c4eaa1a877ef4d257a558c715e0ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b749c663b1798118686ce1850da8020a4862bd4e42455916f59f0c17f12f9afacbeb5c726481ab39535ad593a25293f9a670c0207df0c57b370bfdec86a07eb3
|
7
|
+
data.tar.gz: 59cc2fc0183dbaf11dc558d7f3a19bc8c2ff705d4fd7f410651afccc4e8317715de8e70babb3efaa09de81e05e1a67ebac8d07255b112d0e0288c8408de1e993
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# 0.0.3 / 2017-08-10
|
2
|
+
* [BUG] fix issue with response
|
3
|
+
|
4
|
+
*[@tggo](https://github.com/tggo)*
|
5
|
+
|
6
|
+
# 0.0.2 / 2016-04-01
|
7
|
+
* [FEATURE] send money to visa and privatbank cards
|
8
|
+
* [FEATURE] get information about payment
|
9
|
+
* [FEATURE] get information about card
|
10
|
+
|
11
|
+
*[@naumenkogs](https://github.com/naumenkogs)*
|
12
|
+
|
13
|
+
# 0.0.1 / 2015-02-15
|
14
|
+
* Initial release
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Privatbank
|
1
|
+
# Privatbank [![Build Status](https://travis-ci.org/greshny/privatbank.svg?branch=master)](https://travis-ci.org/greshny/privatbank)
|
2
2
|
|
3
3
|
Privatbank API wrapper
|
4
4
|
|
@@ -7,7 +7,7 @@ Privatbank API wrapper
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'privatbank'
|
10
|
+
gem 'privatbank', '~> 0.0.2'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -20,14 +20,14 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
For usage privat24 you need to [get credentials](https://api.privatbank.ua/
|
23
|
+
For usage privat24 you need to [get credentials](https://api.privatbank.ua/p24registration.html)
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
require 'privatbank'
|
27
27
|
|
28
28
|
Privatbank.configure do |config|
|
29
29
|
config.merchant_id = 'your-merchant-id'
|
30
|
-
config.
|
30
|
+
config.merchant_password = 'your-merchant-password'
|
31
31
|
end
|
32
32
|
```
|
33
33
|
|
@@ -82,12 +82,12 @@ For sending money to privatbank/visa cards:
|
|
82
82
|
```ruby
|
83
83
|
require 'privatbank/p24'
|
84
84
|
|
85
|
-
receiver
|
86
|
-
full_name
|
87
|
-
payment_id
|
88
|
-
amount
|
89
|
-
currency
|
90
|
-
details
|
85
|
+
receiver = '1111222233334444'
|
86
|
+
full_name = 'Some Full Name' #only for visa cards
|
87
|
+
payment_id = '12345'
|
88
|
+
amount = 100
|
89
|
+
currency = 'UAH' #optional
|
90
|
+
details = 'some-details'
|
91
91
|
|
92
92
|
Privatbank::P24.send_money_pb(receiver, payment_id, amount, details)
|
93
93
|
Privatbank::P24.send_money_visa(receiver, full_name, payment_id, amount, details)
|
@@ -100,8 +100,8 @@ For obtaining payment current state:
|
|
100
100
|
```ruby
|
101
101
|
require 'privatbank/p24'
|
102
102
|
|
103
|
-
payment_id
|
104
|
-
ref
|
103
|
+
payment_id = 'some-id'
|
104
|
+
ref = 'P123451234512341'
|
105
105
|
|
106
106
|
Privatbank::P24.payment_status(payment_id, ref)
|
107
107
|
```
|
@@ -113,8 +113,8 @@ For obtaining balance and other information:
|
|
113
113
|
```ruby
|
114
114
|
require 'privatbank/p24'
|
115
115
|
|
116
|
-
card_number
|
117
|
-
country
|
116
|
+
card_number = '1111222233334444'
|
117
|
+
country = 'UA' #optional
|
118
118
|
|
119
119
|
Privatbank::P24.info(card_number)
|
120
120
|
```
|
@@ -125,4 +125,4 @@ Privatbank::P24.info(card_number)
|
|
125
125
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
126
126
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
127
127
|
4. Push to the branch (`git push origin my-new-feature`)
|
128
|
-
5. Create a new Pull Request
|
128
|
+
5. Create a new Pull Request
|
@@ -23,7 +23,9 @@ module Privatbank
|
|
23
23
|
def request
|
24
24
|
response = self.class.post('/p24api/rest_fiz', body: outgoing_xml)
|
25
25
|
return [] if response.fetch('error', nil)
|
26
|
-
response['response']['data']['info']['statements']['statement']
|
26
|
+
statements = response['response']['data']['info']['statements']['statement']
|
27
|
+
statements = [statements] if statements.is_a?(Hash)
|
28
|
+
statements.map do |operation|
|
27
29
|
Items::Transaction.new( date: operation['trandate'],
|
28
30
|
time: operation['trantime'],
|
29
31
|
amount: operation['amount'],
|
data/lib/privatbank/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: privatbank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Greshny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -145,6 +145,7 @@ extra_rdoc_files: []
|
|
145
145
|
files:
|
146
146
|
- ".gitignore"
|
147
147
|
- ".travis.yml"
|
148
|
+
- CHANGELOG.md
|
148
149
|
- Gemfile
|
149
150
|
- LICENSE.txt
|
150
151
|
- README.md
|