當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Paypal::validateOrder方法代碼示例

本文整理匯總了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]);
    }
}
開發者ID:priyankajsr19,項目名稱:indusdiva2,代碼行數:31,代碼來源:validation.php

示例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]);
    }
開發者ID:Evil1991,項目名稱:PrestaShop-1.4,代碼行數:31,代碼來源:validation.php

示例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 />');
}
開發者ID:sealence,項目名稱:local,代碼行數:31,代碼來源:validation.php


注:本文中的Paypal::validateOrder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。