コード例 #1
0
ファイル: StaffOrder.php プロジェクト: sinfocol/gwf3
 private function onExecute(GWF_Order $order)
 {
     $form_exec = $this->getFormExec($order);
     if (false !== ($errors = $form_exec->validate($this->module))) {
         return $errors;
     }
     $module2 = $order->getOrderModule();
     $module2->onInclude();
     $module2->onLoadLanguage();
     return Module_Payment::onExecuteOrderS($module2, $order);
 }
コード例 #2
0
ファイル: Pay.php プロジェクト: sinfocol/gwf3
 private function onPay(Module_PaymentFree $module, GWF_Order $order)
 {
     $form = $this->tinyCaptchaForm($module, $order);
     if (false !== ($error = $form->validate($module))) {
         return $error . $this->templatePay($module, $order);
     }
     $module2 = $order->getOrderModule();
     $module2->onInclude();
     $module2->onLoadLanguage();
     return Module_Payment::onExecuteOrderS($module2, $order);
 }
コード例 #3
0
ファイル: Pay2.php プロジェクト: sinfocol/gwf3
 private function onPay(Module_PaymentGWF $module, GWF_Order $order)
 {
     $module2 = $order->getOrderModule();
     $module2->onLoadLanguage();
     $gdo = $order->getOrderData();
     $user = $order->getUser();
     $sitename = $module->getSiteName();
     $action = GWF_WEB_ROOT . 'index.php?mo=PaymentGWF&me=Pay2';
     $hidden = GWF_Form::hidden('gwf_token', $order->getOrderToken());
     $buttons = Module_Payment::tinyform('BUYGWF', 'img/' . GWF_ICON_SET . 'buy_gwf.png', $action, $hidden);
     $lang = $module->loadLangGWF();
     if (false !== ($error = $module->canAffordB($order, $user))) {
         return $error;
     }
     if (!$user->isAdmin()) {
         if (false === $user->increase('user_credits', -$order->getOrderPriceTotal())) {
             return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
         }
     }
     return Module_Payment::onExecuteOrderS($module2, $order);
 }
コード例 #4
0
ファイル: AP_IPN.php プロジェクト: sinfocol/gwf3
 private function ipn(Module_PaymentAlertpay $module)
 {
     if (Common::getPost("ap_securitycode") !== $module->cfgSecCode()) {
         GWF_Log::log('alertpay', 'Invalid alertpay security code');
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (false === ($email = Common::getPost("ap_custemailaddress"))) {
         GWF_Log::log('alertpay', 'Missing ap_custemailaddress');
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (Common::getPost("ap_status") !== "Success") {
         GWF_Log::log('alertpay', 'Alertpay post was not success');
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (false === ($token = Common::getPost("ap_itemcode"))) {
         GWF_Log::log('alertpay', 'Missing ap_itemcode');
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (false === ($order = GWF_Order::getByToken($token))) {
         GWF_Log::log('alertpay', 'Order not found or token invalid: ' . $token);
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (!$order->isCreated()) {
         return $module->error('err_order');
     }
     if (false === ($price = (double) Common::getPost('ap_amount'))) {
         GWF_Log::log('alertpay', 'MISSING ap_amount for ' . $token);
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if ($price !== (double) $order->getOrderPriceTotal()) {
         GWF_Log::log('alertpay', 'The price for the orders is not the same: ' . $token);
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     $order->saveVar('order_email', $email);
     $module2 = $order->getOrderModule();
     $module2->onLoadLanguage();
     return Module_Payment::onExecuteOrderS($module2, $order);
 }