lib/active_merchant/billing/gateways/authorize_net.rb in activemerchant-1.13.0 vs lib/active_merchant/billing/gateways/authorize_net.rb in activemerchant-1.14.0
- old
+ new
@@ -132,32 +132,37 @@
def void(authorization, options = {})
post = {:trans_id => authorization}
commit('VOID', nil, post)
end
- # Credit an account.
+ # Refund a transaction.
#
- # This transaction is also referred to as a Refund and indicates to the gateway that
+ # This transaction indicates to the gateway that
# money should flow from the merchant to the customer.
#
# ==== Parameters
#
# * <tt>money</tt> -- The amount to be credited to the customer as an Integer value in cents.
- # * <tt>identification</tt> -- The ID of the original transaction against which the credit is being issued.
+ # * <tt>identification</tt> -- The ID of the original transaction against which the refund is being issued.
# * <tt>options</tt> -- A hash of parameters.
#
# ==== Options
#
- # * <tt>:card_number</tt> -- The credit card number the credit is being issued to. (REQUIRED)
- def credit(money, identification, options = {})
+ # * <tt>:card_number</tt> -- The credit card number the refund is being issued to. (REQUIRED)
+ def refund(money, identification, options = {})
requires!(options, :card_number)
post = { :trans_id => identification,
:card_num => options[:card_number]
}
add_invoice(post, options)
commit('CREDIT', money, post)
+ end
+
+ def credit(money, identification, options = {})
+ deprecated CREDIT_DEPRECATION_MESSAGE
+ refund(money, identification, options)
end
# Create a recurring payment.
#
# This transaction creates a new Automated Recurring Billing (ARB) subscription. Your account must have ARB enabled.