activemerchant 1.101.0 → 1.102.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +15 -0
- data/README.md +1 -1
- data/lib/active_merchant/billing/credit_card.rb +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
- data/lib/active_merchant/billing/gateway.rb +7 -6
- data/lib/active_merchant/billing/gateways/adyen.rb +2 -2
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +1 -1
- data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -56
- data/lib/active_merchant/billing/gateways/balanced.rb +14 -12
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +19 -19
- data/lib/active_merchant/billing/gateways/blue_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/card_stream.rb +1 -1
- data/lib/active_merchant/billing/gateways/cardknox.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +5 -5
- data/lib/active_merchant/billing/gateways/cc5.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -26
- data/lib/active_merchant/billing/gateways/checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +3 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +9 -8
- data/lib/active_merchant/billing/gateways/creditcall.rb +2 -2
- data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/culqi.rb +11 -10
- data/lib/active_merchant/billing/gateways/cyber_source.rb +8 -8
- data/lib/active_merchant/billing/gateways/efsnet.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +9 -8
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
- data/lib/active_merchant/billing/gateways/finansbank.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +9 -8
- data/lib/active_merchant/billing/gateways/garanti.rb +1 -1
- data/lib/active_merchant/billing/gateways/global_collect.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +10 -10
- data/lib/active_merchant/billing/gateways/iridium.rb +1 -1
- data/lib/active_merchant/billing/gateways/iveri.rb +1 -1
- data/lib/active_merchant/billing/gateways/ixopay.rb +287 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +6 -6
- data/lib/active_merchant/billing/gateways/litle.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +4 -4
- data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -2
- data/lib/active_merchant/billing/gateways/micropayment.rb +1 -1
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
- data/lib/active_merchant/billing/gateways/moneris.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris_us.rb +4 -4
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
- data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
- data/lib/active_merchant/billing/gateways/nmi.rb +3 -3
- data/lib/active_merchant/billing/gateways/ogone.rb +12 -11
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +19 -18
- data/lib/active_merchant/billing/gateways/orbital.rb +13 -11
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +8 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +5 -5
- data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_junction.rb +11 -10
- data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -2
- data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_in.rb +15 -14
- data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/pro_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickbooks.rb +19 -12
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +12 -12
- data/lib/active_merchant/billing/gateways/s5.rb +1 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +3 -3
- data/lib/active_merchant/billing/gateways/sage.rb +4 -4
- data/lib/active_merchant/billing/gateways/sage_pay.rb +7 -6
- data/lib/active_merchant/billing/gateways/secure_net.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -1
- data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -5
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +15 -14
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +10 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/response.rb +2 -2
- data/lib/active_merchant/connection.rb +26 -25
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- metadata +3 -2
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
|
|
62
62
|
post[:address1] = address[:address1].to_s
|
63
63
|
post[:address2] = address[:address2].to_s
|
64
64
|
post[:city] = address[:city].to_s
|
65
|
-
post[:state] = (address[:state].blank?
|
65
|
+
post[:state] = (address[:state].blank? ? 'n/a' : address[:state])
|
66
66
|
post[:zip] = address[:zip].to_s
|
67
67
|
post[:country] = address[:country].to_s
|
68
68
|
post[:phone] = address[:phone].to_s
|
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
|
|
78
78
|
post[:shipping_address2] = address[:address2].to_s
|
79
79
|
post[:shipping_city] = address[:city].to_s
|
80
80
|
post[:shipping_country] = address[:country].to_s
|
81
|
-
post[:shipping_state] = (address[:state].blank?
|
81
|
+
post[:shipping_state] = (address[:state].blank? ? 'n/a' : address[:state])
|
82
82
|
post[:shipping_zip] = address[:zip].to_s
|
83
83
|
post[:shipping_email] = address[:email].to_s
|
84
84
|
end
|
@@ -128,7 +128,7 @@ module ActiveMerchant #:nodoc:
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def add_token(post, token)
|
131
|
-
post[:fp] = 't'
|
131
|
+
post[:fp] = 't' # turn on "future payments" - what paystation calls Token Billing
|
132
132
|
post[:ft] = token
|
133
133
|
end
|
134
134
|
|
@@ -154,20 +154,21 @@ module ActiveMerchant #:nodoc:
|
|
154
154
|
|
155
155
|
def clean(value, format, maxlength)
|
156
156
|
value ||= ''
|
157
|
-
value =
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
157
|
+
value =
|
158
|
+
case format
|
159
|
+
when :alphanumeric
|
160
|
+
value.gsub(/[^A-Za-z0-9]/, '')
|
161
|
+
when :name
|
162
|
+
value.gsub(/[^A-Za-z ]/, '')
|
163
|
+
when :numeric
|
164
|
+
value.gsub(/[^0-9]/, '')
|
165
|
+
when :text
|
166
|
+
value.gsub(/[^A-Za-z0-9@\-_\/\. ]/, '')
|
167
|
+
when nil
|
168
|
+
value
|
169
|
+
else
|
170
|
+
raise "Unknown format #{format} for #{value}"
|
171
|
+
end
|
171
172
|
value[0...maxlength]
|
172
173
|
end
|
173
174
|
|
@@ -219,7 +219,7 @@ module ActiveMerchant
|
|
219
219
|
|
220
220
|
def add_customer_data(post, options)
|
221
221
|
post[:email] = options[:email]
|
222
|
-
post[:dontsndmail]
|
222
|
+
post[:dontsndmail] = 'yes' unless options[:send_email_confirmation]
|
223
223
|
post[:ipaddress] = options[:ip]
|
224
224
|
end
|
225
225
|
|
@@ -256,7 +256,7 @@ module ActiveMerchant
|
|
256
256
|
post[:state] = shipping_address[:state]
|
257
257
|
else
|
258
258
|
post[:state] = 'ZZ'
|
259
|
-
post[:province]
|
259
|
+
post[:province] = shipping_address[:state]
|
260
260
|
end
|
261
261
|
|
262
262
|
post[:country] = shipping_address[:country]
|
@@ -211,7 +211,7 @@ module ActiveMerchant
|
|
211
211
|
|
212
212
|
def add_purchase_details(post)
|
213
213
|
post[:EchoAmount] = 'YES'
|
214
|
-
post[:SCBI] = 'YES'
|
214
|
+
post[:SCBI] = 'YES' # Return information about the transaction
|
215
215
|
post[:MessageType] = MESSAGE_TYPE
|
216
216
|
end
|
217
217
|
|
@@ -102,7 +102,7 @@ module ActiveMerchant #:nodoc:
|
|
102
102
|
|
103
103
|
def build_purchase_request(money, creditcard, options)
|
104
104
|
xml = Builder::XmlMarkup.new
|
105
|
-
add_common_credit_card_info(xml, @options[:ignore_avs] ||
|
105
|
+
add_common_credit_card_info(xml, @options[:ignore_avs] || @options[:ignore_cvv] ? 'SALES' : 'AUTH_CAPTURE')
|
106
106
|
add_address(xml, creditcard, options[:billing_address], options)
|
107
107
|
add_purchase_data(xml, money)
|
108
108
|
add_creditcard(xml, creditcard)
|
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
|
|
11
11
|
self.homepage_url = 'http://payments.intuit.com'
|
12
12
|
self.display_name = 'QuickBooks Payments'
|
13
13
|
BASE = '/quickbooks/v4/payments'
|
14
|
-
ENDPOINT =
|
14
|
+
ENDPOINT = "#{BASE}/charges"
|
15
15
|
VOID_ENDPOINT = "#{BASE}/txn-requests"
|
16
16
|
REFRESH_URI = 'https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer'
|
17
17
|
|
@@ -42,7 +42,7 @@ module ActiveMerchant #:nodoc:
|
|
42
42
|
'PMT-5001' => STANDARD_ERROR_CODE[:card_declined], # Merchant does not support given payment method
|
43
43
|
|
44
44
|
# System Error
|
45
|
-
'PMT-6000' => STANDARD_ERROR_CODE[:processing_error],
|
45
|
+
'PMT-6000' => STANDARD_ERROR_CODE[:processing_error], # A temporary Issue prevented this request from being processed.
|
46
46
|
}
|
47
47
|
|
48
48
|
FRAUD_WARNING_CODES = ['PMT-1000', 'PMT-1001', 'PMT-1002', 'PMT-1003']
|
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
|
|
68
68
|
post[:capture] = 'true'
|
69
69
|
|
70
70
|
response = commit(ENDPOINT, post)
|
71
|
-
check_token_response(response, ENDPOINT, post)
|
71
|
+
check_token_response(response, ENDPOINT, post, options)
|
72
72
|
end
|
73
73
|
|
74
74
|
def authorize(money, payment, options = {})
|
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
|
|
78
78
|
post[:capture] = 'false'
|
79
79
|
|
80
80
|
response = commit(ENDPOINT, post)
|
81
|
-
check_token_response(response, ENDPOINT, post)
|
81
|
+
check_token_response(response, ENDPOINT, post, options)
|
82
82
|
end
|
83
83
|
|
84
84
|
def capture(money, authorization, options = {})
|
@@ -88,7 +88,7 @@ module ActiveMerchant #:nodoc:
|
|
88
88
|
add_context(post, options)
|
89
89
|
|
90
90
|
response = commit(capture_uri(authorization), post)
|
91
|
-
check_token_response(response, capture_uri(authorization), post)
|
91
|
+
check_token_response(response, capture_uri(authorization), post, options)
|
92
92
|
end
|
93
93
|
|
94
94
|
def refund(money, authorization, options = {})
|
@@ -98,20 +98,25 @@ module ActiveMerchant #:nodoc:
|
|
98
98
|
authorization, _ = split_authorization(authorization)
|
99
99
|
|
100
100
|
response = commit(refund_uri(authorization), post)
|
101
|
-
check_token_response(response, refund_uri(authorization), post)
|
101
|
+
check_token_response(response, refund_uri(authorization), post, options)
|
102
102
|
end
|
103
103
|
|
104
104
|
def void(authorization, options = {})
|
105
105
|
_, request_id = split_authorization(authorization)
|
106
106
|
|
107
107
|
response = commit(void_uri(request_id))
|
108
|
-
check_token_response(response, void_uri(request_id))
|
108
|
+
check_token_response(response, void_uri(request_id), {}, options)
|
109
109
|
end
|
110
110
|
|
111
111
|
def verify(credit_card, options = {})
|
112
112
|
authorize(1.00, credit_card, options)
|
113
113
|
end
|
114
114
|
|
115
|
+
def refresh
|
116
|
+
response = refresh_access_token
|
117
|
+
response_object(response)
|
118
|
+
end
|
119
|
+
|
115
120
|
def supports_scrubbing?
|
116
121
|
true
|
117
122
|
end
|
@@ -276,8 +281,9 @@ module ActiveMerchant #:nodoc:
|
|
276
281
|
}
|
277
282
|
end
|
278
283
|
|
279
|
-
def check_token_response(response, endpoint, body = {})
|
284
|
+
def check_token_response(response, endpoint, body = {}, options = {})
|
280
285
|
return response unless @options[:refresh_token]
|
286
|
+
return response unless options[:allow_refresh]
|
281
287
|
return response unless response.params['code'] == 'AuthenticationFailed'
|
282
288
|
refresh_access_token
|
283
289
|
commit(endpoint, body)
|
@@ -297,10 +303,11 @@ module ActiveMerchant #:nodoc:
|
|
297
303
|
}
|
298
304
|
|
299
305
|
response = ssl_post(REFRESH_URI, data, headers)
|
300
|
-
|
306
|
+
json_response = JSON.parse(response)
|
301
307
|
|
302
|
-
@options[:access_token] =
|
303
|
-
@options[:refresh_token] =
|
308
|
+
@options[:access_token] = json_response['access_token'] if json_response['access_token']
|
309
|
+
@options[:refresh_token] = json_response['refresh_token'] if json_response['refresh_token']
|
310
|
+
response
|
304
311
|
end
|
305
312
|
|
306
313
|
def cvv_code_from(response)
|
@@ -314,7 +321,7 @@ module ActiveMerchant #:nodoc:
|
|
314
321
|
def success?(response)
|
315
322
|
return FRAUD_WARNING_CODES.concat(['0']).include?(response['errors'].first['code']) if response['errors']
|
316
323
|
|
317
|
-
!['DECLINED', 'CANCELLED'].include?(response['status'])
|
324
|
+
!['DECLINED', 'CANCELLED'].include?(response['status']) && !['AuthenticationFailed'].include?(response['code'])
|
318
325
|
end
|
319
326
|
|
320
327
|
def message_from(response)
|
@@ -204,7 +204,7 @@ module ActiveMerchant
|
|
204
204
|
end
|
205
205
|
|
206
206
|
def add_credit_card_or_reference(post, credit_card_or_reference, options = {})
|
207
|
-
post[:card]
|
207
|
+
post[:card] ||= {}
|
208
208
|
if credit_card_or_reference.is_a?(String)
|
209
209
|
post[:card][:token] = credit_card_or_reference
|
210
210
|
else
|
@@ -373,9 +373,9 @@ module ActiveMerchant #:nodoc:
|
|
373
373
|
|
374
374
|
def build_signature(data)
|
375
375
|
str = data[:amount] +
|
376
|
-
|
377
|
-
|
378
|
-
|
376
|
+
data[:order_id].to_s +
|
377
|
+
@options[:login].to_s +
|
378
|
+
data[:currency]
|
379
379
|
|
380
380
|
if card = data[:card]
|
381
381
|
str << card[:pan]
|
@@ -495,14 +495,14 @@ module ActiveMerchant #:nodoc:
|
|
495
495
|
sig.casecmp(data[:ds_signature].to_s).zero?
|
496
496
|
else
|
497
497
|
str = data[:ds_amount] +
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
498
|
+
data[:ds_order].to_s +
|
499
|
+
data[:ds_merchantcode] +
|
500
|
+
data[:ds_currency] +
|
501
|
+
data[:ds_response] +
|
502
|
+
data[:ds_cardnumber].to_s +
|
503
|
+
data[:ds_transactiontype].to_s +
|
504
|
+
data[:ds_securepayment].to_s +
|
505
|
+
@options[:secret_key]
|
506
506
|
|
507
507
|
sig = Digest::SHA1.hexdigest(str)
|
508
508
|
data[:ds_signature].to_s.downcase == sig
|
@@ -591,7 +591,7 @@ module ActiveMerchant #:nodoc:
|
|
591
591
|
|
592
592
|
def xml_signed_fields(data)
|
593
593
|
xml_signed_fields = data[:ds_amount] + data[:ds_order] + data[:ds_merchantcode] +
|
594
|
-
|
594
|
+
data[:ds_currency] + data[:ds_response]
|
595
595
|
|
596
596
|
xml_signed_fields += data[:ds_cardnumber] if data[:ds_cardnumber]
|
597
597
|
|
@@ -146,9 +146,9 @@ module ActiveMerchant #:nodoc:
|
|
146
146
|
post[:sg_Address] = address[:address1] if address[:address1]
|
147
147
|
post[:sg_City] = address[:city] if address[:city]
|
148
148
|
post[:sg_State] = address[:state] if address[:state]
|
149
|
-
post[:sg_Zip] = address[:zip]
|
150
|
-
post[:sg_Country] = address[:country]
|
151
|
-
post[:sg_Phone] = address[:phone]
|
149
|
+
post[:sg_Zip] = address[:zip] if address[:zip]
|
150
|
+
post[:sg_Country] = address[:country] if address[:country]
|
151
|
+
post[:sg_Phone] = address[:phone] if address[:phone]
|
152
152
|
end
|
153
153
|
|
154
154
|
post[:sg_Email] = options[:email]
|
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.homepage_url = 'Sage Payment Solutions'
|
8
8
|
self.live_url = 'https://www.sagepayments.net/cgi-bin'
|
9
9
|
|
10
|
-
self.supported_countries =
|
10
|
+
self.supported_countries = ['US', 'CA']
|
11
11
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
|
12
12
|
|
13
13
|
TRANSACTIONS = {
|
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
|
|
20
20
|
}
|
21
21
|
|
22
22
|
SOURCE_CARD = 'bankcard'
|
23
|
-
SOURCE_ECHECK =
|
23
|
+
SOURCE_ECHECK = 'virtual_check'
|
24
24
|
|
25
25
|
def initialize(options = {})
|
26
26
|
requires!(options, :login, :password)
|
@@ -115,7 +115,7 @@ module ActiveMerchant #:nodoc:
|
|
115
115
|
# use the same method as in pay_conex
|
116
116
|
def force_utf8(string)
|
117
117
|
return nil unless string
|
118
|
-
binary = string.encode('BINARY', invalid: :replace, undef: :replace, replace: '?')
|
118
|
+
binary = string.encode('BINARY', invalid: :replace, undef: :replace, replace: '?') # Needed for Ruby 2.0 since #encode is a no-op if the string is already UTF-8. It's not needed for Ruby 2.1 and up since it's not a no-op there.
|
119
119
|
binary.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
|
120
120
|
end
|
121
121
|
|
@@ -227,7 +227,7 @@ module ActiveMerchant #:nodoc:
|
|
227
227
|
end
|
228
228
|
|
229
229
|
def add_addresses(post, options)
|
230
|
-
billing_address
|
230
|
+
billing_address = options[:billing_address] || options[:address] || {}
|
231
231
|
|
232
232
|
post[:C_address] = billing_address[:address1]
|
233
233
|
post[:C_city] = billing_address[:city]
|
@@ -379,11 +379,12 @@ module ActiveMerchant #:nodoc:
|
|
379
379
|
end
|
380
380
|
|
381
381
|
def build_url(action)
|
382
|
-
endpoint =
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
382
|
+
endpoint =
|
383
|
+
case action
|
384
|
+
when :purchase, :authorization then 'vspdirect-register'
|
385
|
+
when :store then 'directtoken'
|
386
|
+
else TRANSACTIONS[action].downcase
|
387
|
+
end
|
387
388
|
"#{test? ? self.test_url : self.live_url}/#{endpoint}.vsp"
|
388
389
|
end
|
389
390
|
|
@@ -393,7 +394,7 @@ module ActiveMerchant #:nodoc:
|
|
393
394
|
end
|
394
395
|
|
395
396
|
def message_from(response)
|
396
|
-
response['Status'] == APPROVED ? 'Success' : (response['StatusDetail'] || 'Unspecified error')
|
397
|
+
response['Status'] == APPROVED ? 'Success' : (response['StatusDetail'] || 'Unspecified error') # simonr 20080207 can't actually get non-nil blanks, so this is shorter
|
397
398
|
end
|
398
399
|
|
399
400
|
def post_data(action, parameters = {})
|
@@ -157,7 +157,7 @@ module ActiveMerchant #:nodoc:
|
|
157
157
|
xml.tag! 'FIRSTNAME', creditcard.first_name
|
158
158
|
xml.tag! 'LASTNAME', creditcard.last_name
|
159
159
|
xml.tag! 'PHONE', address[:phone].to_s
|
160
|
-
xml.tag! 'STATE', address[:state].blank?
|
160
|
+
xml.tag! 'STATE', address[:state].blank? ? 'n/a' : address[:state]
|
161
161
|
xml.tag! 'ZIP', address[:zip].to_s
|
162
162
|
end
|
163
163
|
end
|
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
|
|
178
178
|
xml.tag! 'LASTNAME', address[:last_name].to_s
|
179
179
|
end
|
180
180
|
|
181
|
-
xml.tag! 'STATE', address[:state].blank?
|
181
|
+
xml.tag! 'STATE', address[:state].blank? ? 'n/a' : address[:state]
|
182
182
|
xml.tag! 'ZIP', address[:zip].to_s
|
183
183
|
end
|
184
184
|
else
|
@@ -159,7 +159,7 @@ module ActiveMerchant #:nodoc:
|
|
159
159
|
post[:zip] = address[:zip].to_s
|
160
160
|
post[:city] = address[:city].to_s
|
161
161
|
post[:country] = address[:country].to_s
|
162
|
-
post[:state] = address[:state].blank?
|
162
|
+
post[:state] = address[:state].blank? ? 'n/a' : address[:state]
|
163
163
|
end
|
164
164
|
|
165
165
|
if address = options[:shipping_address]
|
@@ -171,7 +171,7 @@ module ActiveMerchant #:nodoc:
|
|
171
171
|
post[:ship_to_zip] = address[:zip].to_s
|
172
172
|
post[:ship_to_city] = address[:city].to_s
|
173
173
|
post[:ship_to_country] = address[:country].to_s
|
174
|
-
post[:ship_to_state] = address[:state].blank?
|
174
|
+
post[:ship_to_state] = address[:state].blank? ? 'n/a' : address[:state]
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -375,7 +375,7 @@ module ActiveMerchant #:nodoc:
|
|
375
375
|
end
|
376
376
|
|
377
377
|
def add_creditcard(post, creditcard)
|
378
|
-
post[:AccountNumber]
|
378
|
+
post[:AccountNumber] = creditcard.number
|
379
379
|
post[:Month] = creditcard.month
|
380
380
|
post[:Year] = creditcard.year
|
381
381
|
post[:CVV2] = creditcard.verification_value if creditcard.verification_value?
|
@@ -144,7 +144,7 @@ module ActiveMerchant #:nodoc:
|
|
144
144
|
post[prefix+'zip'] = address[:zip].to_s
|
145
145
|
post[prefix+'city'] = address[:city].to_s
|
146
146
|
post[prefix+'country'] = address[:country].to_s
|
147
|
-
post[prefix+'state'] = address[:state].blank?
|
147
|
+
post[prefix+'state'] = address[:state].blank? ? 'n/a' : address[:state]
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
@@ -181,9 +181,9 @@ module ActiveMerchant #:nodoc:
|
|
181
181
|
post[:customer_vault] = 'add_customer'
|
182
182
|
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
183
183
|
end
|
184
|
-
post[:ccnumber]
|
184
|
+
post[:ccnumber] = creditcard.number
|
185
185
|
post[:cvv] = creditcard.verification_value if creditcard.verification_value?
|
186
|
-
post[:ccexp]
|
186
|
+
post[:ccexp] = expdate(creditcard)
|
187
187
|
post[:firstname] = creditcard.first_name
|
188
188
|
post[:lastname] = creditcard.last_name
|
189
189
|
end
|
@@ -225,7 +225,7 @@ module ActiveMerchant #:nodoc:
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def commit(action, money, parameters)
|
228
|
-
parameters[:amount]
|
228
|
+
parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money
|
229
229
|
response = parse(ssl_post(self.live_url, post_data(action, parameters)))
|
230
230
|
Response.new(response['response'] == '1', message_from(response), response,
|
231
231
|
:authorization => (response['transactionid'] || response['customer_vault_id']),
|
@@ -255,7 +255,7 @@ module ActiveMerchant #:nodoc:
|
|
255
255
|
|
256
256
|
def post_data(action, parameters = {})
|
257
257
|
post = {}
|
258
|
-
post[:username]
|
258
|
+
post[:username] = @options[:login]
|
259
259
|
post[:password] = @options[:password]
|
260
260
|
post[:type] = action if action
|
261
261
|
|