当前位置: 首页>>代码示例>>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;未经允许,请勿转载。