lib/active_merchant/billing/gateways/federated_canada.rb in activemerchant-1.43.3 vs lib/active_merchant/billing/gateways/federated_canada.rb in activemerchant-1.44.0
- old
+ new
@@ -56,11 +56,11 @@
def refund(money, authorization, options = {})
commit('refund', money, options.merge(:transactionid => authorization))
end
def credit(money, authorization, options = {})
- deprecated CREDIT_DEPRECATION_MESSAGE
+ ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
refund(money, authorization, options)
end
private
@@ -105,16 +105,10 @@
post[:ccnumber] = creditcard.number
post[:ccexp] = expdate(creditcard)
post[:cvv] = creditcard.verification_value
end
- def expdate(creditcard)
- year = sprintf("%.4i", creditcard.year)
- month = sprintf("%.2i", creditcard.month)
- "#{month}#{year[-2..-1]}"
- end
-
def parse(body)
body.split('&').inject({}) do |memo, x|
k, v = x.split('=')
memo[k] = v
memo
@@ -124,10 +118,9 @@
def commit(action, money, parameters)
parameters[:amount] = amount(money)
data = ssl_post(self.live_url, post_data(action, parameters))
response = parse(data)
message = message_from(response)
- test_mode = test?
Response.new(success?(response), message, response,
:test => test?,
:authorization => response['transactionid'],
:avs_result => {:code => response['avsresponse']},