cuenta_digital 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c08fb44e5fc556fc0c5cf7cbd612d6a7e5955e16f3315ec0ff1ec202db82e6
4
- data.tar.gz: 24fa1ea6fdd39cea7a19a1f2d8aaba63e00622bec077a126ff5752ee98452fde
3
+ metadata.gz: 85a78d3f37c6b04c0bd37b008da468dc87076cc1adf8ffb24e83c5722ccd2533
4
+ data.tar.gz: 4aa62b7837bf4445e3fdf8d317060fd92948ee35d3341ecb5eafdc11f5e543fe
5
5
  SHA512:
6
- metadata.gz: 901f7d23cf7df8116104be5fd9772f05ed54ec921b98feab45b8891409a841140dd7a5b8266f2ffedf5fe208574fdca443dbd8249ac8dbb143f28cce597dfa02
7
- data.tar.gz: d6075f7d615b8c81b43747d3dc9e666e33c1db2109c2f7bdd1a9ee993d3e22c8f7de69328378beed56f39072f8a64a699e21f395c77ac3fa3eebe8a2ba2fc175
6
+ metadata.gz: c350334de734c6556b7eeaff36924f144599c94bb47aa5a8ea37c2809c0007b173e1b80268bbc20ae7cf2b85f56d102edc1ed53d9575b210544484be98758e4d
7
+ data.tar.gz: fb65094d6e8f5ea9276d571a9e1099dd3a0119cce22289ef0e640f9e3167da761d2edceee5f47a5106e931fe0c9addb39045d57539c847b405add72b4cbc426a
data/README.md CHANGED
@@ -45,7 +45,8 @@ Or install it yourself as:
45
45
  #### Example
46
46
 
47
47
  ```ruby
48
- coupon = CuentaDigital::Coupon.new(id: '643232',
48
+ coupon = CuentaDigital::Coupon.new(id: '643233
49
+ ',
49
50
  price: 15.00,
50
51
  first_due_date: 10,
51
52
  site: 'Zorchalandia',
@@ -128,6 +129,7 @@ This method return `CuentaDigital::Response` object
128
129
  - **checksum**
129
130
  - **operation_event_number**
130
131
  - **bar_code**
132
+ - **csv_line**
131
133
 
132
134
  #### Methods
133
135
 
@@ -102,6 +102,10 @@ module CuentaDigital
102
102
  response.invoice_generated?
103
103
  end
104
104
 
105
+ def error?
106
+ response.error?
107
+ end
108
+
105
109
  def valid?
106
110
  validate!
107
111
  errors.empty?
@@ -16,7 +16,8 @@ module CuentaDigital
16
16
  :payment_number,
17
17
  :checksum,
18
18
  :operation_event_number,
19
- :bar_code
19
+ :bar_code,
20
+ :csv_line
20
21
 
21
22
  def initialize(params = {})
22
23
  @operation_id = params[:operation_id]
@@ -30,6 +31,15 @@ module CuentaDigital
30
31
  @payment_number = params[:payment_number]
31
32
  @checksum = params[:checksum]
32
33
  @bar_code = params[:bar_code]
34
+ @csv_line = params[:csv_line]
35
+ end
36
+
37
+ def credit?
38
+ @operation_kind == 1
39
+ end
40
+
41
+ def debit?
42
+ @operation_kind == 0
33
43
  end
34
44
 
35
45
  # Linea de operaciones:
@@ -44,6 +54,7 @@ module CuentaDigital
44
54
  args = result.split(',')
45
55
 
46
56
  params = {
57
+ csv_line: result,
47
58
  operation_kind: args[0],
48
59
  payment_date: Time.parse(
49
60
  [
@@ -130,6 +141,7 @@ module CuentaDigital
130
141
  args = result.split('|')
131
142
 
132
143
  params = {
144
+ csv_line: result,
133
145
  operation_kind: 1, # Credit
134
146
  payment_date: Time.parse(
135
147
  [
@@ -74,5 +74,9 @@ module CuentaDigital
74
74
  def invoice_generated?
75
75
  @action == :invoice_generated
76
76
  end
77
+
78
+ def error?
79
+ @action == :error
80
+ end
77
81
  end
78
82
  end
@@ -1,3 +1,3 @@
1
1
  module CuentaDigital
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuenta_digital
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ga6ix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-10 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri