首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >paypal运输详细信息中未定义的索引

paypal运输详细信息中未定义的索引
EN

Stack Overflow用户
提问于 2017-03-30 10:07:49
回答 1查看 796关注 0票数 1

我从paypal的发货详细信息中得到了这条错误消息。

注意:未定义索引:第41行/var/www/html/pp/temp/review.php中的问候语 注意:未定义索引:第43行/var/www/html/pp/temp/review.php中的MIDDLENAME 注意:未定义的索引:第45行/var/www/html/pp/temp/review.php中的后缀 注意:未定义索引:第50行/var/www/html/pp/temp/review.php中的SHIPTOSTREET2 注意:未定义索引:第56行中/var/www/html/pp/temp/review.php中的INVNUM 注意:未定义索引:第57行中/var/www/html/pp/temp/review.php中的PHONENUM

我试过这个

代码语言:javascript
复制
if( $ack == "SUCCESS" || $ack == "SUCESSWITHWARNING") 
    { 
          ///  echo '<pre>';print_r($resArray);exit;
        /*
        ' The information that is returned by the GetExpressCheckoutDetails call should be integrated by the partner into his Order Review 
        ' page      
        */
        $email              = $resArray["EMAIL"]; // ' Email address of payer.
        $payerId            = $resArray["PAYERID"]; // ' Unique PayPal customer account identification number.
        $payerStatus        = $resArray["PAYERSTATUS"]; // ' Status of payer. Character length and limitations: 10 single-byte alphabetic characters.
        $salutation         = $resArray["SALUTATION"]?$resArray["SALUTATION"]:''; // ' Payer's salutation.
        $firstName          = $resArray["FIRSTNAME"]; // ' Payer's first name.
        $middleName         = $resArray["MIDDLENAME"]?$resArray["MIDDLENAME"]:''; // ' Payer's middle name.
        $lastName           = $resArray["LASTNAME"]; // ' Payer's last name.
        $suffix             = $resArray["SUFFIX"]?$resArray["SUFFIX"]:''; // ' Payer's suffix.
        $cntryCode          = $resArray["COUNTRYCODE"]; // ' Payer's country of residence in the form of ISO standard 3166 two-character country codes.
        $business           = $resArray["BUSINESS"]; // ' Payer's business name.
        $shipToName         = $resArray["SHIPTONAME"]; // ' Person's name associated with this address.
        $shipToStreet       = $resArray["SHIPTOSTREET"]; // ' First street address.
        $shipToStreet2      = $resArray["SHIPTOSTREET2"]?$resArray["SHIPTOSTREET2"]:''; // ' Second street address.
        $shipToCity         = $resArray["SHIPTOCITY"]; // ' Name of city.
        $shipToState        = $resArray["SHIPTOSTATE"]; // ' State or province
        $shipToCntryCode    = $resArray["SHIPTOCOUNTRYCODE"]; // ' Country code. 
        $shipToZip          = $resArray["SHIPTOZIP"]; // ' U.S. Zip code or other country-specific postal code.
        $addressStatus      = $resArray["ADDRESSSTATUS"]; // ' Status of street address on file with PayPal   
        $invoiceNumber      = $resArray["INVNUM"]?$resArray["INVNUM"]:''; // ' Your own invoice or tracking number, as set by you in the element of the same name in SetExpressCheckout request .
        $phonNumber         = $resArray["PHONENUM"]?$resArray["PHONENUM"]:''; // ' Payer's contact telephone number. Note:  PayPal returns a contact telephone number only if your Merchant account profile settings require that the buyer enter one. 

    } 

但是我仍然可以用相同的issue.How来解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-30 12:24:35

使用isset ()函数检查是否设置了变量。替换

代码语言:javascript
复制
$salutation         = $resArray["SALUTATION"]?$resArray["SALUTATION"]:''; 

代码语言:javascript
复制
 $salutation = $resArray["SALUTATION"] ?? "default"; (for php 7)
$var = isset($resArray["SALUTATION"]) ? $resArray["SALUTATION"] : "default"; (before php 7)

同样的一切。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43114695

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档