當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Transaction::get_error_message方法代碼示例

本文整理匯總了PHP中Transaction::get_error_message方法的典型用法代碼示例。如果您正苦於以下問題:PHP Transaction::get_error_message方法的具體用法?PHP Transaction::get_error_message怎麽用?PHP Transaction::get_error_message使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transaction的用法示例。


在下文中一共展示了Transaction::get_error_message方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

         }
     }
 } else {
     if ($transaction->anet_CIM(false)) {
         // success
         if (!empty($order_weekday->meals)) {
             $dbi->update('Orders', array('TransactionNumber' => $transaction->PymtRefCd), array('OrderID' => $order_weekday->OrderID));
             $_SESSION['successWeekly'][] = $order_weekday->OrderID;
         }
         if (!empty($order_weekend->meals)) {
             $dbi->update('Orders', array('TransactionNumber' => $transaction->PymtRefCd), array('OrderID' => $order_weekend->OrderID));
             $_SESSION['successWeekly'][] = $order_weekend->OrderID;
         }
     } else {
         // anet error
         Gadget::add_message("Error while processing Order {$orderID} - " . $transaction->get_error_message());
         //die($transaction->get_error_message());
         $orderSuccess = false;
     }
     $krustomer->First_Order_Date = $krustomer->First_Order_Date ? $krustomer->First_Order_Date : $date;
     $krustomer->Last_Order_Date = date('Y-m-d');
     $krustomer->Total_Orders++;
     $krustomer->update();
     $orderSuccess = true;
     // If they used a promocode that was an ammount, subtract total from promocode amount
     if ($promoCode->multiple_use == 0) {
         if ($promoCode->Amount > 0 && $promoCode->PromoCodeType == "Amount Discount") {
             $newPromoCodeAmount = $promoCode->Amount - $order->Amounts->Subtotal->amount;
             if ($newPromoCodeAmount < 0) {
                 $newPromoCodeAmount = 0;
             }
開發者ID:elliecm,項目名稱:MadisonandRayne,代碼行數:31,代碼來源:checkout.php

示例2: intval

                    if ($PromoCode && $PromoCode->can_be_used($_SESSION['CustomerID'], 'GiftCertificates')) {
                        $promoCodeAmount = intval($PromoCode->Amount);
                        $giftCertAmount  = intval($data['GiftAmount']);

                        $newPromoCodeAmount = $promoCodeAmount - $giftCertAmount;
                        if ($newPromoCodeAmount < 0) {
                            $newPromoCodeAmount = 0;
                        }
                        $dbi->update('PromoCodes', array('Amount' => $newPromoCodeAmount), array('PromoCodeID' => $PromoCodeID));
                    }
                }

                //Gadget::add_message('success');
                Gadget::redirect('success2');
            } else {
                Gadget::add_message($transaction->get_error_message());
            }
        } catch (Exception $e) {
            s('Error: ' . $e->getMessage() . $transaction->get_error_message());
            Gadget::add_message($e->getMessage() . $transaction->get_error_message());
        }
    }
}

$page = Page::get_from_alias('giftcertificates');
$page->add_js('/js/giftcertificates.js');

require 'header.php';
?>
<div class="content-padding">
    <div><?php echo $page->content['main']; ?></div>
開發者ID:elliecm,項目名稱:MadisonandRayne,代碼行數:31,代碼來源:giftcertificates.php

示例3: array

            $krustomer->Last_Order_Date  = $date;
            $krustomer->Total_Orders++;
            $krustomer->update();

            //make sure there is an order record
            //@golive change date - Gadget::$date_do->format(DATE_FORMAT_MYSQL)
            $insert_data = array(
                'CustomerID'   => $krustomer->CustomerID,
                'DeliveryDate' => $sub->DeliveryDate,
                'DateOrdered'  => array('NOW()', ''),
                'Total'        => 0,
            );

            //$dbi->insert('Orders', $insert_data, array(), 'IGNORE');
        } else { // anet error
            echo "Error while processing subscription for Customer $sub->CustomerID - {$transaction->get_error_message()}";
            b();
        }
    } else {
        echo "Can't process subscription for Customer $krustomer->CustomerID - missing authorize.net profiles";
        b();
    }
    h();
}

//insert new subscription rows
/*
$dbi->q("
    INSERT IGNORE INTO Subscriptions (DeliveryDate, CustomerID, WeeklyMeals, WeeklyReg, WeeklyVeg)
        SELECT DATE_ADD('$date', INTERVAL 6 DAY) AS DeliveryDate, CustomerID, WeeklyMeals, WeeklyReg, WeeklyVeg
        FROM Customers
開發者ID:elliecm,項目名稱:MadisonandRayne,代碼行數:31,代碼來源:process_orders.php


注:本文中的Transaction::get_error_message方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。