lib/active_merchant/billing/gateways/cams.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateways/cams.rb in activemerchant-1.80.0
- old
+ new
@@ -1,9 +1,9 @@
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class CamsGateway < Gateway
- self.live_url = "https://secure.centralams.com/gw/api/transact.php"
+ self.live_url = 'https://secure.centralams.com/gw/api/transact.php'
self.supported_countries = ['US']
self.default_currency = 'USD'
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
@@ -81,11 +81,11 @@
add_address(post, payment, options)
elsif payment.kind_of?(String)
post[:transactionid] = split_authorization(payment)[0]
end
- commit("sale", post)
+ commit('sale', post)
end
def authorize(money, payment, options={})
post = {}
add_invoice(post, money, options)
@@ -154,12 +154,12 @@
post[:phone ] = address[:phone]
end
def add_reference(post, authorization)
transaction_id, authcode = split_authorization(authorization)
- post["transactionid"] = transaction_id
- post["authcode"] = authcode
+ post['transactionid'] = transaction_id
+ post['authcode'] = authcode
end
def add_invoice(post, money, options)
post[:amount] = amount(money)
post[:currency] = (options[:currency] || default_currency)
@@ -170,14 +170,14 @@
post[:ccexp ] = "#{payment.month.to_s.rjust(2,"0")}#{payment.year.to_s[-2..-1]}"
post[:cvv ] = payment.verification_value
end
def parse(body)
- kvs = body.split("&")
+ kvs = body.split('&')
kvs.inject({}) { |h, kv|
- k,v = kv.split("=")
+ k,v = kv.split('=')
h[k] = v
h
}
end
@@ -197,34 +197,34 @@
error_code: error_code_from(response)
)
end
def success_from(response)
- response["response_code"] == "100"
+ response['response_code'] == '100'
end
def message_from(response)
- response["responsetext"]
+ response['responsetext']
end
def authorization_from(response)
- [response["transactionid"], response["authcode"]].join("#")
+ [response['transactionid'], response['authcode']].join('#')
end
def split_authorization(authorization)
- transaction_id, authcode = authorization.split("#")
+ transaction_id, authcode = authorization.split('#')
[transaction_id, authcode]
end
def post_data(parameters = {})
parameters[:password] = @options[:password]
parameters[:username] = @options[:username]
- parameters.collect{|k,v| "#{k}=#{v}" }.join("&")
+ parameters.collect{|k,v| "#{k}=#{v}" }.join('&')
end
def error_code_from(response)
- STANDARD_ERROR_CODE_MAPPING[response["response_code"]]
+ STANDARD_ERROR_CODE_MAPPING[response['response_code']]
end
end
end
end