amex_enhanced_authorization 0.1.0 → 0.1.1
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: 62bfe907e250a2a7984b6934d72f6d6227f8f91c374887582657aaebedfaf30e
|
4
|
+
data.tar.gz: 13d4cbb6522f003de5002a5a5802c6b947f8f5d012b8bc65006f4332eadf6e39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3c1f076f4f70d7ce2b4f0e51d5227ff3766310948aaad56d96e17856bc57a955022663542f96025c650bea7ef05edf675d35504d957a31c820892bb141fd977
|
7
|
+
data.tar.gz: 36e04d15357ce9955a662e70ec2362ef491e178baa656dd2901d5e98032f09a333a53aa0cb2efc573ac8d1f26a36d71904f65f051a2c099a42435d5f27d0206f
|
@@ -13,13 +13,13 @@ module AmexEnhancedAuthorization
|
|
13
13
|
|
14
14
|
def to_json
|
15
15
|
payload = {
|
16
|
-
timestamp: Time.now
|
16
|
+
timestamp: strftime(Time.now),
|
17
17
|
transaction_data: {
|
18
|
-
card_acceptor_id: card_acceptor_id, # aka. SE10 or Merchant code
|
18
|
+
card_acceptor_id: card_acceptor_id.to_s, # aka. SE10 or Merchant code
|
19
19
|
card_number: card_number,
|
20
|
-
amount: amount,
|
20
|
+
amount: amount.to_s,
|
21
21
|
currency_code: currency_code,
|
22
|
-
transaction_timestamp:
|
22
|
+
transaction_timestamp: strftime(timestamp),
|
23
23
|
additional_information: { risk_score: true },
|
24
24
|
}
|
25
25
|
}
|
@@ -45,5 +45,9 @@ module AmexEnhancedAuthorization
|
|
45
45
|
shipto_country_code: shipto_country_code,
|
46
46
|
}.compact
|
47
47
|
end
|
48
|
+
|
49
|
+
def strftime(timestamp)
|
50
|
+
timestamp.utc.strftime('%Y-%m-%dT%H:%M:%S.%L%Z')
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
@@ -21,7 +21,7 @@ module AmexEnhancedAuthorization
|
|
21
21
|
|
22
22
|
def headers
|
23
23
|
Hash[
|
24
|
-
'Content-Type' => 'application/json',
|
24
|
+
'Content-Type' => 'application/json; charset=utf-8',
|
25
25
|
'Content-Language' => 'en-US',
|
26
26
|
'x-amex-api-key' => client_id,
|
27
27
|
'x-amex-request-id' => SecureRandom.uuid,
|
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.1.
|
4
|
+
version: 0.1.1
|
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-05-
|
11
|
+
date: 2019-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|