コード例 #1
0
 /**
  *  DoVoid implementation for all PayPal payment classes
  */
 public function processVoid(TransactionPayment $handler)
 {
     $details = $handler->getDetails();
     $paypal = $handler->getHandler('DoVoid');
     $paypal->setParams($details->gatewayTransactionID->get(), '');
     $paypal->execute();
     if ($paypal->success()) {
         $response = $paypal->getAPIResponse();
         if (isset($response->Errors)) {
             return new TransactionError($response->Errors->LongMessage, $response);
         } else {
             $result = new TransactionResult();
             $result->rawResponse->set($response);
             $result->setTransactionType(TransactionResult::TYPE_VOID);
             return $result;
         }
     } else {
         return $paypal->getAPIException();
     }
 }