amex_enhanced_authorization 0.3.0 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f402f2265b926978d32b0976f29c7bc4d8535f6a76fc2f109d7778fcb29805f
|
4
|
+
data.tar.gz: 5363b476e36605073ff89aef3aeaeedd99bcafce9729a7a22438414360e02cd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43c6f84d6714511a6b2234d79697d007703fb79ef991ae6b06fa5fa5fd1a026be4ec4c0eee6b80def57620681b0354f3a56953d8a40e3c6075c1ce1d3e135c1f
|
7
|
+
data.tar.gz: acf33b2c5933588ba151cc74e8abc0d9d54a54742e97c2cbd586645fc32b4c7a608a7796f034717ac23c6123103bd99a9dcb6f6a79c6993bfaa5f0d0ab84fe7d
|
@@ -33,21 +33,25 @@ module AmexEnhancedAuthorization
|
|
33
33
|
def purchaser_information
|
34
34
|
@purchaser_information ||= {
|
35
35
|
customer_email: customer_email,
|
36
|
-
billing_address:
|
37
|
-
billing_postal_code: billing_postal_code,
|
38
|
-
billing_first_name: billing_first_name,
|
39
|
-
billing_last_name:
|
36
|
+
billing_address: munge(billing_address, /[^A-Za-z0-9 ]/, 70),
|
37
|
+
billing_postal_code: munge(billing_postal_code, /[^A-Za-z0-9\- ]/, 9),
|
38
|
+
billing_first_name: munge(billing_first_name, /[^A-Za-z0-9 ]/, 30),
|
39
|
+
billing_last_name: munge(billing_last_name, /[^A-Za-z0-9 ]/, 30),
|
40
40
|
billing_phone_number: billing_phone_number,
|
41
|
-
shipto_address: shipto_address,
|
41
|
+
shipto_address: munge(shipto_address, /[^A-Za-z0-9 ]/, 50),
|
42
42
|
shipto_postal_code: shipto_postal_code,
|
43
43
|
shipto_first_name: shipto_first_name,
|
44
|
-
shipto_last_name:
|
44
|
+
shipto_last_name: munge(shipto_last_name, /[^A-Za-z0-9 ]/, 30),
|
45
45
|
shipto_phone_number: shipto_phone_number,
|
46
46
|
shipto_country_code: shipto_country_code,
|
47
47
|
device_ip: device_ip,
|
48
48
|
}.compact
|
49
49
|
end
|
50
50
|
|
51
|
+
def munge(s, exp, length)
|
52
|
+
s && ascify(s).gsub(exp, ' ')[0..(length-1)]
|
53
|
+
end
|
54
|
+
|
51
55
|
def ascify(s)
|
52
56
|
s && s.tr(
|
53
57
|
"ÀÁÂÃÄÅàáâãäåĀāĂ㥹ÇçĆćĈĉĊċČčÐðĎďĐđÈÉÊËèéêëĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħÌÍÎÏìíîïĨĩĪīĬĭĮįİıĴĵĶķĸĹĺĻļĽľĿŀŁłÑñŃńŅņŇňʼnŊŋÒÓÔÕÖØòóôõöøŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞşŠšſŢţŤťŦŧÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųŴŵÝýÿŶŷŸŹźŻżŽž",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amex_enhanced_authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piers Chambers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|