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


PHP OrderHistory::addWithEmail方法代碼示例

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


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

示例1: setOrderAs

 /**
  * Set order as paid or canceled
  *
  * @param integer $state
  * @param integer $order_id
  * @param float $order_total
  * @param string $barcode
  *
  * @return void
  */
 private static function setOrderAs($state, $order_id, $order_total = null, $barcode = null)
 {
     $return = false;
     try {
         $order = new Order((int) $order_id);
         if (!is_null($order_total) && !is_null($barcode)) {
             $order->addOrderPayment($order_total, 'CashWay', $barcode);
             $order->setInvoice(true);
         }
         $history = new OrderHistory();
         $history->id_order = (int) $order->id;
         $history->changeIdOrderState((int) $state, $order);
         $history->addWithEmail(true);
         $return = true;
     } catch (Exception $e) {
         \CashWay\Log::error($e->getMessage());
     }
     return $return;
 }
開發者ID:vAugagneur,項目名稱:plugins,代碼行數:29,代碼來源:cashway.php

示例2: dirname

 */
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
if (!defined('_PS_VERSION_')) {
    exit;
}
// To configure, add webhook in account storename.com/modules/conektaefectivo/notification.php
$body = Tools::file_get_contents('php://input');
$event_json = Tools::jsonDecode($body);
if ($event_json->type == 'charge.paid') {
    $charge = $event_json->data->object;
    $reference_id = (int) $charge->reference_id;
    $id_order = Order::getOrderByCartId($reference_id);
    $order = new Order($id_order);
    $order_fields = $order->getFields();
    $currency_payment = Currency::getPaymentCurrencies(Module::getModuleIdByName('conektaprestashop'), $order_fields['id_shop']);
    $total_order_amount = (int) $order->getOrdersTotalPaid();
    $str_total_order_amount = (string) $total_order_amount;
    $format_total_order_amount = str_pad($str_total_order_amount, strlen($str_total_order_amount) + 2, '0', STR_PAD_RIGHT);
    if ($currency_payment[0]['iso_code'] === $charge->currency) {
        if ($format_total_order_amount == $charge->amount) {
            $orderHistory = new OrderHistory();
            $orderHistory->id_order = $order;
            $orderHistory->changeIdOrderState(Configuration::get('PS_OS_PAYMENT'), $order);
            $orderHistory->addWithEmail();
            Db::getInstance()->Execute('UPDATE ' . _DB_PREFIX_ . 'conekta_transaction SET status = "paid" WHERE id_order = ' . pSQL($reference_id) . '');
        }
    }
}
header('HTTP/1.1 200 OK');
exit;
開發者ID:conekta,項目名稱:conektaprestashop,代碼行數:31,代碼來源:notification.php


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