activemerchant 1.26.0 → 1.27.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +17 -0
- data/CONTRIBUTORS +20 -0
- data/README.md +5 -0
- data/lib/active_merchant/billing/base.rb +2 -2
- data/lib/active_merchant/billing/gateway.rb +6 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +1 -1
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +0 -3
- data/lib/active_merchant/billing/gateways/balanced.rb +462 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +3 -3
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -2
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +11 -1
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +2 -4
- data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
- data/lib/active_merchant/billing/gateways/certo_direct.rb +2 -3
- data/lib/active_merchant/billing/gateways/cyber_source.rb +3 -3
- data/lib/active_merchant/billing/gateways/data_cash.rb +3 -3
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -3
- data/lib/active_merchant/billing/gateways/epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/eway.rb +8 -7
- data/lib/active_merchant/billing/gateways/eway_managed.rb +3 -3
- data/lib/active_merchant/billing/gateways/exact.rb +2 -2
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +3 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +2 -2
- data/lib/active_merchant/billing/gateways/instapay.rb +2 -2
- data/lib/active_merchant/billing/gateways/iridium.rb +4 -5
- data/lib/active_merchant/billing/gateways/itransact.rb +2 -2
- data/lib/active_merchant/billing/gateways/jetpay.rb +3 -3
- data/lib/active_merchant/billing/gateways/linkpoint.rb +3 -6
- data/lib/active_merchant/billing/gateways/litle.rb +50 -34
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +3 -3
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs.rb +8 -4
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +4 -4
- data/lib/active_merchant/billing/gateways/moneris.rb +3 -3
- data/lib/active_merchant/billing/gateways/moneris_us.rb +3 -3
- data/lib/active_merchant/billing/gateways/nab_transact.rb +8 -6
- data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
- data/lib/active_merchant/billing/gateways/ogone.rb +10 -5
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -3
- data/lib/active_merchant/billing/gateways/orbital.rb +4 -4
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -2
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +7 -5
- data/lib/active_merchant/billing/gateways/payflow.rb +39 -37
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +4 -3
- data/lib/active_merchant/billing/gateways/payment_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +98 -85
- data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
- data/lib/active_merchant/billing/gateways/payway.rb +3 -2
- data/lib/active_merchant/billing/gateways/plugnpay.rb +63 -66
- data/lib/active_merchant/billing/gateways/psigate.rb +3 -3
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/realex.rb +7 -7
- data/lib/active_merchant/billing/gateways/sage.rb +2 -0
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +2 -3
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage_pay.rb +8 -6
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_net.rb +4 -4
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +9 -6
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/skip_jack.rb +3 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +3 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
- data/lib/active_merchant/billing/gateways/transax.rb +1 -3
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +3 -3
- data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +3 -2
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +6 -6
- data/lib/active_merchant/billing/gateways/verifi.rb +2 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +4 -4
- data/lib/active_merchant/billing/gateways/worldpay.rb +37 -18
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +6 -5
- data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +63 -0
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
- data/lib/active_merchant/billing/integrations/helper.rb +4 -0
- data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
- data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
- data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
- data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +110 -0
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
- data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/gateway_support.rb +9 -2
- data/lib/support/ssl_verify.rb +93 -0
- metadata +45 -71
- data.tar.gz.sig +0 -3
- metadata.gz.sig +0 -0
@@ -7,6 +7,8 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.supported_countries = SageBankcardGateway.supported_countries
|
8
8
|
self.supported_cardtypes = SageBankcardGateway.supported_cardtypes
|
9
9
|
|
10
|
+
self.abstract_class = true
|
11
|
+
|
10
12
|
# Creates a new SageGateway
|
11
13
|
#
|
12
14
|
# The gateway requires that a valid login and password be passed
|
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class SageBankcardGateway < Gateway #:nodoc:
|
6
6
|
include SageCore
|
7
|
-
self.
|
7
|
+
self.live_url = 'https://www.sagepayments.net/cgi-bin/eftBankcard.dll?transaction'
|
8
8
|
self.source = 'bankcard'
|
9
9
|
|
10
10
|
# Credit cards supported by Sage
|
@@ -2,7 +2,6 @@ module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
3
3
|
module SageCore #:nodoc:
|
4
4
|
def self.included(base)
|
5
|
-
base.cattr_accessor :url
|
6
5
|
base.cattr_accessor :source
|
7
6
|
base.supported_countries = ['US', 'CA']
|
8
7
|
base.homepage_url = 'http://www.sagepayments.com'
|
@@ -86,7 +85,7 @@ module ActiveMerchant #:nodoc:
|
|
86
85
|
end
|
87
86
|
|
88
87
|
def commit(action, params)
|
89
|
-
response = parse(ssl_post(
|
88
|
+
response = parse(ssl_post(self.live_url, post_data(action, params)))
|
90
89
|
|
91
90
|
Response.new(success?(response), response[:message], response,
|
92
91
|
:test => test?,
|
@@ -113,4 +112,4 @@ module ActiveMerchant #:nodoc:
|
|
113
112
|
end
|
114
113
|
end
|
115
114
|
end
|
116
|
-
end
|
115
|
+
end
|
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class SageVirtualCheckGateway < Gateway #:nodoc:
|
6
6
|
include SageCore
|
7
|
-
self.
|
7
|
+
self.live_url = 'https://www.sagepayments.net/cgi-bin/eftVirtualCheck.dll?transaction'
|
8
8
|
self.source = 'virtual_check'
|
9
9
|
|
10
10
|
def purchase(money, credit_card, options = {})
|
@@ -3,10 +3,12 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
class SagePayGateway < Gateway
|
4
4
|
cattr_accessor :simulate
|
5
5
|
self.simulate = false
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
|
7
|
+
class_attribute :simulator_url
|
8
|
+
|
9
|
+
self.test_url = 'https://test.sagepay.com/gateway/service'
|
10
|
+
self.live_url = 'https://live.sagepay.com/gateway/service'
|
11
|
+
self.simulator_url = 'https://test.sagepay.com/Simulator'
|
10
12
|
|
11
13
|
APPROVED = 'OK'
|
12
14
|
|
@@ -265,12 +267,12 @@ module ActiveMerchant #:nodoc:
|
|
265
267
|
|
266
268
|
def build_url(action)
|
267
269
|
endpoint = [ :purchase, :authorization ].include?(action) ? "vspdirect-register" : TRANSACTIONS[action].downcase
|
268
|
-
"#{test? ?
|
270
|
+
"#{test? ? self.test_url : self.live_url}/#{endpoint}.vsp"
|
269
271
|
end
|
270
272
|
|
271
273
|
def build_simulator_url(action)
|
272
274
|
endpoint = [ :purchase, :authorization ].include?(action) ? "VSPDirectGateway.asp" : "VSPServerGateway.asp?Service=Vendor#{TRANSACTIONS[action].capitalize}Tx"
|
273
|
-
"#{
|
275
|
+
"#{self.simulator_url}/#{endpoint}"
|
274
276
|
end
|
275
277
|
|
276
278
|
def message_from(response)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class SallieMaeGateway < Gateway
|
4
|
-
|
4
|
+
self.live_url = self.test_url = 'https://trans.salliemae.com/cgi-bin/process.cgi'
|
5
5
|
|
6
6
|
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
7
7
|
self.supported_countries = ['US']
|
@@ -120,7 +120,7 @@ module ActiveMerchant #:nodoc:
|
|
120
120
|
parameters[:action] = "ns_quicksale_cc"
|
121
121
|
end
|
122
122
|
|
123
|
-
response = parse(ssl_post(
|
123
|
+
response = parse(ssl_post(self.live_url, parameters.to_post_data) || "")
|
124
124
|
Response.new(successful?(response), message_from(response), response,
|
125
125
|
:test => test?,
|
126
126
|
:authorization => response["refcode"]
|
@@ -44,9 +44,9 @@ module ActiveMerchant #:nodoc:
|
|
44
44
|
self.display_name = 'SecureNet'
|
45
45
|
# self.wiredump_device = STDOUT
|
46
46
|
|
47
|
-
#
|
48
|
-
|
49
|
-
|
47
|
+
# self.test_url = 'https://certify.securenet.com/api/Gateway.svc'
|
48
|
+
self.test_url = 'https://certify.securenet.com/API/gateway.svc/webHttp/ProcessTransaction'
|
49
|
+
self.live_url = 'https://gateway.securenet.com/api/Gateway.svc'
|
50
50
|
|
51
51
|
APPROVED, DECLINED, ERROR = 1, 2, 3
|
52
52
|
|
@@ -85,7 +85,7 @@ module ActiveMerchant #:nodoc:
|
|
85
85
|
private
|
86
86
|
def commit(request, money)
|
87
87
|
xml = build_request(request, money)
|
88
|
-
data = ssl_post(
|
88
|
+
data = ssl_post(self.test_url, xml, "Content-Type" => "text/xml")
|
89
89
|
response = parse(data)
|
90
90
|
|
91
91
|
test_mode = test?
|
@@ -6,10 +6,13 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
API_VERSION = 'xml-4.2'
|
7
7
|
PERIODIC_API_VERSION = 'spxml-3.0'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
class_attribute :test_periodic_url, :live_periodic_url
|
10
|
+
|
11
|
+
self.test_url = 'https://www.securepay.com.au/test/payment'
|
12
|
+
self.live_url = 'https://www.securepay.com.au/xmlapi/payment'
|
13
|
+
|
14
|
+
self.test_periodic_url = 'https://test.securepay.com.au/xmlapi/periodic'
|
15
|
+
self.live_periodic_url = 'https://api.securepay.com.au/xmlapi/periodic'
|
13
16
|
|
14
17
|
self.supported_countries = ['AU']
|
15
18
|
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
|
@@ -169,7 +172,7 @@ module ActiveMerchant #:nodoc:
|
|
169
172
|
end
|
170
173
|
|
171
174
|
def commit(action, request)
|
172
|
-
response = parse(ssl_post(test? ?
|
175
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(action, request)))
|
173
176
|
|
174
177
|
Response.new(success?(response), message_from(response), response,
|
175
178
|
:test => test?,
|
@@ -227,7 +230,7 @@ module ActiveMerchant #:nodoc:
|
|
227
230
|
def commit_periodic(request)
|
228
231
|
my_request = build_periodic_request(request)
|
229
232
|
#puts my_request
|
230
|
-
response = parse(ssl_post(test? ?
|
233
|
+
response = parse(ssl_post(test? ? self.test_periodic_url : self.live_periodic_url, my_request))
|
231
234
|
|
232
235
|
Response.new(success?(response), message_from(response), response,
|
233
236
|
:test => test?,
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
self.required_fields = [ :OrderReference, :CardNumber, :CardExpiry, :CardHolderName, :CardType, :MerchantID, :MerchantKey, :Amount, :Currency ]
|
6
6
|
end
|
7
7
|
|
8
|
-
|
8
|
+
self.live_url = self.test_url = 'https://tx.securepaytech.com/web/HttpPostPurchase'
|
9
9
|
|
10
10
|
PAYMENT_GATEWAY_RESPONSES = {
|
11
11
|
1 => "Transaction OK",
|
@@ -83,7 +83,7 @@ module ActiveMerchant #:nodoc:
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def commit(action, post)
|
86
|
-
response = parse( ssl_post(
|
86
|
+
response = parse( ssl_post(self.live_url, post_data(action, post) ) )
|
87
87
|
|
88
88
|
Response.new(response[:result_code] == 1, message_from(response), response,
|
89
89
|
:test => test?,
|
@@ -6,8 +6,8 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
class SkipJackGateway < Gateway
|
7
7
|
API_VERSION = '?.?'
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
self.live_url = "https://www.skipjackic.com"
|
10
|
+
self.test_url = "https://developer.skipjackic.com"
|
11
11
|
|
12
12
|
BASIC_PATH = "/scripts/evolvcc.dll"
|
13
13
|
ADVANCED_PATH = "/evolvcc/evolvcc.aspx"
|
@@ -280,7 +280,7 @@ module ActiveMerchant #:nodoc:
|
|
280
280
|
end
|
281
281
|
|
282
282
|
def url_for(action)
|
283
|
-
result = test? ?
|
283
|
+
result = test? ? self.test_url : self.live_url
|
284
284
|
result += advanced? && action == :authorization ? ADVANCED_PATH : BASIC_PATH
|
285
285
|
result += "?#{ACTIONS[action]}"
|
286
286
|
end
|
@@ -7,6 +7,8 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
##
|
8
8
|
# This is the base gateway for processors who use the smartPS processing system
|
9
9
|
|
10
|
+
self.abstract_class = true
|
11
|
+
|
10
12
|
def initialize(options = {})
|
11
13
|
requires!(options, :login, :password)
|
12
14
|
@options = options
|
@@ -218,7 +220,7 @@ module ActiveMerchant #:nodoc:
|
|
218
220
|
|
219
221
|
def commit(action, money, parameters)
|
220
222
|
parameters[:amount] = amount(money) if money
|
221
|
-
response = parse( ssl_post(
|
223
|
+
response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
|
222
224
|
Response.new(response["response"] == "1", message_from(response), response,
|
223
225
|
:authorization => response["transactionid"],
|
224
226
|
:test => test?,
|
@@ -3,7 +3,7 @@ require 'json'
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class StripeGateway < Gateway
|
6
|
-
|
6
|
+
self.live_url = 'https://api.stripe.com/v1/'
|
7
7
|
|
8
8
|
AVS_CODE_TRANSLATOR = {
|
9
9
|
'line1: pass, zip: pass' => 'Y',
|
@@ -191,7 +191,7 @@ module ActiveMerchant #:nodoc:
|
|
191
191
|
raw_response = response = nil
|
192
192
|
success = false
|
193
193
|
begin
|
194
|
-
raw_response = ssl_request(method,
|
194
|
+
raw_response = ssl_request(method, self.live_url + url, post_data(parameters), headers(meta))
|
195
195
|
response = parse(raw_response)
|
196
196
|
success = !response.key?("error")
|
197
197
|
rescue ResponseError => e
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class TransFirstGateway < Gateway
|
4
|
-
|
4
|
+
self.live_url = self.test_url = 'https://webservices.primerchants.com/creditcard.asmx/CCSale'
|
5
5
|
|
6
6
|
self.supported_countries = ['US']
|
7
7
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
@@ -90,7 +90,7 @@ module ActiveMerchant #:nodoc:
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def commit(params)
|
93
|
-
response = parse( ssl_post(
|
93
|
+
response = parse( ssl_post(self.live_url, post_data(params)) )
|
94
94
|
|
95
95
|
Response.new(response[:status] == "Authorized", message_from(response), response,
|
96
96
|
:test => test?,
|
@@ -3,9 +3,7 @@ require File.join(File.dirname(__FILE__),'smart_ps.rb')
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class TransaxGateway < SmartPs
|
6
|
-
|
7
|
-
'https://secure.nelixtransax.net/api/transact.php'
|
8
|
-
end
|
6
|
+
self.live_url = self.test_url = 'https://secure.nelixtransax.net/api/transact.php'
|
9
7
|
|
10
8
|
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
11
9
|
self.supported_countries = ['US']
|
@@ -65,7 +65,7 @@ module ActiveMerchant #:nodoc:
|
|
65
65
|
# below and the rest of active_merchant's documentation, as well as Trust Commerce's user and developer documentation.
|
66
66
|
|
67
67
|
class TrustCommerceGateway < Gateway
|
68
|
-
|
68
|
+
self.live_url = self.test_url = 'https://vault.trustcommerce.com/trans/'
|
69
69
|
|
70
70
|
SUCCESS_TYPES = ["approved", "accepted"]
|
71
71
|
|
@@ -380,7 +380,7 @@ module ActiveMerchant #:nodoc:
|
|
380
380
|
data = if tclink?
|
381
381
|
TCLink.send(parameters)
|
382
382
|
else
|
383
|
-
parse( ssl_post(
|
383
|
+
parse( ssl_post(self.live_url, post_data(parameters)) )
|
384
384
|
end
|
385
385
|
|
386
386
|
# to be considered successful, transaction status must be either "approved" or "accepted"
|
@@ -420,4 +420,4 @@ module ActiveMerchant #:nodoc:
|
|
420
420
|
|
421
421
|
end
|
422
422
|
end
|
423
|
-
end
|
423
|
+
end
|
@@ -64,11 +64,12 @@ module ActiveMerchant #:nodoc:
|
|
64
64
|
class UsaEpayAdvancedGateway < Gateway
|
65
65
|
API_VERSION = "1.4"
|
66
66
|
|
67
|
-
class_attribute :test_url, :live_url
|
68
|
-
|
69
67
|
TEST_URL_BASE = 'https://sandbox.usaepay.com/soap/gate/' #:nodoc:
|
70
68
|
LIVE_URL_BASE = 'https://www.usaepay.com/soap/gate/' #:nodoc:
|
71
69
|
|
70
|
+
self.test_url = TEST_URL_BASE
|
71
|
+
self.live_url = LIVE_URL_BASE
|
72
|
+
|
72
73
|
FAILURE_MESSAGE = "Default Failure" #:nodoc:
|
73
74
|
|
74
75
|
self.supported_countries = ['US']
|
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
3
3
|
|
4
4
|
class UsaEpayTransactionGateway < Gateway
|
5
|
-
|
5
|
+
self.test_url = self.live_url = 'https://www.usaepay.com/gate.php'
|
6
6
|
|
7
7
|
self.supported_cardtypes = [:visa, :master, :american_express]
|
8
8
|
self.supported_countries = ['US']
|
@@ -66,6 +66,10 @@ module ActiveMerchant #:nodoc:
|
|
66
66
|
commit(:void, post)
|
67
67
|
end
|
68
68
|
|
69
|
+
def test?
|
70
|
+
@options[:test] || super
|
71
|
+
end
|
72
|
+
|
69
73
|
private
|
70
74
|
|
71
75
|
def add_amount(post, money)
|
@@ -169,7 +173,7 @@ module ActiveMerchant #:nodoc:
|
|
169
173
|
end
|
170
174
|
|
171
175
|
def commit(action, parameters)
|
172
|
-
response = parse( ssl_post(
|
176
|
+
response = parse( ssl_post(self.live_url, post_data(action, parameters)) )
|
173
177
|
|
174
178
|
Response.new(response[:status] == 'Approved', message_from(response), response,
|
175
179
|
:test => test?,
|
@@ -196,10 +200,6 @@ module ActiveMerchant #:nodoc:
|
|
196
200
|
|
197
201
|
parameters.collect { |key, value| "UM#{key}=#{CGI.escape(value.to_s)}" }.join("&")
|
198
202
|
end
|
199
|
-
|
200
|
-
def test?
|
201
|
-
@options[:test] || super
|
202
|
-
end
|
203
203
|
end
|
204
204
|
end
|
205
205
|
end
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
:company, :address1, :address2, :city, :state, :zip, :country, :phone ]
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
self.live_url = self.test_url = 'https://secure.verifi.com/gw/api/transact.php'
|
13
13
|
|
14
14
|
RESPONSE_CODE_MESSAGES = {
|
15
15
|
"100" => "Transaction was Approved",
|
@@ -200,7 +200,7 @@ module ActiveMerchant #:nodoc:
|
|
200
200
|
def commit(trx_type, money, post)
|
201
201
|
post[:amount] = amount(money)
|
202
202
|
|
203
|
-
response = parse( ssl_post(
|
203
|
+
response = parse( ssl_post(self.live_url, post_data(trx_type, post)) )
|
204
204
|
|
205
205
|
Response.new(response[:response].to_i == SUCCESS, message_from(response), response,
|
206
206
|
:test => test?,
|
@@ -4,10 +4,10 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class WirecardGateway < Gateway
|
6
6
|
# Test server location
|
7
|
-
|
7
|
+
self.test_url = 'https://c3-test.wirecard.com/secure/ssl-gateway'
|
8
8
|
|
9
9
|
# Live server location
|
10
|
-
|
10
|
+
self.live_url = 'https://c3.wirecard.com/secure/ssl-gateway'
|
11
11
|
|
12
12
|
# The Namespaces are not really needed, because it just tells the System, that there's actually no namespace used.
|
13
13
|
# It's just specified here for completeness.
|
@@ -109,11 +109,11 @@ module ActiveMerchant #:nodoc:
|
|
109
109
|
headers = { 'Content-Type' => 'text/xml',
|
110
110
|
'Authorization' => encoded_credentials }
|
111
111
|
|
112
|
-
response = parse(ssl_post(test? ?
|
112
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, request, headers))
|
113
113
|
# Pending Status also means Acknowledged (as stated in their specification)
|
114
114
|
success = response[:FunctionResult] == "ACK" || response[:FunctionResult] == "PENDING"
|
115
115
|
message = response[:Message]
|
116
|
-
authorization =
|
116
|
+
authorization = response[:GuWID]
|
117
117
|
|
118
118
|
Response.new(success, message, response,
|
119
119
|
:test => test?,
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class WorldpayGateway < Gateway
|
4
|
-
|
5
|
-
|
4
|
+
self.test_url = 'https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp'
|
5
|
+
self.live_url = 'https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp'
|
6
6
|
|
7
7
|
self.default_currency = 'GBP'
|
8
8
|
self.money_format = :cents
|
9
9
|
self.supported_countries = ['HK', 'US', 'GB', 'AU']
|
10
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro]
|
10
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :laser]
|
11
11
|
self.homepage_url = 'http://www.worldpay.com/'
|
12
12
|
self.display_name = 'WorldPay'
|
13
13
|
|
@@ -33,34 +33,54 @@ module ActiveMerchant #:nodoc:
|
|
33
33
|
|
34
34
|
def authorize(money, payment_method, options = {})
|
35
35
|
requires!(options, :order_id)
|
36
|
-
|
36
|
+
authorize_request(money, payment_method, options)
|
37
37
|
end
|
38
38
|
|
39
39
|
def capture(money, authorization, options = {})
|
40
40
|
MultiResponse.new.tap do |r|
|
41
|
-
r.process{
|
42
|
-
r.process{
|
41
|
+
r.process{inquire_request(authorization, options, "AUTHORISED")} unless options[:authorization_validated]
|
42
|
+
r.process{capture_request(money, authorization, options)}
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
def void(authorization, options = {})
|
47
47
|
MultiResponse.new.tap do |r|
|
48
|
-
r.process{
|
49
|
-
r.process{
|
48
|
+
r.process{inquire_request(authorization, options, "AUTHORISED")}
|
49
|
+
r.process{cancel_request(authorization, options)}
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
53
|
def refund(money, authorization, options = {})
|
54
54
|
MultiResponse.new.tap do |r|
|
55
|
-
r.process{
|
56
|
-
r.process{
|
55
|
+
r.process{inquire_request(authorization, options, "CAPTURED")}
|
56
|
+
r.process{refund_request(money, authorization, options)}
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
+
def test?
|
61
|
+
@options[:test] || super
|
62
|
+
end
|
63
|
+
|
60
64
|
private
|
61
65
|
|
62
|
-
def
|
63
|
-
commit('
|
66
|
+
def authorize_request(money, payment_method, options)
|
67
|
+
commit('authorize', build_authorization_request(money, payment_method, options), "AUTHORISED")
|
68
|
+
end
|
69
|
+
|
70
|
+
def capture_request(money, authorization, options)
|
71
|
+
commit('capture', build_capture_request(money, authorization, options), :ok)
|
72
|
+
end
|
73
|
+
|
74
|
+
def cancel_request(authorization, options)
|
75
|
+
commit('cancel', build_void_request(authorization, options), :ok)
|
76
|
+
end
|
77
|
+
|
78
|
+
def inquire_request(authorization, options, success_criteria)
|
79
|
+
commit('inquiry', build_order_inquiry_request(authorization, options), success_criteria)
|
80
|
+
end
|
81
|
+
|
82
|
+
def refund_request(money, authorization, options)
|
83
|
+
commit('inquiry', build_refund_request(money, authorization, options), :ok)
|
64
84
|
end
|
65
85
|
|
66
86
|
def build_request
|
@@ -204,8 +224,8 @@ module ActiveMerchant #:nodoc:
|
|
204
224
|
raw
|
205
225
|
end
|
206
226
|
|
207
|
-
def commit(action, request)
|
208
|
-
xmr = ssl_post((test? ?
|
227
|
+
def commit(action, request, success_criteria)
|
228
|
+
xmr = ssl_post((test? ? self.test_url : self.live_url),
|
209
229
|
request,
|
210
230
|
'Content-Type' => 'text/xml',
|
211
231
|
'Authorization' => encoded_credentials)
|
@@ -213,12 +233,11 @@ module ActiveMerchant #:nodoc:
|
|
213
233
|
raw = parse(action, xmr)
|
214
234
|
|
215
235
|
Response.new(
|
216
|
-
success_from(raw),
|
236
|
+
success_from(raw, success_criteria),
|
217
237
|
message_from(raw),
|
218
238
|
raw,
|
219
239
|
:authorization => authorization_from(raw),
|
220
240
|
:test => test?)
|
221
|
-
|
222
241
|
rescue ActiveMerchant::ResponseError => e
|
223
242
|
if e.response.code.to_s == "401"
|
224
243
|
return Response.new(false, "Invalid credentials", {}, :test => test?)
|
@@ -227,8 +246,8 @@ module ActiveMerchant #:nodoc:
|
|
227
246
|
end
|
228
247
|
end
|
229
248
|
|
230
|
-
def success_from(raw)
|
231
|
-
(raw[:last_event] ==
|
249
|
+
def success_from(raw, success_criteria)
|
250
|
+
(raw[:last_event] == success_criteria ||
|
232
251
|
raw[:ok].present?)
|
233
252
|
end
|
234
253
|
|