Developer's Guide

30 August 2012 PayPal Mobile Payments Developer Guide and Reference – iOS Edition
PayPalInvoiceItem.h
PayPalPayment.h
PayPalPreapprovalDetails.h
PayPalReceiverAmounts.h
PPReceiverPaymentDetails.h
Also, the package contains a static library file: libPayPalMEP.a.
1. Open your Xcode project.
2. C
ONTROL+CLICK your project, and then select Add > Existing Files….
3. Select the
.h and .a files, and then click Add.
NOTE: You need to add only the PayPalAmounts.h, PayPalReceiverAmounts.h and
PayPalAddress.h files if you are using the Dynamic Amount Calculation feature.
Sample Code
The following section provides an example library implementation. The demo application
initializes the library and places the Pay with PayPal button on the screen where buyers review
the order (
PaymentViewController.m). The callback is handled in the same class.
Header File
#import <UIKit/UIKit.h>
#import "PayPal.h"
@interface PaymentViewController : UIViewController
<PayPalPaymentDelegate> {
}
-(void)payWithPayPal;
@end
Details:
#import “PayPal.h”
The preceding line imports the library header file.
<PayPalPaymentDelegate>
The preceding line states that this class implements the PayPalPaymentDelegate protocol.
-(void)payWithPayPal;
This preceding line is called by the Pay with PayPal button when a buyer taps it.