effective_orders 6.19.3 → 6.19.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 +4 -4
- data/app/models/effective/deluxe_api.rb +20 -1
- data/lib/effective_orders/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ac540563873add27dbdaae886f216f3c20e0abe562476d7736e7c8ff73c04b2
|
4
|
+
data.tar.gz: 562b4bd4ecb4204e44f8910e4f633932ab172c3a377f2662beaefdd733e4e505
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6e7dca80311b8aa229dbba54979ff85319035d2ee7b61c7b65d7cff7502207d7a882a82921011f4680ba337d39e6d84cf4cbe8bb9137df2fe844c2fa9edcb13
|
7
|
+
data.tar.gz: 35e988323e5dd995719e34ad8b8a0976f32185c31fa82001604fb077b9801f7d933a40b9bcd50c9193607bb1c83dee1fceae26c5267506ba2d980cbad7861d1a
|
@@ -100,7 +100,7 @@ module Effective
|
|
100
100
|
|
101
101
|
# Create Payment
|
102
102
|
def create_payment(order, payment_intent)
|
103
|
-
response =
|
103
|
+
response = post_once('/payments', params: create_payment_params(order, payment_intent))
|
104
104
|
|
105
105
|
# Sanity check response
|
106
106
|
raise('expected responseCode') unless response.kind_of?(Hash) && response['responseCode'].present?
|
@@ -386,6 +386,25 @@ module Effective
|
|
386
386
|
http.read_timeout = (read_timeout || 30)
|
387
387
|
http.use_ssl = true
|
388
388
|
|
389
|
+
result = with_retries do
|
390
|
+
puts "[POST] #{uri} #{params}" if Rails.env.development?
|
391
|
+
|
392
|
+
response = http.post(uri.path, params.to_json, headers)
|
393
|
+
raise Exception.new("#{response.code} #{response.body}") unless response.code == '200'
|
394
|
+
|
395
|
+
response
|
396
|
+
end
|
397
|
+
|
398
|
+
JSON.parse(result.body)
|
399
|
+
end
|
400
|
+
|
401
|
+
def post_once(endpoint, params:)
|
402
|
+
uri = URI.parse(api_url + endpoint)
|
403
|
+
|
404
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
405
|
+
http.read_timeout = (read_timeout || 30)
|
406
|
+
http.use_ssl = true
|
407
|
+
|
389
408
|
puts "[POST] #{uri} #{params}" if Rails.env.development?
|
390
409
|
|
391
410
|
response = http.post(uri.path, params.to_json, headers)
|