Developer's Guide
Mobile Payments Library Developer Guide & Reference – Blackberry OS Edition 19
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
PreapprovalPayment
object that includes
the key and the merchant’s name. Then, use the
checkoutPreapproval()
method to execute
the call.
PreapprovalPayment preapproval = new PayPalPreapproval();
preapproval.setCurrency("USD"); preapproval.setMerchantName("Preapproval
Merchant");
try {
PayPal.getInstance().checkoutPreapproval(preapproval, new
PreapprovalDelegate(), new PaymentAdjuster(),
PaymentType.SERVICES, PaymentSubType.B2B);
} catch (PayPalBlackberryLibraryException e) {
Dialog.alert(“Error: “ + e.getMessage());
}