当前位置: 首页>>代码示例>>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;未经允许,请勿转载。