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: a9eae2794641cb519d74cb5cd54fb67886e4137511e0cd8e27a4f9e132441c76
4
- data.tar.gz: 520b3cfc160be5885d5da1e632e04fb16d4b9d7eff5a0e465eed88b96c40afd4
3
+ metadata.gz: 62bfe907e250a2a7984b6934d72f6d6227f8f91c374887582657aaebedfaf30e
4
+ data.tar.gz: 13d4cbb6522f003de5002a5a5802c6b947f8f5d012b8bc65006f4332eadf6e39
5
5
  SHA512:
6
- metadata.gz: b4488bbe0aa4e996e3c7fac4f374fa457726ef34416a737dad4956f229d3d6f4bb061eb1eb7ca5cf03751bb1467c8e2196ffc6435a8647207d8706ccb56a60b8
7
- data.tar.gz: d71769a9438f9b596f685e2d8a0afd140633861ff43a46376c7e1e8a1ec8e0bf6beef590240d755f85c44e140eef43dcba555544edb657f4a70b2bc84318a7df
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.utc.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
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: timestamp.utc.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
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,
@@ -1,3 +1,3 @@
1
1
  module AmexEnhancedAuthorization
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-13 00:00:00.000000000 Z
11
+ date: 2019-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler