Table of Contents

RefundTransaction Examples

Notes

none

Request

// Create instance of the phpPayPal class
$paypal = new YipPayPal();
 
// Set the required fields	
$paypal->transaction_id = '9KA25373R3947621C';
$paypal->refund_type = 'Full';
$paypal->amount_total = '50.00';
$paypal->note = 'Customer did not want items';
 
// Make the request
$paypal->RefundTransaction();

For more information on field descriptions, requirements and corresponding PayPal fields, see the parameters list.

Required Fields

Optional Fields

Response

The class instance will always provide the raw PayPal response to the Response array. During testing (sandbox mode), you can simply output the value of Response to see the PayPal response.

$paypal->Response;
 
// Display the response
print_r($paypal->Response);

Success Response

If the transaction was successful, PayPal will return the following values:

Error Response

If there was an exception with the interaction with PayPal, _error will return true.

See the error documentation for details about error return values and procedures.

 

code/classes/phppaypal/examples/refundtransaction.txt · Last modified: 2008/03/02 23:09 (external edit)