Пример #1
0
function processOrderPayment($actionmode, $orderId, $lang)
{
    $classProcessor = $actionmode . 'Processor';
    if (class_exists($classProcessor)) {
        $processor = new $classProcessor();
        $result = $processor->getResult();
        $bankId = $processor->getBankId();
        $amount = $processor->getAmount();
        $paymentData = '';
        foreach ($_SERVER as $key_name => $key_value) {
            if ($paymentData != '') {
                $paymentData .= '&';
            }
            $paymentData .= str_replace('$', '', $key_name) . " = " . urlencode($key_value);
        }
        foreach ($_POST as $key_name => $key_value) {
            if ($paymentData != '') {
                $paymentData .= '&';
            }
            $paymentData .= str_replace('$', '', $key_name) . " = " . urlencode($key_value);
        }
        if ($actionmode != "setefi") {
            if ($result) {
                $order = BFCHelper::setOrderPayment($orderId, 5, true, $amount, $bankId, $paymentData, $lang, false);
                dpm($order);
                $result = $order != null;
            } else {
                $order = BFCHelper::setOrderPayment($orderId, 7, false, $amount, $bankId, $paymentData, $lang, false);
                dpm($order);
            }
            if (method_exists($processor, 'responseRedir')) {
                $processor->responseRedir($order->OrderId, $result);
            }
        }
        return $result;
    }
}
Пример #2
0
 public function processOrderPayment($actionmode, $orderId, $lang)
 {
     $classProcessor = $actionmode . 'Processor';
     if (class_exists($classProcessor)) {
         $processor = new $classProcessor();
         if ($actionmode == "virtualpay" || $actionmode == "paypalexpress" || $actionmode == "bnlpositivity") {
             //				$processor = new classProcessor($data=data);
             $data = explode("|", $this->item->merchantPayment->Data);
             $processor->data = $data;
         }
         if ($actionmode == "paypalexpress" || $actionmode == "bnlpositivity") {
             //				$processor = new classProcessor($data=data);
             $processor->order = $this->item->order;
         }
         $result = $processor->getResult();
         $bankId = $processor->getBankId();
         $amount = $processor->getAmount();
         $paymentData = '';
         foreach ($_SERVER as $key_name => $key_value) {
             if ($paymentData != '') {
                 $paymentData .= '&';
             }
             $paymentData .= str_replace('$', '', $key_name) . " = " . urlencode($key_value);
         }
         foreach ($_POST as $key_name => $key_value) {
             if ($paymentData != '') {
                 $paymentData .= '&';
             }
             $paymentData .= str_replace('$', '', $key_name) . " = " . urlencode($key_value);
         }
         /*$paymentData = iconv('UTF-8','UTF-8//IGNORE',$paymentData);*/
         if ($actionmode != "setefi" && $actionmode != "activa") {
             if ($orderId > 0) {
                 if ($result) {
                     $order = BFCHelper::setOrderPayment($orderId, 5, true, $amount, $bankId, $paymentData, $lang, false);
                     $result = $order != null;
                 } else {
                     $order = BFCHelper::setOrderPayment($orderId, 7, false, $amount, $bankId, $paymentData, $lang, false);
                 }
             }
             if (method_exists($processor, 'responseRedir')) {
                 $processor->responseRedir($order->OrderId, $result);
             }
         }
         return $result;
     }
 }