Prerequisites

When your application is ready for production use (after testing in the PayPal Sandbox), take advantage of micropayment pricing by doing the following steps during merchant account setup:

Select a digital goods category

Select micropayment pricing

Step 1: Set Up the Payment Information

When a customer is ready to check out, use the SetExpressCheckout call. In the request below, set the L_PAYMENTREQUEST_0_ITEMCATEGORY0 input field to Digital in order for micropayment pricing to apply.

For recommended lightbox functionality:

Detailed instructions are at Introducing Digital Goods for Express Checkout. Those instructions show how to use javascript to embed a payment flow, so users don't have to interrupt their use of the digital goods (the games, news, videos, etc.) for a purchase. When you use the provided javascript, set the expType value to instant for the best conversion rate.

The following SetExpressCheckout response contains a token for use in subsequent steps.

If the customer doesn't authorize payment, the customer is redirected to the cancel URL that you specified in the SetExpressCheckout call, so you can provide a way to re-initiate checkout.

As stated above, lightbox functionality is described in a separate document.

Step 3: Obtain Authorized Payment Details

If the customer authorizes the payment, the customer is redirected to the return URL that you specified in the SetExpressCheckout call. The return URL is appended with the same token as the token used above.

Use the GetExpressCheckoutDetails call to get the authorized payment details and the payer ID. The payer ID is a customer identifier for use in the DoExpressCheckoutPayment call.

Below is sample code. Please replace the token placeholder with the token from the SetExpressCheckoutPayment response (from Step 1).