offsite_payments 2.7.15 → 2.7.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/offsite_payments/integrations/bit_pay.rb +10 -2
- data/lib/offsite_payments/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e0672a8e0a12267fc92fcc1657e123f0aa8d94fd5304e63b582b3c59d80c81
|
4
|
+
data.tar.gz: 66da21cdb630a27b398df38c11e969af216c37010474d24d490d35b27a9f8f75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0ef98cf6af576f7cc57121980b2b0fdb56017dc3124607db61d3f686cd5b49c4cf2604b7bfb59f8e50b92e4bd456b4d70426bdfc37d8f2378aee48f293487d
|
7
|
+
data.tar.gz: 5568e66d35842b06feb8a359d6c690ceb1d5a3c6621b289d38987122956ab1e0e812df5b224b6c93b22828df6531a3539921ed0f8ebcb4a703ac983c7a5f08ec
|
@@ -71,7 +71,7 @@ module OffsitePayments #:nodoc:
|
|
71
71
|
|
72
72
|
raise ActionViewHelperError, "Invalid response while retrieving BitPay Invoice ID. Please try again." unless invoice
|
73
73
|
|
74
|
-
{"id" => invoice
|
74
|
+
{ "id" => extract_invoice_id(invoice) }
|
75
75
|
end
|
76
76
|
|
77
77
|
private
|
@@ -85,7 +85,7 @@ module OffsitePayments #:nodoc:
|
|
85
85
|
request.content_type = "application/json"
|
86
86
|
request.body = @fields.to_json
|
87
87
|
|
88
|
-
unless v2_api_token?(@account)
|
88
|
+
unless BitPay.v2_api_token?(@account)
|
89
89
|
request.add_field("x-bitpay-plugin-info", "BitPay_Shopify_Client_v2.0.1906")
|
90
90
|
request.basic_auth @account, ''
|
91
91
|
end
|
@@ -93,6 +93,14 @@ module OffsitePayments #:nodoc:
|
|
93
93
|
response = http.request(request)
|
94
94
|
JSON.parse(response.body)
|
95
95
|
end
|
96
|
+
|
97
|
+
def extract_invoice_id(invoice)
|
98
|
+
if BitPay.v2_api_token?(@account)
|
99
|
+
invoice['data']['id']
|
100
|
+
else
|
101
|
+
invoice['id']
|
102
|
+
end
|
103
|
+
end
|
96
104
|
end
|
97
105
|
|
98
106
|
class Notification < OffsitePayments::Notification
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: offsite_payments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|