compropago_sdk 3.0.0 → 3.0.1

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: 7f76ff9703f043e408818d70c0ff1cf3f5b5e975
4
- data.tar.gz: 9e9a05ddea2fd99e70c1db4bece1a437cc5da9b4
3
+ metadata.gz: c848b818d6e279df0ca1d35864bc5ffab264ec8c
4
+ data.tar.gz: 7830124fc905830f1f86ad0e1a2be3381cd4bf3c
5
5
  SHA512:
6
- metadata.gz: a205853520d63483f431532d0ed0f89e955962c76b0f93ef627f39802fb9310d157a9151ca134042b6092a667caf71496c76953e8c16f65f0b1802279b0daeff
7
- data.tar.gz: c087cbfa1e9b695cad042d522169585791399d22cc7b051c96a189264e4ff081066108bb3cd5564024d2405213d90d7093b520068a93f4499e782b35d07e8a72
6
+ metadata.gz: 7aafe315ce49db793838e17b931288c06499e9fa6c8ace2d758ead853a4c89e766470f335d62994e29e9889e5b16248158aec586fafcbed6003e92ceaf86b7c6
7
+ data.tar.gz: 40626788d8723fa55d80d88e1c40f6b4dbbe3c33419772c4dee069bdff894f02208f95568bc261952c5975a5c93dd5e561126df1c52b45efbcadfefd066fe5ca
@@ -24,8 +24,4 @@ class Client
24
24
  @publickey
25
25
  end
26
26
 
27
- def get_full_auth
28
- @privatekey+':'+@publickey
29
- end
30
-
31
27
  end
@@ -1,9 +1,11 @@
1
1
  module CpConfigSdk
2
2
 
3
3
  API_LIVE_URI = 'https://api.compropago.com/v1/'
4
-
5
4
  API_SANDBOX_URI = 'https://api.compropago.com/v1/'
6
5
 
7
- VERSION = '3.0.0'
6
+ #API_LIVE_URI = 'https://api-staging-compropago.herokuapp.com/v1/'
7
+ #API_SANDBOX_URI = 'https://api-staging-compropago.herokuapp.com/v1/'
8
+
9
+ VERSION = '3.0.1'
8
10
 
9
11
  end
@@ -4,9 +4,8 @@ class Service
4
4
  @client = client
5
5
  end
6
6
 
7
- def list_providers(auth=false, limit=0)
7
+ def list_providers(auth=false, limit=0, currency='MXN')
8
8
  if auth
9
- Validations::validate_gateway @client
10
9
  uri = @client.deploy_uri+'providers/'
11
10
  keys = {user: @client.get_user, pass: @client.get_pass}
12
11
  else
@@ -18,14 +17,16 @@ class Service
18
17
  uri = uri+'?order_total='+limit.to_s
19
18
  end
20
19
 
20
+ if limit > 0 && !currency.nil? && currency != 'MXN'
21
+ uri = uri+'&currency='+currency
22
+ end
23
+
21
24
  response = Request::get(uri, keys)
22
25
 
23
26
  Factory::get_instance_of 'ListProviders', response
24
27
  end
25
28
 
26
29
  def verify_order(order_id)
27
- Validations::validate_gateway @client
28
-
29
30
  response = Request::get(
30
31
  @client.deploy_uri+'charges/'+order_id+'/',
31
32
  user: @client.get_user, pass: @client.get_pass
@@ -39,8 +40,6 @@ class Service
39
40
  raise 'Order object is not valid'
40
41
  end
41
42
 
42
- Validations::validate_gateway @client
43
-
44
43
  params = {
45
44
  order_id: order.order_id,
46
45
  order_name: order.order_name,
@@ -64,8 +63,6 @@ class Service
64
63
  end
65
64
 
66
65
  def send_sms_instructions(number, order_id)
67
- Validations::validate_gateway @client
68
-
69
66
  params = {customer_phone: number}
70
67
 
71
68
  response = Request::post(
@@ -78,8 +75,6 @@ class Service
78
75
  end
79
76
 
80
77
  def create_webhook(url)
81
- Validations::validate_gateway @client
82
-
83
78
  params = {url: url}
84
79
 
85
80
  response = Request::post(
@@ -92,8 +87,6 @@ class Service
92
87
  end
93
88
 
94
89
  def update_webhook(webhook_id, new_url)
95
- Validations::validate_gateway @client
96
-
97
90
  params = {url: new_url}
98
91
 
99
92
  response = Request::put(
@@ -106,8 +99,6 @@ class Service
106
99
  end
107
100
 
108
101
  def delete_webhook(webhook_id)
109
- Validations::validate_gateway @client
110
-
111
102
  response = Request::delete(
112
103
  @client.deploy_uri+'webhooks/stores/'+webhook_id,
113
104
  nil,
@@ -118,8 +109,6 @@ class Service
118
109
  end
119
110
 
120
111
  def list_webhooks
121
- Validations::validate_gateway @client
122
-
123
112
  response = Request::get(
124
113
  @client.deploy_uri+'webhooks/stores/',
125
114
  user: @client.get_user, pass: @client.get_pass
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compropago_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Aguilar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-26 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler