Hello support.
I am trying to use your sample code on refund, but it is not working.
This is my code.
public function refund($transaction_id)
{
$refundRequest = new RefundTransactionRequestType();
$refundRequest->RefundType = 'FULL';
$refundRequest->TransactionID = $transaction_id;
$refundReq = new RefundTransactionReq();
$refundReq->RefundTransactionRequest = $refundRequest;
try
{
/* wrap API method calls on the service object with a try catch */
$refundResponse = $this->get_paypal_service()->RefundTransaction($refundReq);
if(isset($refundResponse) && strtolower($refundResponse->Ack) == 'success' )
{
return true;
}
} catch (Exception $ex) {
log_message('error', 'Error when refunding the client for transaction #' . $transaction_id . ' ' . $ex->getMessage());
}
return false;
}
public function get_paypal_service()
{
\PayPal\Core\PPHttpConfig::$DEFAULT_CURL_OPTS[CURLOPT_SSLVERSION] = 1;
Another api is working, it means there is no issue on account info and system. But right now refund function says 400 error. Let me know why this happens. I need your help.
Hello support. I am trying to use your sample code on refund, but it is not working.
This is my code.
public function refund($transaction_id) { $refundRequest = new RefundTransactionRequestType(); $refundRequest->RefundType = 'FULL'; $refundRequest->TransactionID = $transaction_id;
public function get_paypal_service() {
\PayPal\Core\PPHttpConfig::$DEFAULT_CURL_OPTS[CURLOPT_SSLVERSION] = 1;
Another api is working, it means there is no issue on account info and system. But right now refund function says 400 error. Let me know why this happens. I need your help.