GetShippingDetails检索未定义的索引

时间:2012-05-30 21:34:53

标签: paypal

标题几乎是不言自明的,当我收到包含所有shinanigan的令牌并调用GetShippingDetails时我只得到部分应该通过的变量 - 但没有错误离开了;

我的“测试帐户”(买家)有所有地址,姓名,电话和未配置的内容,但这些变量并非如此。我得到的只是$resArray["email"]$resArray["firstName"]所有其他的都是未定义的索引。我正在使用默认的paypal向导文件。

有人跳过这个围栏吗?


所以,我尝试了print_r($resArray),它返回了这个:

  

数组([TOKEN] => EC-79Y444941M2394358 [CHECKOUTSTATUS] = &>; PaymentActionNotInitiated [TIMESTAMP] => 2012-06-05T11:08:41Z [CORRELATIONID] => 1c27fb16fd35 [ACK] =>成功[版本] => 64 [BUILD] => 2975009 [EMAIL] => moshma_133788766_per@gmail.com [PAYERID] => M5FLRP2QZLGHG [PAYERSTATUS] =>已验证[FIRSTNAME] => Mosh [LASTNAME] = > Mage [COUNTRYCODE] => US [CURRENCYCODE] => EUR [AMT] => 9.00 [ITEMAMT] => 9.00 [SHIPPINGAMT] => 0.00 [HANDLINGAMT] => 0.00 [TAXAMT] =&gt ; 0.00 [INSURANCEAMT] => 0.00 [SHIPDISCAMT] => 0.00 [L_NAME0] => HAMS [L_QTY0] => 1 [L_TAXAMT0] => 0.00 [L_AMT0] => 9.00 [L_DESC0] => descricao [L_ITEMWEIGHTVALUE0] => 0.00000 [L_ITEMLENGTHVALUE0] => 0.00000 [L_ITEMWIDTHVALUE0] => 0.00000 [L_ITEMHEIGHTVALUE0] => 0.00000 [PAYMENTREQUEST_0_CURRENCYCODE] => EUR [PAYMENTREQUEST_0_AMT] => 9.00 [PAYMENTREQUEST_0_ITEMAMT] => 9.00 [PAYMENTREQUEST_0_SHIPPINGAMT] => 0.00 [PAYMENTREQ UEST_0_HANDLINGAMT] => 0.00 [PAYMENTREQUEST_0_TAXAMT] => 0.00 [PAYMENTREQUEST_0_INSURANCEAMT] => 0.00 [PAYMENTREQUEST_0_SHIPDISCAMT] => 0.00 [PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED] => false [L_PAYMENTREQUEST_0_NAME0] => HAMS [L_PAYMENTREQUEST_0_QTY0] => 1 [L_PAYMENTREQUEST_0_TAXAMT0] => 0.00 [L_PAYMENTREQUEST_0_AMT0] => 9.00 [L_PAYMENTREQUEST_0_DESC0] => descricao [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0] => 0.00000 [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0] => 0.00000 [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0] => 0.00000 [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0] => 0.00000 [PAYMENTREQUESTINFO_0_ERRORCODE] => 0)

同样,所有未定义的内容都出现了:

  

注意:未定义的索引:第43行的D:\ Program Files \ EasyPHP-5.3.9 \ www \ YSHLM \ paypal-landing.php中的SALUTATION

     

注意:未定义的索引:第45行的D:\ Program Files \ EasyPHP-5.3.9 \ www \ YSHLM \ paypal-landing.php中的MIDDLENAME

这适用于SUFFIX,BUSINESS,PAYMENTREQUEST_0_SHIPTONAME,PAYMENTREQUEST_0_SHIPTOSTREET,PAYMENTREQUEST_0_SHIPTOSTREET2,PAYMENTREQUEST_0_SHIPTOCITY,PAYMENTREQUEST_0_SHIPTOSTATE,PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE,PAYMENTREQUEST_0_SHIPTOZIP,ADDRESSSTATUS,INVNUM和PHONENUM。

这可能是sandbox.paypal.com上的配置错误吗?我去了双重检查,但我有(至少)送货地址(到merchendise需要去的地方,对吗?)设置和保存。地址不是真的,但我又需要一个真实的地址吗?

2 个答案:

答案 0 :(得分:1)

我真的希望Paypal能够清理他们的文档,这与我上次与他们合作时完全不同。无论如何只是在这里查看我的旧代码是我能用GetShippingDetails获取的变量,你总是可以使用print_r($resArray);来查看所有内容。

EMAIL
PAYERID
PAYERSTATUS
SALUTATION
FIRSTNAME
MIDDLENAME
LASTNAME
SUFFIX
COUNTRYCODE
BUSINESS
SHIPTONAME
SHIPTOSTREET
SHIPTOSTREET2
SHIPTOCITY
SHIPTOSTATE
SHIPTOCOUNTRYCODE
SHIPTOZIP
ADDRESSSTATUS
INVNUM
PHONENUM

其实只是发现了这个:https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetBillingAgreementCustomerDetails我猜paypal改变了他们的方法名称?

答案 1 :(得分:0)

在我的CallShortcutExpressCheckout上,我定义了NOSHIPPING=1标志。那就是问题所在。我仍然需要检查一些变量,但没有一个会对购物车系统造成问题。

感谢您的努力,@ David Nguyen,看来我是我自己的Brutus。