lib/active_merchant/billing/gateways/paybox_direct.rb in activemerchant-1.26.0 vs lib/active_merchant/billing/gateways/paybox_direct.rb in activemerchant-1.27.0
- old
+ new
@@ -1,12 +1,14 @@
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PayboxDirectGateway < Gateway
- TEST_URL = 'https://preprod-ppps.paybox.com/PPPS.php'
- LIVE_URL = 'https://ppps.paybox.com/PPPS.php'
- LIVE_URL_BACKUP = 'https://ppps1.paybox.com/PPPS.php'
+ class_attribute :live_url_backup
+ self.test_url = 'https://preprod-ppps.paybox.com/PPPS.php'
+ self.live_url = 'https://ppps.paybox.com/PPPS.php'
+ self.live_url_backup = 'https://ppps1.paybox.com/PPPS.php'
+
# Payment API Version
API_VERSION = '00103'
# Transactions hash
TRANSACTIONS = {
@@ -139,11 +141,11 @@
def commit(action, money = nil, parameters = nil)
parameters[:montant] = ('0000000000' + (money ? amount(money) : ''))[-10..-1]
parameters[:devise] = CURRENCY_CODES[options[:currency] || currency(money)]
request_data = post_data(action,parameters)
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, request_data))
- response = parse(ssl_post(LIVE_URL_BACKUP, request_data)) if service_unavailable?(response) && !test?
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, request_data))
+ response = parse(ssl_post(self.live_url_backup, request_data)) if service_unavailable?(response) && !test?
Response.new(success?(response), message_from(response), response.merge(
:timestamp => parameters[:dateq]),
:test => test?,
:authorization => response[:numappel].to_s + response[:numtrans].to_s,
:fraud_review => false,