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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51cf90edf6cc8aee813514a8c228ede8e2b7b816fbc16c626453f1329b65bdc3
4
- data.tar.gz: e31d47d8ba5e038c9f8b4d4d6212c51f417347bf63344fb54cdc7c57c4e42c78
3
+ metadata.gz: 52bf59c63646b7d0fd207a51bb3e977e14234edd0d7b4d494967ebde13ead384
4
+ data.tar.gz: 97d45379f6df925b274285ebec7f7b8380396dd3c46162734191b7a6ac03d83b
5
5
  SHA512:
6
- metadata.gz: 1b9eb62afb3ba07284b3d6017b9f70f561c1e98470b95b718514c4b0d85e76655398e6222a14547c5eae77904f523142a857877e0f8fee44209143ef8151a76f
7
- data.tar.gz: 1a08cdad7a12d4e4957059f601a96d0e6bff0c1a3d6a72bd4c9625efa1be4087f40e185ce159a2b60599e5c55f1ca5e8b065306c6c11799e98aeedca32c9e0be
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
- end
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)
@@ -1,3 +1,3 @@
1
1
  module OffsitePayments
2
- VERSION = "2.7.19"
2
+ VERSION = "2.7.20"
3
3
  end
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.19
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-07-11 00:00:00.000000000 Z
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
- rubyforge_project:
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.