paymentsds-mpesa 0.1.0.pre.alpha.19 → 0.1.0.pre.alpha.24

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
  SHA256:
3
- metadata.gz: 1f0364f9357704edbf07afe62297cdfb2c534bea9f3d05d8edf989f9c63461d6
4
- data.tar.gz: f2df7bdb63e54e7c7ef37169e6412372390c6a38f5c75a182f7ad2cc2e291ced
3
+ metadata.gz: ac19c06619d908dd6793d11cd47eee50653e7b7ff1a4a531f14d5e23622038e1
4
+ data.tar.gz: 309c4ec2f7b3a57bafd47e15c731bca9c0be66a6b6349b7ae395060377837272
5
5
  SHA512:
6
- metadata.gz: 0d0ea750af84b76fec4662e76b9e4c825194a475a99a621f37acb97727fa73f5784aa5f400fe86d8b9727f44a11483b4f71d0c9a0ce59d91b5e113a8c27a9cc1
7
- data.tar.gz: 290ac9205e5b9c2669682edc791800eab9b9e9a8c81504b9b4dba76828e17cf2703880f5dc9c190808f8b442cb28f5b65771b24aa2a7771daa8f7433b623b914
6
+ metadata.gz: 18aba3c12a9d75a08d639f18bf78552b84bf42935e1496acbeef9e3dcabc095fcf5458ea84012408047fd2a16f915c9fa7c3f3467202fbe4a258680bf40eecb1
7
+ data.tar.gz: fa82503513c9d85bb652ef783984e885f07af98aa4fa939efb7d6eca8912458649b8ed34f15bb14c9bc5bd351cc67e174776c345b41c4bdf19a8002103ded654
@@ -24,8 +24,7 @@ module Paymentsds
24
24
  @user_agent = 'Paymentsds Ruby'
25
25
  @origin = "*"
26
26
  @verify_ssl = false
27
- @timeout = 0
28
- @environment =
27
+ @timeout = 10
29
28
 
30
29
  yield(self) if block_given?
31
30
  end
@@ -4,10 +4,14 @@ module Paymentsds
4
4
  attr_accessor :scheme
5
5
  attr_accessor :domain
6
6
 
7
- def initialize(scheme, dommain)
7
+ def initialize(scheme, domain)
8
8
  @scheme = scheme
9
9
  @domain = domain
10
10
  end
11
+
12
+ def to_url
13
+ "#{@scheme}://#{@domain}"
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -138,12 +138,12 @@ module Paymentsds
138
138
  generate_access_token
139
139
 
140
140
  request_data = {
141
- base_url: "#{@config.environment.scheme}://#{@config.environment.domain}:#{operation[:port]}",
141
+ base_url: "#{@config.environment.to_url}:#{operation[:port]}",
142
142
  url: operation[:path],
143
143
  method: operation[:method],
144
144
  path: operation[:path],
145
145
  headers: build_request_headers,
146
- timeout: @config.timeout * 1000,
146
+ timeout: @config.timeout,
147
147
  body: build_request_body(opcode, intent)
148
148
  }
149
149
 
@@ -174,10 +174,12 @@ module Paymentsds
174
174
  end
175
175
  end
176
176
 
177
- bulid_response(response)
177
+ build_response(response)
178
178
  end
179
179
 
180
180
  def build_response(result)
181
+ puts result.inspect
182
+
181
183
  if result.status >= 200 && result.status < 300
182
184
  response = Paymentsds::MPesa::Response.new(result.success?, nil, result.data)
183
185
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Paymentsds
4
4
  module MPesa
5
- VERSION = '0.1.0.pre.alpha.19'
5
+ VERSION = '0.1.0.pre.alpha.24'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paymentsds-mpesa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.19
4
+ version: 0.1.0.pre.alpha.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edson Michaque