| 717 |
|
|
| 718 |
// Handles a complete Website Payments Standard sale. |
// Handles a complete Website Payments Standard sale. |
| 719 |
function uc_paypal_complete($order_id = 0) { |
function uc_paypal_complete($order_id = 0) { |
| 720 |
|
// If the order ID specified in the return URL is not the same as the one in |
| 721 |
|
// the user's session, we need to assume this is either a spoof or that the |
| 722 |
|
// user tried to adjust the order on this side while at PayPal. If it was a |
| 723 |
|
// legitimate checkout, the IPN will still come in from PayPal so the order |
| 724 |
|
// gets processed correctly. We'll leave an ambiguous message just in case. |
| 725 |
if (intval($_SESSION['cart_order']) != $order_id) { |
if (intval($_SESSION['cart_order']) != $order_id) { |
| 726 |
$_SESSION['cart_order'] = $order_id; |
drupal_set_message(t('Thank you for your order! We will be notified by PayPal that we have received your payment.')); |
| 727 |
|
drupal_goto('cart'); |
| 728 |
} |
} |
| 729 |
|
|
| 730 |
if (!($order = uc_order_load($order_id))) { |
if (!($order = uc_order_load($order_id)) || $order->payment_method != 'paypal_wps') { |
| 731 |
drupal_goto('cart'); |
drupal_goto('cart'); |
| 732 |
} |
} |
| 733 |
|
|