activemerchant-flexpay 0.9.0 → 1.0.0

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
  SHA256:
3
- metadata.gz: 3c1fd59ee965107b927a8b4dc23bde928b172dd52b2d866829d920ca1b5af508
4
- data.tar.gz: ca7876e6ea2082df8969d8b669d710fba8b98305aee1da00c0771f483f6f18dd
3
+ metadata.gz: 1c000879c1968bd7fddcde0370445045ef8ec1fa34fcec6f736b1f314e5d3d51
4
+ data.tar.gz: 0db12756cf32aa195398c5015ffa63a83ee88c8da0455199287608a4294b5a9b
5
5
  SHA512:
6
- metadata.gz: 529a8303c4e94056262291e814b13463ced99f7dd0fa98c34e2d384300661032c12984ddd94ff236bc18757f6b94623234ed9ea24fe71842a4e925cf6aa826f9
7
- data.tar.gz: 306e4e57ce813b46dbfe03636d69f8a11cec67f168db458b3a0bbc6fad19b56ae077ea1131d8d9b1fbe82e153dba1505e6b6eb874c54bc55c7fcdea68655793d
6
+ metadata.gz: f86cd342fe4e3c5b42880f956ffca665a4c39bc772c491c31dcd88955d8dcfdeede605f8e5bcb4db463876de2f3443ecda6538621a80a5b206d764c91b9350cc
7
+ data.tar.gz: f6071fb1bd99e930937cea11dac03a35d290e6eb87c74cf7eabe9df83dab8df0fce036ee64fec469489f27cc8140910b3c3da8749fb1b34b072762b5635e8e5b
@@ -39,7 +39,7 @@ module ActiveMerchant #:nodoc:
39
39
  def purchase(money, payment, options={})
40
40
  post = {}
41
41
  add_invoice(post, money, options)
42
- add_payment(post, payment)
42
+ add_payment(post, payment, options)
43
43
  add_address(post, payment, options)
44
44
  add_customer_data(post, options)
45
45
 
@@ -49,7 +49,7 @@ module ActiveMerchant #:nodoc:
49
49
  def authorize(money, payment, options={})
50
50
  post = {}
51
51
  add_invoice(post, money, options)
52
- add_payment(post, payment)
52
+ add_payment(post, payment, options)
53
53
  add_address(post, payment, options)
54
54
  add_customer_data(post, options)
55
55
 
@@ -97,11 +97,10 @@ module ActiveMerchant #:nodoc:
97
97
  private
98
98
 
99
99
  def add_customer_data(post, options)
100
- if options[:email].present?
101
- post[:paymentMethod][:email] = options[:email]
102
- else
103
- post[:customerId] = options[:customer_id] || generate_unique_id
104
- end
100
+ post[:customerId] = options[:customer_id] if options[:customer_id].present?
101
+ post[:paymentMethod][:email] = options[:email] if options[:email].present?
102
+ post[:customerId] ||= generate_unique_id if options[:email].blank?
103
+
105
104
  add_shipping_address(post, options[:shipping_address]) if options[:shipping_address]
106
105
  end
107
106
 
@@ -134,15 +133,15 @@ module ActiveMerchant #:nodoc:
134
133
  post[:referenceData] = options[:reference_data] if options[:reference_data]
135
134
  end
136
135
 
137
- def add_payment(post, payment)
138
- post[:retainOnSuccess] = 'true'
136
+ def add_payment(post, payment, options)
139
137
  post[:paymentMethod] = {
140
138
  creditCardNumber: payment.number,
141
- expiryMonth: payment.month,
139
+ expiryMonth: '%02d' % payment.month,
142
140
  expiryYear: payment.year,
143
141
  cvv: payment.verification_value,
144
142
  fullName: payment.name
145
143
  }
144
+ post[:retainOnSuccess] = options[:store] ? true : false
146
145
  end
147
146
 
148
147
  def headers(api_key)
@@ -1,5 +1,5 @@
1
1
  module ActiveMerchant
2
2
  module FlexPay
3
- VERSION = "0.9.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant-flexpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.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-09-11 00:00:00.000000000 Z
11
+ date: 2019-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant