offsite_payments 2.7.19 → 2.7.20
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 +12 -7
- data/lib/offsite_payments/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52bf59c63646b7d0fd207a51bb3e977e14234edd0d7b4d494967ebde13ead384
|
4
|
+
data.tar.gz: 97d45379f6df925b274285ebec7f7b8380396dd3c46162734191b7a6ac03d83b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85fc3bf1c22cdf71b0a4497b44eecb9406f5ff1538eb4d50ea9a26212a13002f8b8a59fc71e5ac2d7d037dda6a39ef7dbae4ec10d2faed2431d736c95565240e
|
7
|
+
data.tar.gz: ba78f07a16f201b9607a98088c4c9173d855ef59ce34e7086334380ff5349d9a6772aea721f2be5bf1b99529061ad10347c9f97ff78e2a80145e0a78378cd051
|
@@ -41,7 +41,7 @@ module OffsitePayments #:nodoc:
|
|
41
41
|
add_field('fullNotifications', true)
|
42
42
|
add_field('transactionSpeed', 'high')
|
43
43
|
add_field('token', account)
|
44
|
-
|
44
|
+
end
|
45
45
|
|
46
46
|
mapping :amount, 'price'
|
47
47
|
mapping :order, 'orderID'
|
@@ -73,9 +73,18 @@ module OffsitePayments #:nodoc:
|
|
73
73
|
|
74
74
|
{ "id" => extract_invoice_id(invoice) }
|
75
75
|
end
|
76
|
-
|
77
76
|
private
|
78
77
|
|
78
|
+
def add_plugin_info(request)
|
79
|
+
#add plugin info for v1 and v2 tokens
|
80
|
+
if BitPay.v2_api_token?(@account)
|
81
|
+
request.add_field("x-bitpay-plugin-info", "BitPay_AM" + application_id + "_Client_v2.0.1909")
|
82
|
+
else
|
83
|
+
request.add_field("x-bitpay-plugin-info", "BitPay_AM" + application_id + "_Client_v1.0.1909")
|
84
|
+
request.basic_auth @account, ''
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
79
88
|
def create_invoice
|
80
89
|
uri = URI.parse(BitPay.invoicing_url(@account))
|
81
90
|
http = Net::HTTP.new(uri.host, uri.port)
|
@@ -84,11 +93,7 @@ module OffsitePayments #:nodoc:
|
|
84
93
|
request = Net::HTTP::Post.new(uri.request_uri)
|
85
94
|
request.content_type = "application/json"
|
86
95
|
request.body = @fields.to_json
|
87
|
-
|
88
|
-
unless BitPay.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
|
96
|
+
add_plugin_info(request)
|
92
97
|
|
93
98
|
response = http.request(request)
|
94
99
|
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.20
|
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-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -299,8 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
299
|
- !ruby/object:Gem::Version
|
300
300
|
version: '0'
|
301
301
|
requirements: []
|
302
|
-
|
303
|
-
rubygems_version: 2.7.6
|
302
|
+
rubygems_version: 3.0.3
|
304
303
|
signing_key:
|
305
304
|
specification_version: 4
|
306
305
|
summary: Framework and tools for dealing with offsite (hosted) payment pages.
|