lib/active_merchant/billing/gateways/first_pay.rb in activemerchant-1.13.0 vs lib/active_merchant/billing/gateways/first_pay.rb in activemerchant-1.14.0
- old
+ new
@@ -45,20 +45,25 @@
add_customer_data(post, options)
commit('sale', money, post)
end
- def credit(money, reference, options = {})
- raise ArgumentError, "Both TransactionID and CreditCard are required" unless reference.is_a?(String) && options[:credit_card]
+ def refund(money, reference, options = {})
+ requires!(options, :credit_card)
post = FirstPayPostData.new
add_invoice(post, options)
add_creditcard(post, options[:credit_card])
add_address(post, options)
add_customer_data(post, options)
add_credit_data(post, reference)
commit('credit', money, post)
+ end
+
+ def credit(money, reference, options = {})
+ deprecated CREDIT_DEPRECATION_MESSAGE
+ refund(money, reference, options)
end
def void(money, creditcard, options = {})
post = FirstPayPostData.new
add_creditcard(post, creditcard)