minfraud 1.0.3 → 1.0.4

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: 967d5c3a89d1b3c4f942ff9d70df4dbe2000e144
4
- data.tar.gz: b7de02371c2585324d45cc6dca04377aabcfdd39
3
+ metadata.gz: 360e5c67027b7cac3bacd6715aa3afee61de8a75
4
+ data.tar.gz: cb6dd240c3436fe0c0c23e7aa6d5ad5c4bcfcae8
5
5
  SHA512:
6
- metadata.gz: b71e904dbc463f9fdae9dfd7be3da2d7eb4486cb7c20cc87bca62230f61df6f20dd24fdb8a8a8677e016689641901516b4585d8324be1f41e3c35404eb23cb1c
7
- data.tar.gz: c60e0d8555746d84cb962f9da024bdd008a056475a756ebbdd9e7f5b3b4041dc0b3448422fdf3fc547065c86c6d087495bb57766d79afe77f705dadc319900fb
6
+ metadata.gz: c3cb59ad5bde816f3b2f8be3cc1f0699ce18c1728a8267d7e827b28e8fecd0a20c638211f453a0f8dee2ea7c252096193293633ca5ecf4e3a640f632e5201dfb
7
+ data.tar.gz: 2b430855a1157e215891a09a1cf0aab79bad1a027e272359a536caf81db8958835e06f591393a9782b22c90655017b91475eff775208f964a4ae0ca44bb1dd43
@@ -1,5 +1,10 @@
1
1
  # Minfraud Changelog
2
2
 
3
+ ## v1.0.4
4
+
5
+ * Prevents boolean value conversion to string to avoid warnings
6
+ * Adds `amount` attribute to the `Minfraud::Components::Order` instances
7
+
3
8
  ## v1.0.3
4
9
  * Adds `token` attribute to the `Minfraud::Components::CreditCard` instances
5
10
  according to the MinFraud Release Notes introduced on November 17, 2016
@@ -16,8 +16,20 @@ module Minfraud
16
16
  # @return [Hash] a hash containing a JSON representation of instance variable name and it's value
17
17
  def populate!(hash, v_sym)
18
18
  return hash unless value = instance_variable_get(v_sym)
19
- hash.merge!(v_sym.to_s.gsub(/@/, '') => value.to_s)
19
+
20
+ key = v_sym.to_s.gsub(/@/, '')
21
+ hash.merge!(key => represent(key, value))
22
+ end
23
+
24
+ # param [Symbol] key instance variable symbol
25
+ # param [Object] value instance variable value
26
+ # @return [Object] value representation according to the request format
27
+ def represent(key, value)
28
+ BOOLS.include?(key) ? value : value.to_s
20
29
  end
30
+
31
+ # Keys that have to remain boolean
32
+ BOOLS = %w(was_authorized is_gift has_gift_message)
21
33
  end
22
34
  end
23
35
  end
@@ -38,6 +38,7 @@ module Minfraud
38
38
  # @param [Hash] params hash of parameters
39
39
  # @return [Minfraud::Components::Order] an Order instance
40
40
  def initialize (params = {})
41
+ @amount = params[:amount]
41
42
  @has_gift_message = params[:has_gift_message]
42
43
  @affiliate_id = params[:affiliate_id]
43
44
  @subaffiliate_id = params[:subaffiliate_id]
@@ -26,6 +26,6 @@ module Minfraud
26
26
  end
27
27
 
28
28
  # Minfraud default server
29
- DEFAULT_SERVER = 'https://minfraud.maxmind.com/minfraud/v2.0'
29
+ DEFAULT_SERVER = 'https://minfraud.maxmind.com/minfraud/v2.0'.freeze
30
30
  end
31
31
  end
@@ -1,3 +1,3 @@
1
1
  module Minfraud
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfraud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kushnir.yb
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2016-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday