Developer's Guide

22 July 2011 PayPal Mobile Payments Developer Guide and Reference Android OS Edition
About Preapproval Pins
Confirmed preapproval keys let you take payments from buyers without requiring them to log in
to PayPal to authorize payments individually. Depending on your business model, you may want
to obtain consent quickly from buyers before you take individual payments. Preapproval PINs are
special codes that buyers enter to authorize preapproved payments individually without logging in
to PayPal.
For example, you might have a mobile game that requires payment from buyers to enter a higher
level of difficulty. You could take the payment, without notice, when the buyer enters the higher
level. However, the buyer might dispute the payment later, despite the preapproval agreement and
the automatic payment notice from PayPal. Obtain a buyer‟s consent before you take the entrance
fee to help improve the buying experience.
Specify that you want your preapprovals to use preapproval PINs when you send Preapproval
requests from your web server to PayPal. Set the PreapprovalRequest.pinType to
REQUIRED. PayPal returns preapproval keys that require buyers to create preapproval PINs
during preapproval checkout.
Later, when you take payments by using a buyer‟s confirmed preapproval key, prompt the buyer
for the preapproval PIN. Pass the buyer‟s PIN to PayPal when you send the Pay request from
your web server. PayPal recommends that you display the payment reason and payment amount
when you prompt buyers for their preapproval PINs.
Sample Call
After you obtain a pending approval key, construct a PayPalPreapproval object that includes
the key and the merchant‟s name. Then, use the preapprove() method to create an Intent and
pass it in the Android startActivityForResult() method.
PayPalPreapproval preapproval = new PayPalPreapproval();
preapproval.setCurrencyType("USD");
preapproval.setMerchantName("Preapproval Merchant");
Intent preapproveIntent = PayPal.getInstance().preapprove(preapproval,
this);
startActivityForResult(preapproveIntent, request);
NOTE: See Activity Results for the Mobile Library for callback details.