synapse_pay_rest 3.2.4 → 3.2.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: a215c9e2569ad566f5e927cc38cdacfda84c91bd
4
- data.tar.gz: f1b5f7aeb61a1b4694af9a4f61368b836e6e4e05
3
+ metadata.gz: 712e02a3aa89c4f26d4f770a56478c9853bc1a08
4
+ data.tar.gz: 41e153b3fa82b7aefc3714c254088f8674a050c7
5
5
  SHA512:
6
- metadata.gz: 91f2bf21c6f47f257f7890a7767e8d03b7ab912a35648627d373ab65641135bdbd60cb8c5e56ad3c45dcbf9dae95f57710194756cc7963bf3f119985bab79942
7
- data.tar.gz: 1a306b966646b87875557ca03476bfd94ff10bcbb05ab3dc5dac021b1b5369ce9570061ce3181716dfe8291badd70391b339a30e97bbd5c902e0fa5c33b5148f
6
+ metadata.gz: 390d572c5819a1a1d1672869598819ea1182275ab4d5d91eccc667dca3f90955d6c2f4b41932665adc920a0cf391db7a953d70a4998d8eb5350ecd788db00f5e
7
+ data.tar.gz: 8d0b7dd0db5a5794ae2cb3f1dd44e56b5d88c103222f859e4ad2c835568ac2ac804a5c11ff438238dacf57fe3ba9da431aba741fd6e7d9d9edb289c0e7767aaa
@@ -84,7 +84,7 @@ module SynapsePayRest
84
84
  headers = headers.merge({'X-SP-IDEMPOTENCY-KEY' => options[:idempotency_key]})
85
85
  end
86
86
 
87
- response = with_error_handling { RestClient.post(full_url(path), payload.to_json, headers) }
87
+ response = with_error_handling { RestClient::Request.execute(:method => :post, :url => full_url(path), :payload => payload.to_json, :headers => headers, :timeout => 300) }
88
88
  p 'RESPONSE:', JSON.parse(response) if @logging
89
89
  JSON.parse(response)
90
90
  end
@@ -98,7 +98,7 @@ module SynapsePayRest
98
98
  #
99
99
  # @return [Hash] API response
100
100
  def patch(path, payload)
101
- response = with_error_handling { RestClient.patch(full_url(path), payload.to_json, headers) }
101
+ response = with_error_handling { RestClient::Request.execute(:method => :patch, :url => full_url(path), :payload => payload.to_json, :headers => headers, :timeout => 300) }
102
102
  p 'RESPONSE:', JSON.parse(response) if @logging
103
103
  JSON.parse(response)
104
104
  end
@@ -137,6 +137,14 @@ module SynapsePayRest
137
137
 
138
138
  def with_error_handling
139
139
  yield
140
+ rescue RestClient::Exceptions::Timeout
141
+ body = {
142
+ error: {
143
+ en: "Request Timeout"
144
+ },
145
+ http_code: 504
146
+ }
147
+ raise Error.from_response(body)
140
148
  rescue RestClient::Exception => e
141
149
  if e.response.headers[:content_type] == 'application/json'
142
150
  body = JSON.parse(e.response.body)
@@ -1,4 +1,4 @@
1
1
  module SynapsePayRest
2
2
  # Gem version
3
- VERSION = '3.2.4'.freeze
3
+ VERSION = '3.2.5'.freeze
4
4
  end
@@ -7,9 +7,9 @@ Gem::Specification.new do |s|
7
7
  s.name = 'synapse_pay_rest'
8
8
  s.version = SynapsePayRest::VERSION
9
9
  s.date = Date.today.to_s
10
- s.authors = ['Steven Broderick', 'Thomas Hipps']
10
+ s.authors = ['Steven Broderick', 'Nikki Galusha']
11
11
  s.email = 'help@synapsepay.com'
12
- s.summary = 'SynapsePay v3 Rest Native API Library'
12
+ s.summary = 'Synapse v3 Rest Native API Library'
13
13
  s.homepage = 'https://rubygems.org/gems/synapse_pay_rest'
14
14
  s.license = 'MIT'
15
15
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapse_pay_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.4
4
+ version: 3.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Broderick
8
- - Thomas Hipps
8
+ - Nikki Galusha
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-06-02 00:00:00.000000000 Z
12
+ date: 2017-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -207,5 +207,5 @@ rubyforge_project:
207
207
  rubygems_version: 2.6.11
208
208
  signing_key:
209
209
  specification_version: 4
210
- summary: SynapsePay v3 Rest Native API Library
210
+ summary: Synapse v3 Rest Native API Library
211
211
  test_files: []