本文整理汇总了PHP中Paypal::validateOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::validateOrder方法的具体用法?PHP Paypal::validateOrder怎么用?PHP Paypal::validateOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paypal
的用法示例。
在下文中一共展示了Paypal::validateOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Cart
}
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]);
}
}
示例2: Cart
}
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]);
}
示例3: elseif
}
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 />');
}