Study Guide
Table Of Contents
- PayPal Certified Developer Program Study Guide
- Contents
- List of Tables
- Online Payment Processing
- Internet Security and Fraud Prevention
- Why Every Business Should Be Concerned About Internet Fraud
- Liability for Internet Fraud
- Internet Fraud: What It Is and How It Happens
- Who Is at Risk for Online Fraud
- Reducing Exposure to Fraud
- What Banks and Card Associations Are Doing to Prevent Online Credit Card Fraud
- What PayPal Is Doing to Protect Your Business Against Fraud
- Disclosure and Compliance
- PayPal Fraud Protection Services
- Review Questions
- Getting Started With Account Setup
- API Credentials
- Name-Value Pair (NVP) API
- Express Checkout
- Direct Payment API
- Transactions
- Sandbox Testing
- Answers to Review Questions
- General Reference Information
- Glossary
- Index
PayPal Certified Developer Program Study Guide March 2008 55
Name-Value Pair (NVP) API
Technical Details
5
z The name is separated from the value by an equals sign (=); for example:
FIRSTNAME=Robert
z Name-value pairs are separated by an ampersand (&); for example:
FIRSTNAME=Robert&MIDDLENAME=Herbert&LASTNAME=Moore
z The NVP string is URL-encoded.
URL Encoding
You must URL encode the values included in each API request. The values in all API
responses are also URL encoded. URL encoding ensures the proper transmission of special
characters, characters that are not allowed in a URL, and characters that have special meaning
in a URL, such as the equal sign and ampersand. For example, notice the following NVP
string:
NAME=Robert Moore&COMPANY=R. H. Moore & Associates
The NVP string is URL-encoded as follows:
NAME=Robert+Moore&COMPANY=R%2E+H%2E+Moore+%26+Associates
Use the methods listed in Table 5.1 to URL-encode or URL-decode NVP strings.
TABLE 5.1 URL-Encoding Methods
Language
Encode/
Decode Method
ASP.NET Encode System.Web.HttpUtility.UrlEncode(buffer,
Encoding.Default)
Decode System.Web.HttpUtility.UrlDecode(buffer,
Encoding.Default)
Classic ASP Encode Server.URLEncode
Decode No built-in function
ColdFusion Encode URLEncodedFormatstring [, charset]
Decode URLDecodeurlEncodedString[, charset]
Java Encode java.net.URLEncoder.encode
Decode java.net.URLEncoder.decode
PHP Encode urlencode()
Decode urldecode()