conekta 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 128afba5fc294c5b0915d48fa91a36b032930fc2
4
- data.tar.gz: 53ca47e31d870affb3d83bb994a3d713412d582b
3
+ metadata.gz: cd1316f1bb6e5b655a00ee5c423de21178e78726
4
+ data.tar.gz: dc74ba4217ff50ec6575e0026b45778075cf4787
5
5
  SHA512:
6
- metadata.gz: 37f925817728abcfd6aa5d740bdb237d3e4ac41590764e3537dd8a57356269862536d2d6472ef14b7755c1639b4dea27186f5011911e9c4d66f3229e592f2c33
7
- data.tar.gz: 85618a790e13015b275d2f17156ed56aae1774148d927001cb38081fb30853e1004e314b233ec5d76e3132457608fc590b6ab9de8b872d8b38e9fc4ebe77e1aa
6
+ metadata.gz: 6be37d7ac5edd79a63e5be7ad22f4f9e8ec335117025afb60d2b6bc69373d4504ac483ae51e771e9c275563c430e2dffe2c634670aea14f761215c328c322822
7
+ data.tar.gz: b12487e0b39f5011657481402dd87b1302467d84d4c4b7ab464455524f621bef6c0a6ba0dff386820ab6a72f6a2cf421e82ce4f302555386c837964166f06b5e
@@ -1,3 +1,7 @@
1
+ ## [2.4.0](https://github.com/conekta/conekta-ruby/releases/tag/2.4.0) - 2017-10-05
2
+ ### Added oxxo recurrent support
3
+ - Added new method create_offline_recurrent_reference.
4
+
1
5
  ## [2.3.0](https://github.com/conekta/conekta-ruby/releases/tag/2.3.0) - 2017-10-05
2
6
  ### Fix
3
7
  - Capture allow pass amount in api v1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![README Cover Image](readme_cover.png)
2
2
 
3
- # Conekta Ruby v.2.3.0
3
+ # Conekta Ruby v.2.4.0
4
4
 
5
5
  This is a ruby library that allows interaction with https://api.conekta.io API.
6
6
 
@@ -57,6 +57,10 @@ module Conekta
57
57
  self.create_member_with_relation('payment_sources', params, self)
58
58
  end
59
59
 
60
+ def create_offline_recurrent_reference(params)
61
+ self.create_member_with_relation('payment_sources', params, self)
62
+ end
63
+
60
64
  def create_subscription(params)
61
65
  self.create_member('subscription', params)
62
66
  end
@@ -11,7 +11,7 @@ module Conekta
11
11
  end
12
12
 
13
13
  def delete
14
- self.delete_member('customer','payment_sources')
14
+ self.delete_member('customer', 'payment_sources')
15
15
  end
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Conekta
2
- VERSION = '2.3.0'.freeze
2
+ VERSION = '2.4.0'.freeze
3
3
  end
@@ -8,6 +8,24 @@ describe Conekta::Customer do
8
8
 
9
9
  let(:customer) { Conekta::Customer.create(customer_data) }
10
10
 
11
+ let(:customer_oxxo) {
12
+ {
13
+ payment_sources: [{
14
+ type: 'oxxo_recurrent',
15
+ expires_at: 157_559_040_0
16
+ }],
17
+ email: 'test@gmail.com',
18
+ name: 'Mario'
19
+ }
20
+ }
21
+
22
+ let(:oxxo_source_params) do
23
+ {
24
+ type: 'oxxo_recurrent',
25
+ expires_at: 157_559_040_0
26
+ }
27
+ end
28
+
11
29
  let(:source_params) do
12
30
  {
13
31
  type: "card",
@@ -31,10 +49,20 @@ describe Conekta::Customer do
31
49
  end
32
50
 
33
51
  it "successfully creates source for customer" do
34
- source = customer.create_payment_source(source_params)
52
+ customer = Conekta::Customer.create(customer_oxxo)
53
+ source = customer.payment_sources.first
54
+
55
+ expect(source.class.to_s).to eq('Conekta::PaymentSource')
56
+ expect(customer.payment_sources.class.to_s).to eq('Conekta::List')
57
+ expect(source.reference.size).to eq(14)
58
+ end
59
+
60
+ it 'successfully creates oxxo recurrent reference for customer' do
61
+ source = customer.create_offline_recurrent_reference(oxxo_source_params)
35
62
 
36
63
  expect(source.class.to_s).to eq("Conekta::PaymentSource")
37
64
  expect(customer.payment_sources.class.to_s).to eq("Conekta::List")
65
+ expect(source.reference.size).to eq(14)
38
66
  end
39
67
 
40
68
  it "successfully creates shipping contact for customer" do
@@ -46,4 +74,4 @@ describe Conekta::Customer do
46
74
  end
47
75
  end
48
76
  end
49
- end
77
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conekta
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MauricioMurga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-04 00:00:00.000000000 Z
11
+ date: 2018-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler