culqi-ruby 0.0.4 → 0.0.5

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: 424dbe635a7ee59b18d1c879799663b2b8d8f137
4
- data.tar.gz: dca4997bd563e524ae42c3ad9e891c07ec198067
3
+ metadata.gz: 7ad2c11e9d328321081b1a112f04953add5c4991
4
+ data.tar.gz: de50a7fb512e8c258720949c9e67526ce564ddee
5
5
  SHA512:
6
- metadata.gz: 703144e0c47a9ac2d9cb2db43a866202d15a35657220888237675ef32611b7715ea3d4b21a79178f50162bb64cbcceef0446d22254045fa3677582f39b19842c
7
- data.tar.gz: 6c5607eaa4f24658169cb679d1c765f86f12a92d3e378e3929b4f30232d97a81a8759204e90a4ced59652af7b0d288ef79429f4f6fa50a4eec6a19bb7b8deb50
6
+ metadata.gz: ceddcb8a4f4d968f255e602645c8b9561833d674311c2958de3b614b475b2ded14e7abb469e1fa670a81e887986a46d3c1bea335ea7de8559e3a3352065ba44d
7
+ data.tar.gz: 5316dbf54c9c260580f4e1208f3069adbad73eed2221e9bb32fcbcb9a70c2fc625f8b3c28130640262c37c918f30133f22e72a4b965b0d5444c8c0cf3ed612a4
@@ -20,9 +20,10 @@ module Culqi
20
20
 
21
21
  API_BASE = 'https://api.culqi.com/v2'
22
22
  READ_TIMEOUT = 120
23
+ LIST_TIMEOUT = 360
23
24
 
24
25
  class << self
25
- attr_accessor :code_commerce, :api_key
26
+ attr_accessor :public_key, :secret_key
26
27
  end
27
28
 
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module Culqi
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -7,7 +7,7 @@ module Delete
7
7
  end
8
8
 
9
9
  def delete(id)
10
- response = Culqi.connect(@url+id+'/', Culqi.api_key, nil, 'delete')
10
+ response = Culqi.connect(@url+id+'/', Culqi.secret_key, nil, 'delete', Culqi::READ_TIMEOUT)
11
11
  return response.read_body
12
12
  end
13
13
 
@@ -7,7 +7,7 @@ module Get
7
7
  end
8
8
 
9
9
  def get(id)
10
- response = Culqi.connect(@url+id+'/', Culqi.api_key, nil, 'get')
10
+ response = Culqi.connect(@url+id+'/', Culqi.secret_key, nil, 'get', Culqi::READ_TIMEOUT)
11
11
  return response.read_body
12
12
  end
13
13
 
@@ -7,7 +7,7 @@ module List
7
7
  end
8
8
 
9
9
  def list(params={})
10
- response = Culqi.connect(@url, Culqi.api_key, params, 'get')
10
+ response = Culqi.connect(@url, Culqi.secret_key, params, 'get', Culqi::LIST_TIMEOUT)
11
11
  return response.read_body
12
12
  end
13
13
 
@@ -9,11 +9,11 @@ module Post
9
9
  def create(params={})
10
10
  key = ''
11
11
  if @url.include? 'token'
12
- key = Culqi.code_commerce
12
+ key = Culqi.public_key
13
13
  else
14
- key = Culqi.api_key
14
+ key = Culqi.secret_key
15
15
  end
16
- response = Culqi.connect(@url, key, params, 'post')
16
+ response = Culqi.connect(@url, key, params, 'post', Culqi::READ_TIMEOUT)
17
17
  return response.read_body
18
18
  end
19
19
 
@@ -7,7 +7,7 @@ module Update
7
7
  end
8
8
 
9
9
  def update(id, params={})
10
- response = Culqi.connect(@url+id+'/', Culqi.api_key, params, 'patch')
10
+ response = Culqi.connect(@url+id+'/', Culqi.secret_key, params, 'patch', Culqi::READ_TIMEOUT)
11
11
  return response.read_body
12
12
  end
13
13
 
@@ -6,12 +6,12 @@ require 'culqi-ruby'
6
6
 
7
7
  module Culqi
8
8
 
9
- def self.connect(url, api_key, data, type)
9
+ def self.connect(url, api_key, data, type, time_out)
10
10
 
11
11
  url = URI(Culqi::API_BASE+"#{url}")
12
12
 
13
13
  http = Net::HTTP.new(url.host, url.port)
14
- http.read_timeout = Culqi::READ_TIMEOUT
14
+ http.read_timeout = time_out
15
15
  http.use_ssl = true
16
16
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: culqi-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willy Aguirre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Biblioteca de Culqi en Ruby API v2
14
14
  email: