} if (!isset($_POST['custom'])) { $errors .= $paypal->getL('custom') . '<br />'; } if (!isset($_POST['txn_id'])) { $errors .= $paypal->getL('txn_id') . '<br />'; $_POST['txn_id'] = 0; } if (!isset($_POST['mc_currency'])) { $errors .= $paypal->getL('mc_currency') . '<br />'; } if (empty($errors)) { $cart = new Cart((int) $cart_secure[0]); if (!$cart->id) { $errors = $paypal->getL('cart') . '<br />'; } elseif (Order::getOrderByCartId((int) $cart_secure[0])) { $errors = $paypal->getL('order') . '<br />'; } else { $paypal->validateOrder((int) $cart_secure[0], _PS_OS_PAYMENT_, (double) $_POST['mc_gross'], $paypal->displayName, $paypal->getL('transaction') . $_POST['txn_id'], array('transaction_id' => $_POST['txn_id'], 'payment_status' => $_POST['payment_status']), NULL, false, $cart_secure[1]); } } } else { $errors .= $paypal->getL('verified'); } if (!empty($errors) and isset($_POST['custom'])) { if (strtoupper($_POST['payment_status']) == 'PENDING') { $paypal->validateOrder((int) $cart_secure[0], _PS_OS_PAYPAL_, (double) $_POST['mc_gross'], $paypal->displayName, $paypal->getL('transaction') . $_POST['txn_id'] . '<br />' . $errors, array('transaction_id' => $_POST['txn_id'], 'payment_status' => $_POST['payment_status']), NULL, false, $cart_secure[1]); } else { $paypal->validateOrder((int) $cart_secure[0], _PS_OS_ERROR_, 0, $paypal->displayName, $errors . '<br />', array(), NULL, false, $cart_secure[1]); } }
} if (!isset($_POST['txn_id'])) { $errors .= $paypal->l('PayPal key \'txn_id\' not specified, transaction unknown') . '<br />'; $_POST['txn_id'] = 0; } if (!isset($_POST['mc_currency'])) { $errors .= $paypal->l('PayPal key \'mc_currency\' not specified, currency unknown') . '<br />'; } if (empty($errors)) { $cart = new Cart((int) $cart_secure[0]); if (!$cart->id) { $errors = $paypal->l('Cart not found') . '<br />'; } elseif (Order::getOrderByCartId((int) $cart_secure[0])) { $errors = $paypal->l('Order has already been placed') . '<br />'; } else { $paypal->validateOrder((int) $cart_secure[0], Configuration::get('PS_OS_PAYMENT'), (double) $_POST['mc_gross'], $paypal->displayName, $paypal->l('Paypal Transaction ID: ') . $_POST['txn_id'], array('transaction_id' => $_POST['txn_id'], 'payment_status' => $_POST['payment_status']), null, false, $cart_secure[1]); } } } else { $errors .= $paypal->l('The PayPal transaction could not be VERIFIED.'); } // Set transaction details if pcc is defiend in PaymentModule class if (isset($paypal->pcc)) { $paypal->pcc->transaction_id = isset($_POST['txn_id']) ? $_POST['txn_id'] : ''; } if (!empty($errors) and isset($_POST['custom'])) { if (strtoupper($_POST['payment_status']) == 'PENDING') { $paypal->validateOrder((int) $cart_secure[0], Configuration::get('PS_OS_PAYPAL'), (double) $_POST['mc_gross'], $paypal->displayName, $paypal->l('Paypal Transaction ID: ') . $_POST['txn_id'] . '<br />' . $errors, array('transaction_id' => $_POST['txn_id'], 'payment_status' => $_POST['payment_status']), NULL, false, $cart_secure[1]); } else { $paypal->validateOrder((int) $cart_secure[0], Configuration::get('PS_OS_ERROR'), 0, $paypal->displayName, $errors . '<br />', array(), NULL, false, $cart_secure[1]); }
} if (!isset($_POST['payment_status'])) { $errors .= $paypal->getL('payment_status') . '<br />'; } elseif ($_POST['payment_status'] != 'Completed') { $errors .= $paypal->getL('payment') . $_POST['payment_status'] . '<br />'; } if (!isset($_POST['custom'])) { $errors .= $paypal->getL('custom') . '<br />'; } if (!isset($_POST['txn_id'])) { $errors .= $paypal->getL('txn_id') . '<br />'; } if (!isset($_POST['mc_currency'])) { $errors .= $paypal->getL('mc_currency') . '<br />'; } if (empty($errors)) { $cart = new Cart(intval($_POST['custom'])); if (!$cart->id) { $errors = $paypal->getL('cart') . '<br />'; } elseif (Order::getOrderByCartId(intval($_POST['custom']))) { $errors = $paypal->getL('order') . '<br />'; } else { $paypal->validateOrder($_POST['custom'], _PS_OS_PAYMENT_, floatval($_POST['mc_gross']), $paypal->displayName, $paypal->getL('transaction') . $_POST['txn_id']); } } } else { $errors .= $paypal->getL('verified'); } if (!empty($errors) and isset($_POST['custom'])) { $paypal->validateOrder(intval($_POST['custom']), _PS_OS_ERROR_, 0, $paypal->displayName, $errors . '<br />'); }