lib/active_merchant/billing/gateways/plugnpay.rb in bitfluent-activemerchant-1.5.1.1 vs lib/active_merchant/billing/gateways/plugnpay.rb in bitfluent-activemerchant-1.15.1
- old
+ new
@@ -154,19 +154,25 @@
def credit(money, identification_or_creditcard, options = {})
post = PlugnpayPostData.new
add_amount(post, money, options)
if identification_or_creditcard.is_a?(String)
- post[:orderID] = identification_or_creditcard
-
- commit(:refund, post)
+ deprecated CREDIT_DEPRECATION_MESSAGE
+ refund(money, identification_or_creditcard, options)
else
add_creditcard(post, identification_or_creditcard)
add_addresses(post, options)
add_customer_data(post, options)
commit(:credit, post)
end
+ end
+
+ def refund(money, reference, options = {})
+ post = PlugnpayPostData.new
+ add_amount(post, money, options)
+ post[:orderID] = reference
+ commit(:refund, post)
end
private
def commit(action, post)
response = parse( ssl_post(URL, post_data(action, post)) )