/**
  * Cancel payment
  */
 public function cancelPayment()
 {
     $sessionId = Mage::app()->getRequest()->getParam('sessionId');
     if (!empty($sessionId)) {
         $result = OpenPayU_Order::cancel($sessionId);
     }
 }
示例#2
0
 /**
  * @param string $id
  * @return \OpenPayU_Result
  * @throws \OpenPayU_Exception
  */
 public function orderCancel($id)
 {
     return \OpenPayU_Order::cancel($id);
 }
示例#3
0
    <title>Order Cancel - OpenPayU v2</title>
    <link rel="stylesheet" href="../../layout/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../layout/css/style.css">
</head>
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1>Cancel order - OpenPayU v2</h1>
    </div>
    <div id="message"></div>
    <div id="unregisteredCardData">
        <?php 
if (isset($_POST['orderId'])) {
    try {
        $response = OpenPayU_Order::cancel(stripslashes($_POST['orderId']));
        $status_desc = OpenPayU_Util::statusDesc($response->getStatus());
        if ($response->getStatus() == 'SUCCESS') {
            echo '<div class="alert alert-success">SUCCESS: ' . $status_desc;
            echo '</div>';
        } else {
            echo '<div class="alert alert-warning">' . $response->getStatus() . ': ' . $status_desc;
            echo '</div>';
        }
        echo '<pre>';
        echo '<br>';
        print_r($response->getResponse());
        echo '</pre>';
    } catch (OpenPayU_Exception $e) {
        echo '<pre>';
        echo 'Error code: ' . $e->getCode();
示例#4
0
 /**
  * @param $status
  * @return bool
  */
 private function sendPaymentUpdate($status)
 {
     if (!empty($status) && !empty($this->payu_order_id)) {
         if ($status == self::ORDER_STATUS_CANCEL) {
             $result = OpenPayU_Order::cancel($this->payu_order_id);
         } elseif ($status == self::ORDER_STATUS_COMPLETE) {
             $status_update = array("orderId" => $this->payu_order_id, "orderStatus" => $status);
             $result = OpenPayU_Order::statusUpdate($status_update);
         }
         if ($result->getSuccess()) {
             $this->updateOrderData();
             return true;
         } else {
             Logger::addLog($this->displayName . ' ' . trim($result->getError() . ' ' . $result->getMessage() . ' ' . $this->payu_order_id), 1);
             return false;
         }
     }
     return false;
 }