offsite_payments 2.7.15 → 2.7.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b08eae660757656fe9f67b2c2cc31dd8812bd20bb655f0f0a99d98a5ec15ed25
4
- data.tar.gz: 3f660794dae2b6ae8c6a0584d22f1c47e21bf609863ef65c3ab720b383d65737
3
+ metadata.gz: a2e0672a8e0a12267fc92fcc1657e123f0aa8d94fd5304e63b582b3c59d80c81
4
+ data.tar.gz: 66da21cdb630a27b398df38c11e969af216c37010474d24d490d35b27a9f8f75
5
5
  SHA512:
6
- metadata.gz: 37ea3d57a832e4c077445054584b61ad32e7860835beebd79dcf703a5bd8db0938f7aaf9f1bb3313a710f11aca6fba929ce10590f678f793d8215babb202946d
7
- data.tar.gz: 2771bd599f5642e9353668d8190c5869a8b7b48ebded85cc3bc23df7c37c0312d5c07899429574c3795194f85c0186e922c9726582c55830829d6efd8d500977
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['id']}
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
@@ -1,3 +1,3 @@
1
1
  module OffsitePayments
2
- VERSION = "2.7.15"
2
+ VERSION = "2.7.16"
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.15
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-18 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport