コード例 #1
0
ファイル: StoreController.php プロジェクト: hukumonline/pmg
 function dropshippingAction()
 {
     if (!is_object($_SESSION['jCart'])) {
         $this->_redirect(ROOT_URL . '/checkout/cartempty');
     }
     if (count($_SESSION['jCart']->items) == 0) {
         $this->_redirect(ROOT_URL . '/checkout/cartempty');
     }
     $cart =& $_SESSION['jCart'];
     if (!is_object($cart)) {
         $cart = new jCart();
     }
     $this->view->cart = $cart;
     $modelUser = new App_Model_Db_Table_User();
     $userDetailInfo = $modelUser->find($this->_user->kopel)->current();
     $this->view->userDetailInfo = $userDetailInfo;
     $modelUserFinance = new App_Model_Db_Table_UserFinance();
     $userFinanceInfo = $modelUserFinance->find($this->_user->kopel)->current();
     if (empty($userFinanceInfo)) {
         $finance = $modelUserFinance->fetchNew();
         $finance->userId = $this->_user->kopel;
         $finance->taxCompany = $userDetailInfo->company;
         $finance->taxAddress = $userDetailInfo->address;
         $finance->taxProvince = $userDetailInfo->state;
         $finance->taxCountryId = $userDetailInfo->countryId;
         $finance->taxZip = $userDetailInfo->zip;
         $finance->taxPhone = $userDetailInfo->phone;
         $finance->taxFax = $userDetailInfo->fax;
         $finance->save();
     }
 }
コード例 #2
0
ファイル: Mailer.php プロジェクト: hukumonline/admin
 public function sendReceiptToUser($orderId, $paymentMethod = '')
 {
     $config = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'mail');
     $siteOwner = "Hukumonline";
     $siteName = $config->mail->sender->support->name;
     $contactEmail = $config->mail->sender->support->email;
     $tblOrder = new App_Model_Db_Table_Order();
     $rowOrder = $tblOrder->find($orderId)->current();
     $userId = $rowOrder->userId;
     //first check if orderId status is PAID, then send the email.
     switch ($rowOrder->orderStatus) {
         case 1:
             die('ORDER STATUS IS NOT YET PAID. CAN NOT SEND RECEIPT!.');
             break;
         case 3:
             $orderStatus = "PAID";
             break;
         case 5:
             $orderStatus = "POSTPAID PENDING";
             break;
         case 6:
             $orderStatus = "PAYMENT REJECTED";
             break;
         case 7:
             $orderStatus = "PAYMENT ERROR";
             break;
         default:
             $orderStatus = "PAYMENT ERROR";
             break;
     }
     $tblUser = new App_Model_Db_Table_User();
     $rowUser = $tblUser->find($userId)->current();
     $userEmail = $rowUser->email;
     $userFullname = $rowUser->fullName;
     $registry = Zend_Registry::getInstance();
     $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT);
     $store = $config->getOption('store');
     $cEmail = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'mail');
     $holConfig = Pandamp_Config::getConfig();
     switch (strtolower($rowOrder->paymentMethod)) {
         case 'paypal':
         case 'manual':
         case 'bank':
         case 'postpaid':
         default:
             $message = "\t\t\t\t\t\nDear {$userFullname},\n\nThis is a payment receipt for Invoice # {$rowOrder->invoiceNumber}\n\nTotal Amount: IDR {$rowOrder->orderTotal}\nTransaction #:\nTotal Paid: IDR {$rowOrder->orderTotal}\nStatus: {$orderStatus}\nYour payment method is: {$paymentMethod}\n\nYou may review your invoice history at any time by logging in to your account " . $holConfig->cdn->id->url . "/user/payment/list\n\nNote: This email will serve as an official receipt for this payment.\n\nSalam,\n\nHUKUMONLINE\n\n==============================";
     }
     $this->send($cEmail->mail->sender->support->email, $cEmail->mail->sender->support->name, $userEmail, $userFullname, "[HUKUMONLINE] Receipt Invoice# " . $rowOrder->invoiceNumber, $message);
 }
