duancenxie2233 2017-03-30 10:07
浏览 48
已采纳

来自paypal运输详细信息的未定义索引

I got this Error message from paypal shipping details

Notice: Undefined index: SALUTATION in /var/www/html/pp/temp/review.php on line 41

Notice: Undefined index: MIDDLENAME in /var/www/html/pp/temp/review.php on line 43

Notice: Undefined index: SUFFIX in /var/www/html/pp/temp/review.php on line 45

Notice: Undefined index: SHIPTOSTREET2 in /var/www/html/pp/temp/review.php on line 50

Notice: Undefined index: INVNUM in /var/www/html/pp/temp/review.php on line 56

Notice: Undefined index: PHONENUM in /var/www/html/pp/temp/review.php on line 57

I tried this

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. 

    } 

But still the same issue.How can i resolve this issue?please help me

  • 写回答

1条回答 默认 最新

  • doubangzhang6992 2017-03-30 12:24
    关注

    use isset () function is used to check whether a variable is set or not. replace

    $salutation         = $resArray["SALUTATION"]?$resArray["SALUTATION"]:''; 
    

    to

     $salutation = $resArray["SALUTATION"] ?? "default"; (for php 7)
    $var = isset($resArray["SALUTATION"]) ? $resArray["SALUTATION"] : "default"; (before php 7)
    

    similarly all.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料