Skip to content

Sale_Refund

Jacob McConnell edited this page Jun 10, 2014 · 2 revisions

You must specify your API username and password using the the Twocheckout::API.credentials method before calling a method in this class.

##Method

###refund!

Use to attempt to issue a full or partial refund on a Sale, Invoice or lineitem object.

####Arguments

####Returns

Returns result as a Hash object.

####Example Usage:

Twocheckout::API.credentials = { :username => 'APIuser1817037', :password => 'APIpass1817037' }

sale = Twocheckout::Sale.find(:sale_id => 4786293822)
invoice = sale.invoices.first
invoice.refund!({:comment => "test refund", :category => 1})

####Example Response:

{
   "response_code" : "OK",
   "response_message" : "refund added to invoice"
}
Clone this wiki locally