offsite_payments 2.7.13 → 2.7.14
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 +7 -3
- 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: 1bc4531ed0ce30dfccdf87dfeba05cfa0c546a729d51ace52ab1b3b2f39b6f14
|
4
|
+
data.tar.gz: c5beb060a74becd03b15edaeb01154284a3638e2cc6268b3457b637c9e2aa301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2f8e5cc845d37ef693636ff111f7ca2255ca33fecb39e4f8d87e7c49a089ead21e917d15571769ee478fece7d044fe699a04f04f7d28c2e87dbbd6ca90c7522
|
7
|
+
data.tar.gz: 46c08d37fabc1f3d1d3398a4b9e6e21cc659b9aa65f7391c445db3914d965609496462630e181efa469ca4349493ba4a9e00547bbb763e620544aaa953003a0c
|
@@ -2,7 +2,7 @@ module OffsitePayments #:nodoc:
|
|
2
2
|
module Integrations #:nodoc:
|
3
3
|
module BitPay
|
4
4
|
API_V1_URL = 'https://bitpay.com/api/invoice'
|
5
|
-
|
5
|
+
API_V2_TOKEN_REGEX = /^[^0OIl]{44,}$/
|
6
6
|
API_V2_URL = 'https://bitpay.com/invoices'
|
7
7
|
|
8
8
|
mattr_accessor :service_url
|
@@ -21,7 +21,7 @@ module OffsitePayments #:nodoc:
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.v2_api_token?(api_token)
|
24
|
-
|
24
|
+
API_V2_TOKEN_REGEX.match(api_token)
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.invoicing_url(api_token)
|
@@ -84,7 +84,11 @@ module OffsitePayments #:nodoc:
|
|
84
84
|
request = Net::HTTP::Post.new(uri.request_uri)
|
85
85
|
request.content_type = "application/json"
|
86
86
|
request.body = @fields.to_json
|
87
|
-
|
87
|
+
|
88
|
+
unless v2_api_token?(@account)
|
89
|
+
request.add_field("x-bitpay-plugin-info", "BitPay_Shopify_Client_v2.0.1906")
|
90
|
+
request.basic_auth @account, ''
|
91
|
+
end
|
88
92
|
|
89
93
|
response = http.request(request)
|
90
94
|
JSON.parse(response.body)
|
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.14
|
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-
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|