当前位置: 首页>>代码示例>>PHP>>正文


PHP Paypal::l方法代码示例

本文整理汇总了PHP中Paypal::l方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::l方法的具体用法?PHP Paypal::l怎么用?PHP Paypal::l使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paypal的用法示例。


在下文中一共展示了Paypal::l方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dirname

* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
include_once dirname(__FILE__) . '/../../config/config.inc.php';
include_once dirname(__FILE__) . '/../../init.php';
include_once _PS_MODULE_DIR_ . 'paypal/paypal.php';
$paypal = new Paypal();
$paypal_order = new PayPalOrder();
if (!($transaction_id = Tools::getValue('txn_id'))) {
    die($paypal->l('No transaction id'));
}
if (!($id_order = $paypal_order->getIdOrderByTransactionId($transaction_id))) {
    die($paypal->l('No order'));
}
$order = new Order((int) $id_order);
if (!Validate::isLoadedObject($order) || !$order->id) {
    die($paypal->l('Invalid order'));
}
if (!($amount = (double) Tools::getValue('mc_gross') || $amount != $order->total_paid)) {
    die($paypal->l('Incorrect amount'));
}
if (!($status = (string) Tools::getValue('payment_status'))) {
    die($paypal->l('Incorrect order status'));
}
// Getting params
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:31,代码来源:ipn.php

示例2: array

            $this->context->smarty->assign('errors', array($this->paypal->l('Payment error')));
        }
        echo $this->paypal->fetchTemplate('/views/templates/front/', 'order-confirmation');
    }
}
if (Tools::getValue('id_module') && Tools::getValue('key') && Tools::getValue('id_cart') && Tools::getValue('id_order')) {
    if (_PS_VERSION_ < '1.5') {
        new PayPalExpressCheckoutSubmit();
    }
} elseif (Tools::getValue('get_qty')) {
    /* Ajax response */
    $id_product = (int) Tools::getValue('id_product');
    $id_product_attribute = (int) Tools::getValue('id_product_attribute');
    if (Product::getQuantity((int) $id_product, (int) $id_product_attribute) <= 0) {
        $paypal = new Paypal();
        die($paypal->l('This product is no longer in stock with those attributes but is available with others'));
    }
    die(true);
} else {
    $request_type = Tools::getValue('express_checkout');
    $ppec = new PaypalExpressCheckout($request_type);
    if ($request_type && $ppec->type) {
        $id_product = (int) Tools::getValue('id_product');
        $id_product_attribute = (int) Tools::getValue('id_p_attr');
        $product_quantity = (int) Tools::getValue('quantity');
        if ($id_product > 0 && $id_product_attribute !== false && $product_quantity > 0) {
            // Create new Cart to avoid any refresh or other bad manipulations
            $ppec->context->cart = new Cart();
            $ppec->context->cart->id_currency = (int) $ppec->context->currency->id;
            $ppec->context->cart->id_lang = (int) $ppec->context->language->id;
            $secure_key = isset($ppec->context->customer) ? $ppec->context->customer->secure_key : '';
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:31,代码来源:submit.php

示例3: urlencode

$params = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
    $params .= '&' . $key . '=' . urlencode(stripslashes($value));
}
// PayPal Server
$paypalServer = 'www.' . (Configuration::get('PAYPAL_SANDBOX') ? 'sandbox.' : '') . 'paypal.com';
// Getting PayPal data...
if (function_exists('curl_exec')) {
    // curl ready
    $ch = curl_init('https://' . $paypalServer . '/cgi-bin/webscr');
    // If the above fails, then try the url with a trailing slash (fixes problems on some servers)
    if (!$ch) {
        $ch = curl_init('https://' . $paypalServer . '/cgi-bin/webscr/');
    }
    if (!$ch) {
        $errors .= $paypal->l('Problem connecting to the PayPal server.');
        $errors .= ' ';
        $errors .= $paypal->l('Connection using cURL failed');
    } else {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        $result = curl_exec($ch);
        if (strtoupper($result) != 'VERIFIED') {
            $errors .= $paypal->l('Verification failure (using cURL). Returned: ') . $result . ' cURL error:' . curl_error($ch);
        }
        curl_close($ch);
    }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:31,代码来源:validation.php


注:本文中的Paypal::l方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。