bitpay-rails 2.3.0 → 2.3.1

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
  SHA1:
3
- metadata.gz: 24638db26c6a9bb9e697d776494bbec112993845
4
- data.tar.gz: facba90fe89bc2f47f2f5527ac98f3265966cbcc
3
+ metadata.gz: fccdf6d7a49d29c6f2ba02e4baf525f00bf68e8d
4
+ data.tar.gz: f86495f22cd0b552023d868210681015ddb03853
5
5
  SHA512:
6
- metadata.gz: 09c569a7ed7e60b8694f1ccc5504bc1d3508d33f8b42db78275e2fab8eb776066734b04e0f8f457beb50f149867aa32b847ac8861d32ae5e33b1f519a457bf74
7
- data.tar.gz: 6f2bcbaf2619d9fddecf72d7fa6c6a20024e323d6eac038d20ff14fe98f731381c215f401ac6d490eae9c5e1660ce515872947fa04db7fc4cc29497fbd537512
6
+ metadata.gz: 85c10dd043d9fd1328ef12cfea0a5e3c0d772796fa51f8d2eea401aa7688c05fc739a409869593f225c5e18dbf5e0b2c465a2cd975012d964600e0bb719e499c
7
+ data.tar.gz: c7f8545a98b43ba259109f52500925da0617f52763204b8e5ccb6d9ae9bc16ca7d5784139b26d020b2883ccb94c2950044fe8497534d79312920d24c86dd8da3
@@ -3,11 +3,6 @@ require 'bitpay_sdk'
3
3
  class BitPayClient < ActiveRecord::Base
4
4
  before_create :make_pem
5
5
 
6
- def make_pem
7
- key, crypt = key_and_crypt
8
- pem = BitPay::KeyUtils.generate_pem
9
- self.pem = crypt.encrypt_and_sign(pem)
10
- end
11
6
 
12
7
  def get_pairing_code(params = {})
13
8
  params[:facade] = self.facade
@@ -46,6 +41,12 @@ class BitPayClient < ActiveRecord::Base
46
41
 
47
42
  private
48
43
 
44
+ def make_pem
45
+ key, crypt = key_and_crypt
46
+ pem = BitPay::KeyUtils.generate_pem
47
+ self.pem = crypt.encrypt_and_sign(pem)
48
+ end
49
+
49
50
  def tell_client(method, *args)
50
51
  begin
51
52
  new_client.send(method, *args)
@@ -57,7 +58,9 @@ class BitPayClient < ActiveRecord::Base
57
58
  end
58
59
 
59
60
  def new_client
60
- BitPay::SDK::Client.new(api_uri: self.api_uri, pem: get_pem)
61
+ params = {api_uri: self.api_uri, pem: get_pem}
62
+ params[:insecure] = true if (Rails.env == "development" || Rails.env == "test")
63
+ BitPay::SDK::Client.new(params)
61
64
  end
62
65
 
63
66
  def get_pem
@@ -1,3 +1,3 @@
1
1
  module BitPayRails
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
Binary file