예제 #1
0
     break;
 case 'selltomember':
 case 'transactions':
     showTransactions($option);
     break;
 case 'setip':
     doSetAddress($option);
     break;
 case 'save':
     switch ($mode) {
         case 'member':
             saveMember($option);
             showMembers($option);
             break;
         case 'transaction':
             saveTransaction($option);
             break;
         case 'bicycle':
             saveBicycle($option);
             break;
         case 'task':
             saveTask($option);
             break;
         case 'mailingsubscriptions':
             saveMemberEmailSubscriptions($option);
             break;
     }
     break;
 case 'showall':
     switch ($mode) {
         case 'member':
예제 #2
0
     db_modifyGoogleCheckoutOrder($new_financial_state, $new_fulfillment_order, $date, $ordernumber);
     $dborder = db_getOrderByOrderNumber($ordernumber);
 }
 if ($financialStateHasChanged) {
     switch ($new_financial_state) {
         case 'REVIEWING':
             break;
         case 'CHARGEABLE':
             //$Grequest->SendProcessOrder($data[$root]['google-order-number']['VALUE']);
             //$Grequest->SendChargeOrder($data[$root]['google-order-number']['VALUE'],'');
             break;
         case 'CHARGING':
             break;
         case 'CHARGED':
             $refundAmount = 0;
             $orderItemsSuccess = saveTransaction($dborder->id, true);
             $Gresponse->log->LogResponse("items count " . count($orderItemsSuccess));
             $itemsToCancel = array();
             //Iterate through the response
             foreach ($orderItemsSuccess as $ois) {
                 $Gresponse->log->LogResponse("id " . $ois["id"] . " - success: " . $ois["success"]);
                 //If item could not be saved in web service, it should be deleted form the order summary
                 if (!$ois["success"]) {
                     //cancel order item
                     db_cancelOrderItem($dborder->id, $ois["id"]);
                     //get item from database
                     $dbItem = db_getItem($ois["id"]);
                     $Gresponse->log->LogResponse("Get Order Item " . $dbItem->id . " from " . $dborder->ordernumber);
                     //get item details
                     $dbOrderItem = db_getOrderItem($dborder->ordernumber, $dbItem->id);
                     $Gresponse->log->LogResponse("Creating Google item " . $dbItem->name);
예제 #3
0
 $dbOrder = db_getOrderById($orderid);
 $userid = "";
 $dbOrder_ordernumber = "";
 foreach ($dbOrder as $o) {
     $dbOrder_ordernumber = $o['ordernumber'];
     $userid = $o['userid'];
 }
 $user = db_getUserById($userid);
 $user_name = "";
 foreach ($user as $u) {
     $user_name = $u['name'];
 }
 //This array will help to create a detailed email of the items that could not be approved
 $failedItems = array();
 //call web service
 $orderItemsSuccess = saveTransaction($orderid, false);
 //Iterate through the response
 foreach ($orderItemsSuccess as $ois) {
     //If item could not be saved in web service, it should be deleted form the order summary
     if (!$ois["success"]) {
         array_push($failedItems, $ois["id"]);
         db_cancelOrderItem($orderid, $ois["id"]);
     }
 }
 //Get active order items
 $items = db_getActiveOrderItems($orderid);
 //get cancelled order items and save the names on a string for a detailed message
 $itemsCancelled = db_getCancelledOrderItems($orderid);
 $cancelledItemsNames = "";
 foreach ($itemsCancelled as $ic) {
     $item = refactored_db_getItem($ic['itemid']);