Mobile Payments Library Developer Guide and Reference –iOS Edition August 2012 3
Contents
Preface ............................................................................................................... 5
Purpose ........................................................................................................................ 5
Scope ............................................................................................................................ 5
Revision History ............................................................................................................ 5
Where to Go for More Information ................................................................................ 6
1. PayPal Mobile Payments Library ............................................................... 7
Mobile Payments Library API Reference ..................................................................... 7
Required Methods in the Mobile Payments Library ............................................... 7
Optional Methods in the Mobile Payments Library .............................................. 11
Delegate Methods in the Mobile Payments Library ............................................. 13
After the Payment ................................................................................................ 14
Simple, Parallel, and Chained Payments ................................................................... 14
Simple Payments ................................................................................................. 16
Parallel Payments ................................................................................................ 16
Chained Payments ............................................................................................... 17
Preapprovals............................................................................................................... 18
How Preapprovals Work ...................................................................................... 18
About Preapproval Keys ...................................................................................... 18
About Preapproval Pins ....................................................................................... 18
Method Signature for Preapproval Checkout ....................................................... 19
Method Sequence for Preapproval Checkout ...................................................... 20
Custom Objects in the Mobile Payments Library ....................................................... 21
Enumerated Values in the Mobile Payments Library ................................................. 26
Localization Support in the Mobile Payments Library ................................................ 28
Library Support for the devices and OS versions. ...................................................... 29
Adding the Mobile Payments Library to Your Xcode Project ..................................... 29
Sample Code .............................................................................................................. 30
Header File ........................................................................................................... 30
Implementation File .............................................................................................. 31
Placing the Pay with PayPal Button ..................................................................... 32
Creating the PayPalPayment Object ................................................................... 32
Checking Out ....................................................................................................... 33
Handling the Callback .......................................................................................... 33
Dynamic Amount Calculation ............................................................................... 34
2. The Checkout Experience with the Mobile Payments Library ............... 36
Checkout Experience #1 – Goods or Services with Shipping .................................... 36