aliquot-pay 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aliquot-pay.rb +10 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c5bffd61e042fd964cca3d4c766cd63ce6e5434602f28cf17e54a70db6001e1
4
- data.tar.gz: 0b4c0729cba721c98abe88b1bd7ef70a1205acf71f6eba6f03d77e66bc01f252
3
+ metadata.gz: df10b773da7321ea564c012fd5d487c07c0779ced77d1535e3b3a10691157b39
4
+ data.tar.gz: c6231c0006e33298f414ced2e286ac45ef4df5f16a2efa633a8025e1373fca15
5
5
  SHA512:
6
- metadata.gz: e095b875006d99d6e95d6768d482848ba7c304241f72653be631386ac6c2b56b01a79e4d2980c098e6329e2e34635ab11f8569f576389456439d3bf9760e4f3c
7
- data.tar.gz: b9f02b833e505701d13262d0888168b195f0672d29ab4df64e437189e7d9302765885e0a74bdd992fada5793a4b60006b1febdfa77769aa3c36ee73a84d587ee
6
+ metadata.gz: 32790400342af932a01adeaaf8cb0ed943ffe2343954972deb4d20f7e5e34482ff71ab924f395221db3affd0128cfeb8b6ae95cc19d1c19dbcedde0d2ca963a6
7
+ data.tar.gz: 23aa8bec6cb97d8ec513e1fb6323f35b60f7ad1baca8627d4091e2898b1d1a03f38882b1949f34f56064bde33ba330978b84b0a69c0f321c35639bba26539d02
data/lib/aliquot-pay.rb CHANGED
@@ -18,7 +18,7 @@ class AliquotPay
18
18
  attr_accessor :signed_key, :signatures
19
19
  attr_accessor :key_expiration, :key_value
20
20
  attr_accessor :encrypted_message, :cleartext_message, :ephemeral_public_key, :tag
21
- attr_accessor :message_expiration, :message_id, :payment_method, :payment_method_details
21
+ attr_accessor :message_expiration, :message_id, :payment_method, :payment_method_details, :gateway_merchant_id
22
22
  attr_accessor :pan, :expiration_month, :expiration_year, :auth_method
23
23
  attr_accessor :cryptogram, :eci_indicator
24
24
 
@@ -116,6 +116,7 @@ class AliquotPay
116
116
 
117
117
  def build_cleartext_message
118
118
  return @cleartext_message if @cleartext_message
119
+
119
120
  default_message_id = Base64.strict_encode64(OpenSSL::Random.random_bytes(24))
120
121
  default_message_expiration = ((Time.now.to_f + 60 * 5) * 1000).round.to_s
121
122
 
@@ -125,6 +126,14 @@ class AliquotPay
125
126
  'paymentMethod' => @payment_method || 'CARD',
126
127
  'paymentMethodDetails' => build_payment_method_details
127
128
  }
129
+
130
+ if @protocol_version == :ECv2
131
+ @cleartext_message.merge!(
132
+ 'gatewayMerchantId' => @gateway_merchant_id || 'SOME GATEWAY MERCHANT ID'
133
+ )
134
+ end
135
+
136
+ @cleartext_message
128
137
  end
129
138
 
130
139
  def build_signed_message
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliquot-pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clearhaus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hkdf