Example #1
0
 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);
 }
Example #2
0
 public static function logResArray(array $resArray)
 {
     $msg = 'PaypalResponse:' . PHP_EOL;
     foreach ($resArray as $k => $v) {
         $msg .= "{$k} => {$v}\n";
     }
     GWF_Log::log('paypal', $msg);
 }
Example #3
0
<?php

chdir('../../../');
require_once 'core/inc/util/GWF_Log.php';
GWF_Log::init('Guest', true, dirname(__FILE__) . '/testlog');
GWF_Log::log('baim', 'THIS MC IS HACKED!');
Example #4
0
 private function garbage($real_token = '???', $real_mc = '???', $ext_msg = 'somethings wrong')
 {
     $msg = sprintf('InvalidMC: uid=%d, token=%s(%s), mc=%s(%s): %s.', Common::getGet('id') - 1000, Common::getGet('token'), $real_token, Common::getGet('mc'), $real_mc, $ext_msg);
     GWF_Log::log('baim_log.txt', $msg);
     return GWF_Random::randomKey(self::SHA512_LEN, GWF_Random::HEXLOWER);
 }