简体   繁体   English

贝宝(Paypal)API和贝宝(Paypal)的示例代码?

[英]Paypal API and Paypal's Sample Code?

https://www.x.com/community/ppx/code_samples https://www.x.com/community/ppx/code_samples

The sample code returns ACK, but where is the proper response? 示例代码返回ACK,但是正确的响应在哪里?

For example Getbalance, sample code returns ACK https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_GetBalance_cs.txt 例如对于Getbalance,示例代码返回ACK https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_GetBalance_cs.txt

but the document shows it returns other values? 但是文档显示它返回其他值? https://www.x.com/docs/DOC-1186 https://www.x.com/docs/DOC-1186

All of the other data is included in the response from PayPal, but your sample code is only outputting the ACK value... PayPal的响应中包含所有其他数据,但是您的示例代码仅输出ACK值...

return decoder["ACK"];

You would need to use decoder['VARNAME'] to get the values of any other data you want. 您将需要使用解码器['VARNAME']来获取所需的任何其他数据的值。 In the case of GetBalance you could be getting back an array of values, so you'll have to lookout for that as well. 对于GetBalance,您可能会返回一个值数组,因此您也必须注意这一点。

It's just that - sample code. 就是这样-示例代码。 If you want to return the other values you have to fill in that functionality yourself. 如果要返回其他值,则必须自己填写该功能。 The sample code they provide is not so good though and I've found that I had to write my own library for calling their NVP services. 他们提供的示例代码并不是很好,我发现我不得不编写自己的库来调用他们的NVP服务。 That can be tough though seeing as how their documentation isn't great either. 尽管鉴于他们的文档也不是很出色,但这可能很难。 However, if you don't want to write any code you could generate a proxy class for their SOAP service. 但是,如果您不想编写任何代码,则可以为其SOAP服务生成一个代理类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM