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


PHP Shop::GetStatus方法代碼示例

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


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

示例1: retorno

 public function retorno()
 {
     if (isset($_REQUEST['id'])) {
         $id = $_REQUEST['id'];
         $client_id = $this->config->get('mercadopago2_client_id');
         $client_secret = $this->config->get('mercadopago2_client_secret');
         $checkdata = new Shop($client_id, $client_secret);
         $dados = $checkdata->GetStatus($id);
         $order_id = $dados['collection']['external_reference'];
         $order_status = $dados['collection']['status'];
         $this->load->model('checkout/order');
         $order = $this->model_checkout_order->getOrder($order_id);
         if ($order['order_status_id'] == '0') {
             $this->model_checkout_order->confirm($order_id, $this->config->get('mercadopago_order_status_id'));
         }
         switch ($order_status) {
             case 'approved':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_completed'));
                 break;
             case 'pending':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_pending'));
                 break;
             case 'in_process':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_process'));
                 break;
             case 'reject':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_rejected'));
                 break;
             case 'refunded':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_refunded'));
                 break;
             case 'cancelled':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_cancelled'));
                 break;
             case 'in_metiation':
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_in_mediation'));
                 break;
             default:
                 $this->model_checkout_order->update($order_id, $this->config->get('mercadopago2_order_status_id_pending'));
         }
     }
 }
開發者ID:BrunoCodeman,項目名稱:cart-opencart,代碼行數:42,代碼來源:mercadopago2.php

示例2: mp_retorno

function mp_retorno()
{
    if (isset($_REQUEST['id']) && isset($_REQUEST['topic'])) {
        $id = $_REQUEST['id'];
        $client_id = get_option('mercadopago_client_id');
        $client_secret = get_option('mercadopago_client_secret');
        $checkdata = new Shop($client_id, $client_secret);
        $dados = $checkdata->GetStatus($id);
        $order_id = $dados['collection']['external_reference'];
        $order_status = $dados['collection']['status'];
        $mp_id = $dados['collection']['order_id'];
        switch ($order_status) {
            case 'approved':
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 3, notes = 'Payment Approved by MercadoPago' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
                break;
            case 'pending':
            case 'in_process':
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 2, notes = 'Order received, wait for payment confirmation' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
                break;
            case 'reject':
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 6, notes = 'Payment declined by MercadoPago, contact the client and ask to do a new order' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
                break;
            case 'refunded':
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 6, notes = 'Payment refunded by MercadoPago' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
                break;
            case 'cancelled':
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 6, notes = 'Payment canceled by MercadoPago' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
                break;
            case 'in_metiation':
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 6, notes = 'This orders has a mediation in MercadoPago' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
                break;
            default:
                $purchase_log_sql = "UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET transactid = " . $mp_id . ", processed = 2, notes = 'Order received, wait for payment confirmation' WHERE `sessionid`= '" . $order_id . "' LIMIT 1";
        }
        $purchase_log = $wpdb->get_results($purchase_log_sql, ARRAY_A);
    }
}
開發者ID:jucaripo,項目名稱:cart-wp-commerce,代碼行數:37,代碼來源:mercadopago.php


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