Exemplo n.º 1
0
 function ePayCreateProfile($orderInfo, $params = array())
 {
     $curPath = dirname(__FILE__);
     require_once $curPath . DS . 'osePaymentOrderePay.php';
     $ePayParams = array();
     $orderInfoParams = oseJson::decode($orderInfo->params);
     $pConfig = oseRegistry::call('msc')->getConfig('payment', 'obj');
     $ePayParams['order_number'] = oseObject::getValue($orderInfo, 'order_number');
     $ePayParams['order_number'] = substr($ePayParams['order_number'], 0, 20);
     $ePayParams['amount'] = $orderInfoParams->total;
     $ePayParams['currency'] = oseObject::getValue($orderInfo, 'payment_currency');
     $ePayParams['merchantnumber'] = $pConfig->epay_merchantnumber;
     $ePayParams['md5'] = $pConfig->epay_md5;
     // if free trial
     if ($orderInfo->payment_price == 0) {
         //$this->confirmOrder($orderInfo);
         return false;
     } else {
         $epay = new osePaymentOrderePay();
         $html = $epay->ePayCreateProfile(1, $ePayParams);
         return $html;
     }
     //return array('html'=>$html);
 }
Exemplo n.º 2
0
 function ePayCreateProfile($orderInfo, $params = array())
 {
     $curPath = dirname(__FILE__);
     require_once $curPath . DS . 'osePaymentOrderePay.php';
     $ePayParams = array();
     $orderInfoParams = oseJson::decode($orderInfo->params);
     $pConfig = oseRegistry::call('msc')->getConfig('payment', 'obj');
     $ePayParams['accept_url'] = isset($orderInfoParams->returnUrl) ? urldecode($orderInfoParams->returnUrl) : JURI::root() . "index.php";
     $ePayParams['order_number'] = oseObject::getValue($orderInfo, 'order_number');
     $ePayParams['order_number'] = substr($ePayParams['order_number'], 0, 20);
     $ePayParams['amount'] = $orderInfoParams->total;
     $ePayParams['currency'] = oseObject::getValue($orderInfo, 'payment_currency');
     $ePayParams['merchantnumber'] = $pConfig->epay_merchantnumber;
     $ePayParams['md5'] = $pConfig->epay_md5;
     $ePayParams['instantcapture'] = $pConfig->epay_instantcapture;
     // if free trial
     if ($orderInfo->payment_price == 0) {
         return false;
     } else {
         $epay = new osePaymentOrderePay();
         $html = $epay->ePayCreateProfile(1, $ePayParams);
         return $html;
     }
 }