gladepay 0.1.3 → 0.1.4

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: a62ee9876e408fdfa5a700f247a41a73f14d4d5a
4
- data.tar.gz: 7aed9bf0cfbe47f679fc4a7b5c6709a472681529
3
+ metadata.gz: f182537d1f4bf218db78a5dff536ad9b6e2a802e
4
+ data.tar.gz: df0df3b9c8a7e9584a18e061fa7d3526e2e77dbc
5
5
  SHA512:
6
- metadata.gz: 22cd7fcf28dfc5afa2d7ec462ae3dedeffef4cc6ced40e7dea9c9e79cb3a2ecca22f50cd9f59eeca7282b9b213f0aec80cc8f0ea99e0e6d527df427f0e14d489
7
- data.tar.gz: 3f5d1d40b5a95e9abe080411247cb56f7943108fa9b333964a9e12ebca5071a0790a66778db06b13604e0cbf82e0dee8be2f685b4a1dd7aac5f4ba5640a36771
6
+ metadata.gz: 6515231b543d9ce4c89cbc3701653062d2642e2029a800190af60e2f45e8aee0c2dfa8a941b8ffcdf3cba641d27b904b60ce0c1c5654fe31869452f8d3705919
7
+ data.tar.gz: 0bc806d636c010a6d0cd0eb6d3a22a9b08dc0c61fbeff86390f062e235de07c6b0208d91211085851d05704016f78fb0408b999e6486f0ee89ee5aaa8426bb0c
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
- # AllCops:
2
- # Exclude:
3
- # - 'bin/**/**'
1
+ AllCops:
2
+ Exclude:
3
+ - 'bin/**/**'
4
4
 
5
5
  Metrics/LineLength:
6
6
  # This will disable the rule completely, regardless what other options you put
data/lib/gladepay.rb CHANGED
@@ -63,9 +63,8 @@ class Gladepay
63
63
  initiate_transaction_response = initiate_transaction(requests)
64
64
 
65
65
  if initiate_transaction_response.key? 'status'
66
- charge_card_response = charge_card(requests, initiate_transaction_response['txnRef'], initiate_transaction_response['apply_auth'])
67
-
68
- if charge_card_response['status'] == 202
66
+ if initiate_transaction_response['status'] == 202
67
+ charge_card_response = charge_card(requests, initiate_transaction_response['txnRef'], initiate_transaction_response['apply_auth'])
69
68
  if charge_card_response.key? 'validate'
70
69
  respond_ar = {
71
70
  'status' => 202,
@@ -287,25 +286,25 @@ class Gladepay
287
286
  def call_put_api(api_method, data = {})
288
287
  result = nil
289
288
  begin
290
- jdata = JSON.generate(data)
291
- base_url_with_method = current_base_url + '/' + api_method
292
- response = RestClient.put base_url_with_method, jdata, content_type: :json, accept: :json, key: @merchant_secret, mid: @merchant_key
289
+ jdata = JSON.generate(data)
290
+ base_url_with_method = current_base_url + '/' + api_method
291
+ response = RestClient.put base_url_with_method, jdata, content_type: :json, accept: :json, key: @merchant_secret, mid: @merchant_key
293
292
 
294
- unless response.code == 200 || response.code == 201
295
- raise GladepayServerError.new(response), 'HTTP Code ' + response.code.to_s + ': ' + response.body.to_s
296
- end
293
+ unless response.code == 200 || response.code == 201
294
+ raise GladepayServerError.new(response), 'HTTP Code ' + response.code.to_s + ': ' + response.body.to_s
295
+ end
297
296
 
298
- result = JSON.parse(response.body)
299
- puts 'CALL_PUT_API:-RESULT ', result
297
+ result = JSON.parse(response.body)
298
+ # puts 'CALL_PUT_API:-RESULT ', result
300
299
 
301
- unless (result.instance_of? Integer) != false
302
- raise GladepayServerError.new(response), 'Server Message: '. result['message'].to_s unless result['status'] != 0
303
- end
304
- rescue JSON::ParserError => jsonerr
305
- raise GladepayServerError.new(response), 'Invalid result data. Could not parse JSON response body \n' + jsonerr.message
306
- rescue GladepayServerError => e
307
- Utils.server_error_handler(e)
300
+ unless (result.instance_of? Integer) != false
301
+ raise GladepayServerError.new(response), 'Server Message: '. result['message'].to_s unless result['status'] != 0
308
302
  end
303
+ rescue JSON::ParserError => jsonerr
304
+ raise GladepayServerError.new(response), 'Invalid result data. Could not parse JSON response body \n' + jsonerr.message
305
+ rescue GladepayServerError => e
306
+ Utils.server_error_handler(e)
307
+ end
309
308
 
310
309
  return result
311
310
  end
@@ -1,3 +1,3 @@
1
1
  class Gladepay
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gladepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chinaka Light
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-03 00:00:00.000000000 Z
11
+ date: 2018-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler