本文整理汇总了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'));
}
}
}
示例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);
}
}