コード例 #3
0
ファイル: Mailer.php プロジェクト: hukumonline/pmg
 public function sendReceiptToUser($orderId, $paymentMethod = '', $statusText = '')
 {
     $config = new Zend_Config_Ini(ROOT_DIR . '/app/configs/mail.ini', 'general');
     $siteOwner = "Hukumonline";
     $siteName = $config->mail->sender->support->name;
     $contactEmail = $config->mail->sender->support->email;
     $tblOrder = new App_Model_Db_Table_Order();
     $rowOrder = $tblOrder->find($orderId)->current();
     $userId = $rowOrder->userId;
     //first check if orderId status is PAID, then send the email.
     switch ($rowOrder->orderStatus) {
         case 1:
             die('ORDER STATUS IS NOT YET PAID. CAN NOT SEND RECEIPT!.');
             break;
         case 3:
             $orderStatus = "PAID";
             break;
         case 5:
             $orderStatus = "POSTPAID PENDING";
             break;
         case 6:
             $orderStatus = "PAYMENT REJECTED";
             break;
         case 7:
             $orderStatus = "PAYMENT ERROR";
             break;
         default:
             $orderStatus = "PAYMENT ERROR";
             break;
     }
     $tblUser = new App_Model_Db_Table_User();
     $rowUser = $tblUser->find($userId)->current();
     $userEmail = $rowUser->email;
     $userFullname = $rowUser->fullName;
     switch (strtolower($paymentMethod)) {
         case 'paypal':
         case 'manual':
         case 'bank':
         case 'postpaid':
         default:
             $message = "\nDear {$userFullname},\n\nThis is a payment receipt for Invoice # {$rowOrder->invoiceNumber}\n\nTotal Amount: USD {$rowOrder->orderTotal}\nTransaction #:\nTotal Paid: USD {$rowOrder->orderTotal}\nStatus: {$orderStatus}\nYour payment method is: {$paymentMethod}\n\nYou may review your invoice history at any time by logging in to your account " . ROOT_URL . "/store/payment/list\n\nNote: This email will serve as an official receipt for this payment.\n\nSalam,\n\nHukumonline\n\n==============================";
     }
     $this->send($config->mail->sender->support->email, $config->mail->sender->support->name, $userEmail, '', "Hukumonline Receipt Invoice# " . $rowOrder->invoiceNumber, $message);
 }
コード例 #4
0
ファイル: Mailer.php プロジェクト: hukumonline/store
 public function sendReceiptToUser($orderId, $paymentMethod = '', $statusText = '')
 {
     $config = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'general');
     $siteOwner = "Hukumonline";
     $siteName = $config->mail->sender->support->name;
     $contactEmail = $config->mail->sender->support->email;
     $tblOrder = new App_Model_Db_Table_Order();
     $rowOrder = $tblOrder->find($orderId)->current();
     $userId = $rowOrder->userId;
     //first check if orderId status is PAID, then send the email.
     switch ($rowOrder->orderStatus) {
         case 1:
             die('ORDER STATUS IS NOT YET PAID. CAN NOT SEND RECEIPT!.');
             break;
         case 3:
             $orderStatus = "PAID";
             break;
         case 5:
             $orderStatus = "POSTPAID PENDING";
             break;
         case 6:
             $orderStatus = "PAYMENT REJECTED";
             break;
         case 7:
             $orderStatus = "PAYMENT ERROR";
             break;
         default:
             $orderStatus = "PAYMENT ERROR";
             break;
     }
     $tblUser = new App_Model_Db_Table_User();
     $rowUser = $tblUser->find($userId)->current();
     $userEmail = $rowUser->email;
     $userFullname = $rowUser->fullName;
     switch (strtolower($paymentMethod)) {
         case 'paypal':
         case 'manual':
         case 'bank':
         case 'postpaid':
         default:
             $message = "Kepada Yth, \r\n{$userFullname},\r\n\r\nIni adalah bukti pembayaran untuk faktur # {$rowOrder->invoiceNumber}\r\n\r\nTotal Jumlah: Rp {$rowOrder->orderTotal}\r\nTransaksi #:\r\nJumlah Dibayar: Rp {$rowOrder->orderTotal}\r\nStatus: {$orderStatus}\r\nMetode Pembayaran: {$paymentMethod}\r\n\r\nAnda dapat meninjau riwayat faktur Anda setiap saat dengan log in ke account Anda " . ROOT_URL . "/shop/payment/list\r\n\r\nCatatan: Email ini akan berfungsi sebagai tanda terima resmi untuk pembayaran ini.\r\n\r\nSalam,\r\n\r\nHukumonline\r\n\r\n==============================";
     }
     $this->send($config->mail->sender->support->email, $config->mail->sender->support->name, $userEmail, '', "Hukumonline Receipt Invoice# " . $rowOrder->invoiceNumber, $message);
 }
