-
Notifications
You must be signed in to change notification settings - Fork 66
Sale_Refund
2Checkout's back office API allows you to retrieve sale information. You must specify your API username and password using the the Twocheckout::setCredentials method before calling a method in this class. The Twocheckout_Sale class provides methods to retrieve and update sales and will return a JSON object or array depending on your specification.
##Method
###refund
Use to attempt to issue a full or partial refund.
####Arguments
-
array Array
-
Array containing refund_invoice or refund_lineitem parameters in key => value pairs. Parameters -> API Refund Invoice || API Refund Lineitem
-
string format
-
Supports 'json' or 'array'. Defines response format. Default: 'json'
####Returns
Returns result as a JSON object or array depending on your specification.
####Example Usage:
<?php
Twocheckout::setCredentials("APIuser1817037", "APIpass1817037");
$args = array(
'sale_id' => 4753371371,
'category' => 1,
'comment' => 'Order never sent.'
);
$result = Twocheckout_Sale::refund($args, 'array');
print_r($result);
####Example Response:
Array
(
[response_code] => OK
[response_message] => refund added to invoice
)
Please feel free to contact 2Checkout directly for assistance with your integration.