| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
function uc_zpayment_complete (){
|
| 5 |
|
| 6 |
watchdog('zpayment', 'Receiving new order notification for order !order_id.', array('!order_id' => check_plain($_POST['LMI_PAYMENT_NO'])));
|
| 7 |
|
| 8 |
$cart_id = intval($_POST['LMI_PAYMENT_NO']);
|
| 9 |
|
| 10 |
$order = uc_order_load($cart_id);
|
| 11 |
|
| 12 |
if ($order === FALSE || uc_order_status_data($order->order_status, 'state') != 'in_checkout') {
|
| 13 |
print t('An error has occurred during payment. Please contact us to ensure your order has submitted.');
|
| 14 |
exit();
|
| 15 |
}
|
| 16 |
|
| 17 |
|
| 18 |
if (strtolower($_POST['CLIENT_MAIL']) !== strtolower($order->primary_email)) {
|
| 19 |
uc_order_comment_save($order->order_id, 0, t('Customer used a different e-mail address during payment: !email', array('!email' => check_plain($_POST['CLIENT_MAIL']))), 'admin');
|
| 20 |
}
|
| 21 |
|
| 22 |
$url = 'cart/zpayment/finalize/'. $order->order_id;
|
| 23 |
uc_zpayment_redirect_url($url);
|
| 24 |
|
| 25 |
}
|
| 26 |
|