lib/active_merchant/billing/gateways/trust_commerce.rb in activemerchant-1.43.3 vs lib/active_merchant/billing/gateways/trust_commerce.rb in activemerchant-1.44.0
- old
+ new
@@ -195,11 +195,11 @@
commit('credit', parameters)
end
def credit(money, identification, options = {})
- deprecated CREDIT_DEPRECATION_MESSAGE
+ ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
refund(money, identification, options)
end
# void() clears an existing authorization and releases the reserved fund
# s back to the cardholder. The TC API refers to this transaction as a
@@ -233,10 +233,12 @@
#
# gateway.recurring(tendollar, creditcard, :periodicity => :weekly)
#
# You can optionally specify how long you want payments to continue using 'payments'
def recurring(money, creditcard, options = {})
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
+
requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily] )
cycle = case options[:periodicity]
when :monthly
'1m'
@@ -297,17 +299,10 @@
else
add_creditcard(params, source)
end
end
- def expdate(creditcard)
- year = sprintf("%.4i", creditcard.year)
- month = sprintf("%.2i", creditcard.month)
-
- "#{month}#{year[-2..-1]}"
- end
-
def add_creditcard(params, creditcard)
params[:media] = "cc"
params[:name] = creditcard.name
params[:cc] = creditcard.number
params[:exp] = expdate(creditcard)
@@ -402,10 +397,10 @@
results
end
def message_from(data)
- status = case data["status"]
+ case data["status"]
when "decline"
return DECLINE_CODES[data["declinetype"]]
when "baddata"
return BADDATA_CODES[data["error"]]
when "error"