Example #1
0
 function after_process()
 {
     global $insert_id, $order;
     $country = MODULE_PAYMENT_MERCADOPAGO_COUNTRY;
     $conversion_data = $this->currency_conversion($order, $country);
     $dados = array('external_reference' => $insert_id, 'title' => $order->products[0]['name'], 'description' => $order->products[0]['name'], 'quantity' => $order->products[0]['qty'], 'currency' => $conversion_data['currency'], 'amount' => $conversion_data['amount'], 'image' => 'https://www.mercadopago.com/org-img/MP3/home/logomp3.gif', 'category' => MODULE_PAYMENT_MERCADOPAGO_CATEGORIES, 'payment_firstname' => $order->customer['firstname'], 'payment_lastname' => $order->customer['lastname'], 'email' => $order->customer['email_address'], 'phone' => $order->customer['telephone'], 'customer_date_created' => $this->getCustomerDateCreated($order->customer['email_address']), 'customer_zipcode' => $order->customer['postcode'], 'customer_address' => $order->customer['street_address'], 'delivery_zipcode' => $order->delivery['postcode'], 'delivery_address' => $order->delivery['street_address'], 'pending' => MODULE_PAYMENT_MERCADOPAGO_PENDING_URL, 'approved' => MODULE_PAYMENT_MERCADOPAGO_SUCESS_URL);
     $exclude = MODULE_PAYMENT_MERCADOPAGO_METHODS;
     // string
     $limit = MODULE_PAYMENT_MERCADOPAGO_INSTALMENTS;
     $pagamento = new MpShop(MODULE_PAYMENT_MERCADOPAGO_CLIENTID, MODULE_PAYMENT_MERCADOPAGO_CLIENTSECRET);
     tep_session_register('botton');
     $botton = $pagamento->GetCheckout($dados, $exclude, $limit);
     // unregister session variables used during checkout
     tep_session_unregister('sendto');
     tep_session_unregister('billto');
     tep_session_unregister('shipping');
     tep_session_unregister('payment');
     tep_session_unregister('comments');
     tep_redirect(tep_href_link('mercadopago.php', 'bt=' . trim($botton), 'SSL'));
 }
Example #2
0
 function after_process()
 {
     global $insert_id, $order;
     //      /  if ($order->info['currency'] != 'BRL' || $order->info['currency'] != 'ARS' || $order->info['currency'] != 'USD'
     $dados = array('external_reference' => $insert_id, 'currency' => $order->info['currency'], 'title' => $order->products[0]['name'], 'description' => $order->products[0]['name'], 'quantity' => $order->products[0]['qty'], 'image' => 'https://www.mercadopago.com/org-img/MP3/home/logomp3.gif', 'amount' => $order->info['total'], 'payment_firstname' => $order->customer['firstname'], 'payment_lastname' => $order->customer['lastname'], 'email' => $order->customer['email_address'], 'pending' => MODULE_PAYMENT_MERCADOPAGO_PENDING_URL, 'approved' => MODULE_PAYMENT_MERCADOPAGO_SUCESS_URL);
     $country = MODULE_PAYMENT_MERCADOPAGO_COUNTRY;
     $exclude = MODULE_PAYMENT_MERCADOPAGO_METHODS;
     // string
     $limit = MODULE_PAYMENT_MERCADOPAGO_LIMIT;
     $pagamento = new MpShop(MODULE_PAYMENT_MERCADOPAGO_CLIENTID, MODULE_PAYMENT_MERCADOPAGO_CLIENTSECRET);
     tep_session_register('botton');
     $botton = $pagamento->GetCheckout($dados, $exclude, $limit);
     // unregister session variables used during checkout
     tep_session_unregister('sendto');
     tep_session_unregister('billto');
     tep_session_unregister('shipping');
     tep_session_unregister('payment');
     tep_session_unregister('comments');
     tep_redirect(tep_href_link('mercadopago.php', 'bt=' . trim($botton), 'SSL'));
 }