Paypal API and Paypal's Sample Code?

时光怂恿深爱的人放手 提交于 2019-12-22 18:05:08

问题


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

The sample code returns ACK, but where is the proper response?

For example Getbalance, sample code returns 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


回答1:


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. 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.




回答2:


All of the other data is included in the response from PayPal, but your sample code is only outputting the ACK value...

return decoder["ACK"];

You would need to use decoder['VARNAME'] to get the values of any other data you want. In the case of GetBalance you could be getting back an array of values, so you'll have to lookout for that as well.



来源:https://stackoverflow.com/questions/4057762/paypal-api-and-paypals-sample-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!