コード例 #5
0
 function processAction()
 {
     $formater = new Pandamp_Core_Hol_User();
     $orderId = $this->_request->getParam('orderId');
     $packageId = $this->_request->getParam('packageId');
     $paymentSubscription = $this->_request->getParam('paymentSubscription');
     $this->_orderIdNumber = $orderId;
     if (empty($orderId)) {
         echo "kosong";
         die;
     }
     include_once ROOT_DIR . '/app/models/Store.php';
     $modelAppStore = new App_Model_Store();
     if ($modelAppStore->isOrderPaid($orderId)) {
         //forward to error page
         $this->_helper->redirector->gotoSimple('error', 'store', 'hol-site', array('view' => 'orderalreadypaid'));
         die;
     }
     //$tblOrder = new App_Model_Db_Table_Order();
     $items = App_Model_Show_Order::show()->getOrderDetail($orderId);
     $tmpMethod = $this->_request->getParam('method');
     if (!empty($tmpMethod)) {
         $items[0]['paymentMethod'] = $tmpMethod;
     }
     $tblUser = new App_Model_Db_Table_User();
     $rowUser = $tblUser->find($items[0]['userId'])->current();
     $total = $formater->checkPromoValidation('Total', $packageId, $rowUser->promotionId, $paymentSubscription);
     switch ($items[0]['paymentMethod']) {
         case 'nsiapay':
             require_once 'PaymentGateway/Nsiapay.php';
             // include the class file
             $paymentObject = new Nsiapay();
             // initiate an instance of the class
             if ($this->_testMode) {
                 $paymentObject->enableTestMode();
             }
             $paymentObject->addField('TYPE', "IMMEDIATE");
             $subTotal = 0;
             for ($iCart = 0; $iCart < count($items); $iCart++) {
                 $i = $iCart + 1;
                 $basket[] = $items[$iCart]['documentName'] . "," . $items[$iCart]['price'] . ".00" . "," . $items[$iCart]['qty'] . "," . $items[$iCart]['finalPrice'] . ".00";
                 $subTotal += $items[$iCart]['price'] * $items[$iCart]['qty'];
             }
             $ca = implode(";", $basket);
             $merchantId = "000100090000028";
             $paymentObject->addField("BASKET", $ca);
             $paymentObject->addField("MERCHANTID", $merchantId);
             $paymentObject->addField("CHAINNUM", "NA");
             $paymentObject->addField("TRANSIDMERCHANT", $items[0]['invoiceNumber']);
             $paymentObject->addField("AMOUNT", $subTotal);
             $paymentObject->addField("CURRENCY", "360");
             $paymentObject->addField("PurchaseCurrency", "360");
             $paymentObject->addField("acquirerBIN", "360");
             $paymentObject->addField("password", "123456");
             $paymentObject->addField("URL", "http://hukumonline.pl");
             $paymentObject->addField("MALLID", "199");
             $paymentObject->addField("SESSIONID", Zend_Session::getId());
             $sha1 = sha1($subTotal . ".00" . $merchantId . "08iIWbWvO16w" . $items[0]['invoiceNumber']);
             //                echo $subTotal.".00".$merchantId."08iIWbWvO16w".$items[0]['invoiceNumber']."<br>";
             //                echo $sha1;die;
             $paymentObject->addField("WORDS", $sha1);
             //$paymentObject->dumpFields();
             $this->_helper->layout->disableLayout();
             $paymentObject->submitPayment();
             break;
         case 'manual':
         case 'bank':
             /*
              1. update order status
              2. redirect to instruction page 
             */
             //setting payment and status as pending (1), notify = 0, notes = 'paid with...'
             $this->updateInvoiceMethod($orderId, 'bank', 1, 0, 'paid with manual method');
             // HAP: i think we should send this notification when user were on page "Complete Order" and after confirmation made by user is approved;
             //$this->Mailer($orderId, 'admin-order', 'admin');
             //$this->Mailer($orderId, 'user-order', 'user');
             $this->_helper->redirector('instruction', 'payment', 'membership', array('orderId' => $orderId));
             break;
     }
 }
コード例 #6
0
ファイル: User.php プロジェクト: hukumonline/admin
 /**
  * _writeConfirmFreeEmail
  * @return JSON
  */
 function _writeConfirmFreeEmail($mailcontent, $fullname, $username, $password, $guid, $email, $package = '')
 {
     $obj = new Pandamp_Crypt_Password();
     $aclMan = Pandamp_Acl::manager();
     $mailcontent = str_replace('$fullname', $fullname, $mailcontent);
     $mailcontent = str_replace('$username', $username, $mailcontent);
     $mailcontent = str_replace('$password', $password, $mailcontent);
     $mailcontent = str_replace('$guid', $guid, $mailcontent);
     $mailcontent = str_replace('$package', $package, $mailcontent);
     $mail_body = $mailcontent;
     // parse ini_file
     $config = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'mail');
     $mailAttempt = $this->add_mail($config->mail->sender->support->email, $email, $username, $config->mail->sender->support->name, $mail_body);
     // try to save mail before send
     if ($mailAttempt) {
         $sendAttempt = $this->send_mail();
         if ($sendAttempt) {
             $message = "Please check your email at {$email}!";
             // update user
             $tblUser = new App_Model_Db_Table_User();
             $rowUser = $tblUser->find($obj->decryptPassword($guid))->current();
             if ($rowUser) {
                 $rowUser->isEmailSent = 'Y';
                 $rowUser->save();
             }
         } else {
             $message = "Error send mail but register user successfully!<br>Please contact our customer service for more information";
         }
     } else {
         $message = "Error saving mail!";
     }
     return $message;
 }
