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


PHP Paypal::getPayPalCustomerIdByEmail方法代碼示例

本文整理匯總了PHP中Paypal::getPayPalCustomerIdByEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP Paypal::getPayPalCustomerIdByEmail方法的具體用法?PHP Paypal::getPayPalCustomerIdByEmail怎麽用?PHP Paypal::getPayPalCustomerIdByEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Paypal的用法示例。


在下文中一共展示了Paypal::getPayPalCustomerIdByEmail方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

     // Set details for a payment
     $ppec->setExpressCheckout();
     if ($ppec->hasSucceedRequest() && !empty($ppec->token)) {
         $ppec->redirectToAPI();
     } else {
         $ppec->displayPayPalAPIError($ppec->l('Error during the prepration of the express checkout payment'), $ppec->logs);
     }
 } elseif (!empty($ppec->token) && $ppec->token == Tools::getValue('token') && ($ppec->payer_id = Tools::getValue('PayerID'))) {
     // Get payment infos from paypal
     $ppec->getExpressCheckout();
     if ($ppec->hasSucceedRequest() && !empty($ppec->token)) {
         $address = null;
         $customer = null;
         // Create Customer if not exist with address etc
         if ($ppec->getContext()->cookie->logged) {
             if (!($id_customer = Paypal::getPayPalCustomerIdByEmail($ppec->result['EMAIL']))) {
                 PayPal::addPayPalCustomer($ppec->getContext()->customer->id, $ppec->result['EMAIL']);
             }
             $customer = $ppec->getContext()->customer;
         } elseif ($id_customer = Customer::customerExists($ppec->result['EMAIL'], true)) {
             $customer = new Customer($id_customer);
         } else {
             $customer = new Customer();
             $customer->email = $ppec->result['EMAIL'];
             $customer->lastname = $ppec->result['LASTNAME'];
             $customer->firstname = $ppec->result['FIRSTNAME'];
             $customer->passwd = Tools::encrypt(Tools::passwdGen());
             $customer->add();
             PayPal::addPayPalCustomer($customer->id, $ppec->result['EMAIL']);
         }
         if (!$customer->id) {
開發者ID:rtajmahal,項目名稱:PrestaShop-modules,代碼行數:31,代碼來源:submit.php

示例2: elseif

    /* Set details for a payment */
    $ppec->setExpressCheckout();
    if ($ppec->hasSucceedRequest() && !empty($ppec->token)) {
        $ppec->redirectToAPI();
    } else {
        $ppec->displayPayPalAPIError($ppec->l('Error during the preparation of the Express Checkout payment'), $ppec->logs);
    }
} elseif (!empty($ppec->token) && $ppec->token == $token && ($ppec->payer_id = $payer_id)) {
    /* Get payment infos from paypal */
    $ppec->getExpressCheckout();
    if ($ppec->hasSucceedRequest() && !empty($ppec->token)) {
        $address = $customer = null;
        $email = $ppec->result['EMAIL'];
        /* Create Customer if not exist with address etc */
        if ($ppec->context->cookie->logged) {
            $id_customer = Paypal::getPayPalCustomerIdByEmail($email);
            if (!$id_customer) {
                PayPal::addPayPalCustomer($ppec->context->customer->id, $email);
            }
            $customer = $ppec->context->customer;
        } elseif ($id_customer = Customer::customerExists($email, true)) {
            $customer = new Customer($id_customer);
        } else {
            $customer = setCustomerInformation($ppec, $email);
            $customer->add();
            PayPal::addPayPalCustomer($customer->id, $email);
        }
        if (!$customer->id) {
            $ppec->logs[] = $ppec->l('Cannot create customer');
        }
        if (!isset($ppec->result['PAYMENTREQUEST_0_SHIPTOSTREET']) || !isset($ppec->result['PAYMENTREQUEST_0_SHIPTOCITY']) || !isset($ppec->result['SHIPTOZIP']) || !isset($ppec->result['COUNTRYCODE'])) {
開發者ID:ventsiwad,項目名稱:presta_addons,代碼行數:31,代碼來源:payment.php


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