简体   繁体   中英

Paypal API and Paypal's Sample Code?

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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