コード例 #7
0
ファイル: UserController.php プロジェクト: hukumonline/admin
 function resetAction()
 {
     $this->_helper->layout->setLayout('layout-customer-credential');
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $id = $this->_request->getParam('id') ? $this->_request->getParam('id') : '';
     $obj = new Pandamp_Crypt_Password();
     $modelUser = new App_Model_Db_Table_User();
     $row = $modelUser->find($id)->current();
     $newpass = Pandamp_Lib_Formater::randompassowrd();
     $to = $row->email;
     $row->password = $obj->encryptPassword($newpass);
     $subject = "Your new password for Hukumonline.com";
     $message = "Dear {$row->fullName},\n\n";
     $message .= "As you requested, your password has now been reset. Your new details are as follows:\n\n";
     $message .= "Username: "******"\n";
     $message .= "Password: "******"\n\n";
     $message .= "All the best,\n";
     $message .= "Hukumonline.com";
     $config = new Zend_Config_Ini(ROOT_DIR . '/app/configs/mail.ini', 'mail');
     $options = array('auth' => $config->mail->auth, 'username' => $config->mail->username, 'password' => $config->mail->password);
     $transport = new Zend_Mail_Transport_Smtp($config->mail->host, $options);
     $mail = new Zend_Mail();
     $mail->setBodyText($message);
     $mail->setFrom($config->mail->sender->support->email, $config->mail->sender->support->name);
     $mail->addTo($to, $row->fullName);
     $mail->setSubject($subject);
     try {
         $mailTransport = Pandamp_Application::getResource('mail');
         $mail->send($mailTransport);
         $row->save();
     } catch (Zend_Exception $e) {
         echo $e->getMessage();
         die;
     }
 }
コード例 #8
0
 function newAction()
 {
     if (!Pandamp_Controller_Action_Helper_IsAllowed::isAllowed('membership', 'all')) {
         $this->_redirect(ROOT_URL . '/' . $this->_zl->getLanguage() . '/error/restricted');
     }
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $formater = new Pandamp_Core_Hol_User();
     $r = $this->getRequest();
     $kopel = $r->getParam('id');
     $tblInvoice = new App_Model_Db_Table_Invoice();
     $rowInvoice = $tblInvoice->fetchRow("uid='" . $kopel . "'");
     // add invoice but only if empty
     if (!$rowInvoice) {
         $modelUser = new App_Model_Db_Table_User();
         $rowset = $modelUser->find($kopel)->current();
         if (in_array($rowset->packageId, array(14, 15, 16, 17, 18))) {
             if (isset($rowset->paymentId) && $rowset->paymentId != 0) {
                 $periodeId = 2;
                 /**
                  * @modifiedDate: Dec 07, 2012
                  */
                 // Get disc promo
                 //$disc = $formater->checkPromoValidation('Disc',$rowset->packageId,$rowset->promotionId,$rowset->paymentId);
                 // Get total promo
                 //$total = $formater->checkPromoValidation('Total',$rowset->packageId,$rowset->promotionId,$rowset->paymentId);
                 $total = $formater->checkPromoValidation('Total', $rowset->packageId, $rowset->paymentId);
                 $disc = $formater->checkPromoValidation('Disc', $rowset->packageId, $rowset->paymentId);
                 $formater->_writeInvoice($rowset->kopel, $total, $disc, $rowset->paymentId);
             } else {
                 die('Lamanya berlangganan kosong');
             }
         } else {
             $periodeId = 3;
         }
         $data = array('periodeId' => $periodeId, 'modifiedDate' => date("Y-m-d h:i:s"), 'isActive' => 1);
         $modelUser->update($data, "kopel='" . $kopel . "'");
     }
     $zl = Zend_Registry::get("Zend_Locale");
     $this->_redirect(ROOT_URL . "/" . $zl->getLanguage() . '/customer/user/invoicelist/id/' . $kopel);
 }