payture-cheques 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +46 -5
- data/lib/payture/cheques/methods/base.rb +1 -1
- data/lib/payture/cheques/responses/status.rb +5 -1
- data/lib/payture/cheques/version.rb +1 -1
- data/payture-cheques.gemspec +0 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e2140551b23ffb46f17098703c5fc4428994c5d
|
4
|
+
data.tar.gz: 1d338224780734d0dc0b0c47c97e722019cebf10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e9b5d024fac7fb6f7ae65725a8eb825db4fdd60b6d8c1c5d72923a81fdc3436763002811a492343139f4fdcac27f17bf671c8a8f88dc793c62c76645a2bd3aa
|
7
|
+
data.tar.gz: d2787db6314619181e8c65f913c037c4278d98c04adeaa27127357dae3b50bbd0b811fe98e9da6b6161c497c4ef695dd0b23f12dc6f7ab00cb5aca269bef5519
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Payture::Cheques
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Обертка к API отправки чеков, предоставляемому компанией Payture.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,51 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
Создание клиента:
|
24
|
+
```ruby
|
25
|
+
client = Payture::Cheques.client(
|
26
|
+
host: 'sandbox3.payture.com',
|
27
|
+
merchant_id: 'MyMerchantId',
|
28
|
+
password: 'MyPassword',
|
29
|
+
)
|
30
|
+
```
|
31
|
+
|
32
|
+
отправка чека:
|
33
|
+
```ruby
|
34
|
+
|
35
|
+
cheque = JSON.parse('{
|
36
|
+
"Message":"test",
|
37
|
+
"Type":1,
|
38
|
+
"Positions":[
|
39
|
+
{
|
40
|
+
"Quantity":1.000,
|
41
|
+
"Price":111.45,
|
42
|
+
"Tax":1,
|
43
|
+
"Text":"Булка"
|
44
|
+
}
|
45
|
+
],
|
46
|
+
"CheckClose":{
|
47
|
+
"Payments":[
|
48
|
+
{
|
49
|
+
"Type":1,
|
50
|
+
"Amount":123.45
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"TaxationSystem":1
|
54
|
+
},
|
55
|
+
"CustomerContact":"nikita.popovsky@payture.com"
|
56
|
+
}
|
57
|
+
')
|
58
|
+
|
59
|
+
response = client.create(
|
60
|
+
cheque_id: 'chequeid-1234',
|
61
|
+
inn: 7710140679,
|
62
|
+
content: cheque
|
63
|
+
)
|
64
|
+
|
65
|
+
response.success
|
66
|
+
```
|
67
|
+
|
26
68
|
|
27
69
|
## Development
|
28
70
|
|
@@ -38,4 +80,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
38
80
|
## License
|
39
81
|
|
40
82
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
@@ -15,12 +15,16 @@ module Payture::Cheques
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def success?
|
18
|
-
body['Success'] == true
|
18
|
+
body['Success'] == true && cheques.all?(&:success?)
|
19
19
|
end
|
20
20
|
|
21
21
|
def error_code
|
22
22
|
body['ErrCode'] || ERROR_STATES[body['Status']]
|
23
23
|
end
|
24
|
+
|
25
|
+
def status
|
26
|
+
body['Status']
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
data/payture-cheques.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payture-cheques
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Sviridov
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '3.0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: pp
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
139
|
description:
|
154
140
|
email:
|
155
141
|
- alexander.sviridov@gmail.com
|