payture-cheques 0.1.2 → 0.1.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b9032801d12b79cdc80714d708bc657bec95a78
|
4
|
+
data.tar.gz: bb7c52a7d07ced38a97833d0e111ea8d2ee0cc8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc986c857b1aff15597fcff72d059bc485500a73ed9df18255817e3b5d41985f5a168040054f5bfbaf559c6a6544c9684f1d9e0e5467879763e3842435d79227
|
7
|
+
data.tar.gz: 226fac0e06f779b56fbc0213247e875f9c071c7895b02b48cc03c8b42d2da593ca2511bf4d167537881f269d4664643224d3ad16899595742fe67d48ec968db2
|
@@ -3,15 +3,19 @@ module Payture::Cheques
|
|
3
3
|
class ChequeStatus
|
4
4
|
attr_reader :sent, :cheque, :error_code, :status
|
5
5
|
|
6
|
-
def initialize(
|
7
|
-
@sent =
|
8
|
-
@cheque =
|
9
|
-
@status =
|
10
|
-
@error_code =
|
6
|
+
def initialize(data)
|
7
|
+
@sent = data['Sended']
|
8
|
+
@cheque = data['Cheque']
|
9
|
+
@status = data['Status']
|
10
|
+
@error_code = data['ErrCode'] || Status::ERROR_STATES[@status]
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
@sent == true && @status == 'Created'
|
13
|
+
def processed?
|
14
|
+
error_code.nil? && @sent == true && @status == 'Created'
|
15
|
+
end
|
16
|
+
|
17
|
+
def processing_error?
|
18
|
+
!error_code.nil?
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
@@ -15,7 +15,15 @@ module Payture::Cheques
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def success?
|
18
|
-
body['Success'] == true
|
18
|
+
body['Success'] == true
|
19
|
+
end
|
20
|
+
|
21
|
+
def processed?
|
22
|
+
error_code.nil? && cheques.all?(&:processed?)
|
23
|
+
end
|
24
|
+
|
25
|
+
def processing_error?
|
26
|
+
!error_code.nil? || cheques.any?(&:processing_error?)
|
19
27
|
end
|
20
28
|
|
21
29
|
def error_code
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Sviridov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|