Skip to content

Commit ebe087e

Browse files
Phillip Van NortwickPhillip Van Nortwick
Phillip Van Nortwick
authored and
Phillip Van Nortwick
committed
Initial Commit
0 parents  commit ebe087e

File tree

190 files changed

+21445
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+21445
-0
lines changed

.DS_Store

15 KB
Binary file not shown.

Libraries/.DS_Store

6 KB
Binary file not shown.

Libraries/Library/PayPal.h

+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
//
2+
// PayPal.h
3+
//
4+
// MPL Library - Developer Interface
5+
//
6+
// Created by Paypal 2010
7+
// Modified by:
8+
// DiZoglio, James(jdizoglio) on 5/10/11.
9+
//
10+
// Copyright 2011 Paypal. All rights reserved.
11+
//
12+
//
13+
14+
#import <UIKit/UIKit.h>
15+
16+
@class PPMEPRootViewController;
17+
@class PayPalContext;
18+
@class PayPalAmounts;
19+
@class PayPalAddress;
20+
21+
@class PayPalPayment;
22+
@class PayPalAdvancedPayment;
23+
24+
@class PayPalPreapprovalDetails;
25+
26+
typedef enum PayPalPaymentStatus {
27+
STATUS_COMPLETED,
28+
STATUS_CREATED,
29+
STATUS_OTHER,
30+
} PayPalPaymentStatus;
31+
32+
typedef enum PayPalEnvironment {
33+
ENV_LIVE,
34+
ENV_SANDBOX,
35+
ENV_NONE,
36+
} PayPalEnvironment;
37+
38+
typedef enum PayPalButtonType {
39+
BUTTON_152x33,
40+
BUTTON_194x37,
41+
BUTTON_278x43,
42+
BUTTON_294x43,
43+
BUTTON_TYPE_COUNT,
44+
} PayPalButtonType;
45+
46+
typedef enum PayPalButtonText {
47+
BUTTON_TEXT_PAY, //default
48+
BUTTON_TEXT_DONATE,
49+
} PayPalButtonText;
50+
51+
typedef enum PayPalFeePayer {
52+
FEEPAYER_SENDER,
53+
FEEPAYER_PRIMARYRECEIVER,
54+
FEEPAYER_EACHRECEIVER,
55+
FEEPAYER_SECONDARYONLY,
56+
} PayPalFeePayer;
57+
58+
typedef enum PayPalFailureType {
59+
SYSTEM_ERROR,
60+
RECIPIENT_ERROR,
61+
APPLICATION_ERROR,
62+
CONSUMER_ERROR,
63+
} PayPalFailureType;
64+
65+
typedef enum PayPalPaymentType {
66+
TYPE_NOT_SET = -1,
67+
TYPE_GOODS,
68+
TYPE_SERVICE,
69+
TYPE_PERSONAL,
70+
} PayPalPaymentType;
71+
72+
typedef enum PayPalPaymentSubType {
73+
SUBTYPE_NOT_SET = -1,
74+
SUBTYPE_AFFILIATE_PAYMENTS,
75+
SUBTYPE_B2B,
76+
SUBTYPE_PAYROLL,
77+
SUBTYPE_REBATES,
78+
SUBTYPE_REFUNDS,
79+
SUBTYPE_REIMBURSEMENTS,
80+
SUBTYPE_DONATIONS,
81+
SUBTYPE_UTILITIES,
82+
SUBTYPE_TUITION,
83+
SUBTYPE_GOVERNMENT,
84+
SUBTYPE_INSURANCE,
85+
SUBTYPE_REMITTANCES,
86+
SUBTYPE_RENT,
87+
SUBTYPE_MORTGAGE,
88+
SUBTYPE_MEDICAL,
89+
SUBTYPE_CHILD_CARE,
90+
SUBTYPE_EVENT_PLANNING,
91+
SUBTYPE_GENERAL_CONTRACTORS,
92+
SUBTYPE_ENTERTAINMENT,
93+
SUBTYPE_TOURISM,
94+
SUBTYPE_INVOICE,
95+
SUBTYPE_TRANSFER,
96+
} PayPalPaymentSubType;
97+
98+
typedef enum PayPalAmountErrorCode {
99+
AMOUNT_ERROR_NONE,
100+
AMOUNT_ERROR_SERVER,
101+
AMOUNT_ERROR_OTHER,
102+
AMOUNT_CANCEL_TXN,
103+
} PayPalAmountErrorCode;
104+
105+
typedef enum PayPalInitializationStatus {
106+
STATUS_NOT_STARTED,
107+
STATUS_COMPLETED_SUCCESS,
108+
STATUS_COMPLETED_ERROR,
109+
STATUS_INPROGRESS,
110+
} PayPalInitializationStatus;
111+
112+
@protocol PayPalPaymentDelegate
113+
@required
114+
- (void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus;
115+
- (void)paymentFailedWithCorrelationID:(NSString *)correlationID;
116+
- (void)paymentCanceled;
117+
- (void)paymentLibraryExit;
118+
119+
/*
120+
Example: To parse the responseMessage containing the following key fields. You can check the responseMessage
121+
from couldNotFetchDeviceReferenceToken or receivedDeviceReferenceToken. You can create a local application log
122+
to capture this output. The errors captured are both Network(Request) and Application catagory errors.
123+
124+
NSString *severity = [[PayPal getPayPalInst].responseMessage objectForKey:@"severity"];
125+
NSString *category = [[PayPal getPayPalInst].responseMessage objectForKey:@"category"];
126+
NSString *errorId = [[PayPal getPayPalInst].responseMessage objectForKey:@"errorId"];
127+
NSString *message = [[PayPal getPayPalInst].responseMessage objectForKey:@"message"];
128+
*/
129+
130+
@optional
131+
- (PayPalAmounts *)adjustAmountsForAddress:(PayPalAddress const *)inAddress andCurrency:(NSString const *)inCurrency andAmount:(NSDecimalNumber const *)inAmount andTax:(NSDecimalNumber const *)inTax andShipping:(NSDecimalNumber const *)inShipping andErrorCode:(PayPalAmountErrorCode *)outErrorCode;
132+
- (NSMutableArray *)adjustAmountsAdvancedForAddress:(PayPalAddress const *)inAddress andCurrency:(NSString const *)inCurrency andReceiverAmounts:(NSMutableArray *)receiverAmounts andErrorCode:(PayPalAmountErrorCode *)outErrorCode;
133+
134+
- (PayPalAmounts *)adjustAmountsForAddress:(PayPalAddress const *)inAddress andCurrency:(NSString const *)inCurrency andAmount:(NSDecimalNumber const *)inAmount andTax:(NSDecimalNumber const *)inTax andShipping:(NSDecimalNumber const *)inShipping __attribute__((deprecated));
135+
- (NSMutableArray *)adjustAmountsAdvancedForAddress:(PayPalAddress const *)inAddress andCurrency:(NSString const *)inCurrency andReceiverAmounts:(NSMutableArray *)receiverAmounts __attribute__((deprecated));
136+
@end
137+
138+
@interface PayPal : NSObject <UIWebViewDelegate> {
139+
@private
140+
id<PayPalPaymentDelegate> delegate;
141+
BOOL paymentsEnabled; //readonly, TRUE if the device is allowed to make payments
142+
BOOL shippingEnabled;
143+
BOOL dynamicAmountUpdateEnabled;
144+
145+
NSString *appID;
146+
NSString *lang;
147+
148+
PayPalEnvironment environment;
149+
PayPalButtonText buttonText;
150+
PayPalFeePayer feePayer;
151+
152+
PayPalAdvancedPayment *payment;
153+
PayPalPreapprovalDetails *preapprovalDetails;
154+
155+
NSMutableArray *payButtons;
156+
NSMutableDictionary *responseMessage;
157+
158+
PPMEPRootViewController *rootvc;
159+
}
160+
161+
@property (nonatomic, retain) id delegate;
162+
@property (nonatomic, readonly) BOOL paymentsEnabled;
163+
@property (nonatomic, assign) BOOL shippingEnabled;
164+
@property (nonatomic, assign) BOOL dynamicAmountUpdateEnabled;
165+
166+
@property (nonatomic, retain, readonly) NSString *appID;
167+
@property (nonatomic, retain) NSString *lang;
168+
169+
@property (nonatomic, readonly) PayPalEnvironment environment;
170+
@property (nonatomic, readonly) PayPalButtonText buttonText;
171+
@property (nonatomic, assign) PayPalFeePayer feePayer;
172+
173+
@property (nonatomic, retain, readonly) PayPalAdvancedPayment *payment;
174+
@property (nonatomic, retain, readonly) PayPalPreapprovalDetails *preapprovalDetails;
175+
176+
@property (nonatomic, retain) NSMutableArray *payButtons;
177+
@property (nonatomic, retain) NSMutableDictionary *responseMessage;
178+
179+
+(PayPal*)getPayPalInst;
180+
+(PayPal*)initializeWithAppID:(NSString const *)inAppID;
181+
+(PayPal*)initializeWithAppID:(NSString const *)inAppID forEnvironment:(PayPalEnvironment)env;
182+
+(PayPalInitializationStatus)initializationStatus;
183+
+(NSString *)buildVersion;
184+
185+
-(UIButton *)getPayButtonWithTarget:(const id<PayPalPaymentDelegate>)target andAction:(SEL)action andButtonType:(PayPalButtonType)theButtonType andButtonText:(PayPalButtonText)theButtonText;
186+
//calls getPayButton with text PAY
187+
-(UIButton *)getPayButtonWithTarget:(const id<PayPalPaymentDelegate>)target andAction:(SEL)action andButtonType:(PayPalButtonType)theButtonType;
188+
189+
-(void)checkoutWithPayment:(PayPalPayment *)inPayment;
190+
-(void)advancedCheckoutWithPayment:(PayPalAdvancedPayment *)inPayment;
191+
-(void)preapprovalWithKey:(NSString *)preapprovalKey andMerchantName:(NSString *)merchantName;
192+
193+
@end

Libraries/Library/PayPalAddress.h

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// PayPalAddress.m
3+
//
4+
// MPL Library - Developer Interface
5+
//
6+
// Created by Paypal 2010
7+
// Modified by:
8+
// DiZoglio, James(jdizoglio) on 5/10/11.
9+
//
10+
// Copyright 2011 Paypal. All rights reserved.
11+
//
12+
//
13+
14+
#import <Foundation/Foundation.h>
15+
16+
17+
@interface PayPalAddress : NSObject {
18+
NSString *name;
19+
NSString *street1;
20+
NSString *street2;
21+
NSString *city;
22+
NSString *state;
23+
NSString *postalcode;
24+
NSString *countrycode;
25+
}
26+
@property (readonly) NSString *name;
27+
@property (readonly) NSString *street1;
28+
@property (readonly) NSString *street2;
29+
@property (readonly) NSString *city;
30+
@property (readonly) NSString *state;
31+
@property (readonly) NSString *postalcode;
32+
@property (readonly) NSString *countrycode;
33+
@end
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// PayPalAdvancedPayment.h
3+
//
4+
// MPL Library - Developer Interface
5+
//
6+
// Created by Paypal 2010
7+
// Modified by:
8+
// DiZoglio, James(jdizoglio) on 5/10/11.
9+
//
10+
// Copyright 2011 Paypal. All rights reserved.
11+
//
12+
//
13+
14+
#import <Foundation/Foundation.h>
15+
#import "PayPalReceiverPaymentDetails.h"
16+
17+
@interface PayPalAdvancedPayment : NSObject <NSCopying> {
18+
@private
19+
20+
//required
21+
NSString *paymentCurrency; //you can specify only one currency, regardless of the number of receivers
22+
NSMutableArray *receiverPaymentDetails; //array of PPReceiverPaymentDetails
23+
24+
//optional
25+
NSString *merchantName; //this will be displayed at the top of all library screens
26+
NSString *ipnUrl;
27+
NSString *memo;
28+
}
29+
30+
@property (nonatomic, retain) NSString *paymentCurrency;
31+
@property (nonatomic, retain) NSMutableArray *receiverPaymentDetails;
32+
33+
//if set, the value of this property will be displayed at the top of all library screens
34+
@property (nonatomic, retain) NSString *merchantName;
35+
36+
@property (nonatomic, retain) NSString *ipnUrl;
37+
@property (nonatomic, retain) NSString *memo;
38+
39+
@property (nonatomic, readonly) NSDecimalNumber *subtotal; //summed over all receivers
40+
@property (nonatomic, readonly) NSDecimalNumber *tax; //summed over all receivers
41+
@property (nonatomic, readonly) NSDecimalNumber *shipping; //summed over all receivers
42+
@property (nonatomic, readonly) NSDecimalNumber *total; //subtotal + tax + shipping, summed over all receivers
43+
44+
//returns primary receiver if we are doing chain payment
45+
//returns single receiver if we only have one receiver
46+
@property (nonatomic, readonly) PayPalReceiverPaymentDetails *singleReceiver;
47+
48+
//convenience property indicating if this is a personal payment
49+
//this will return TRUE if any receiver has a payment type of personal
50+
@property (nonatomic, readonly) BOOL isPersonal;
51+
52+
- (NSString *)getMerchantName;
53+
54+
@end

Libraries/Library/PayPalAmounts.h

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// PayPalAmounts.h
3+
//
4+
// MPL Library - Developer Interface
5+
//
6+
// Created by Paypal 2010
7+
// Modified by:
8+
// DiZoglio, James(jdizoglio) on 5/10/11.
9+
//
10+
// Copyright 2011 Paypal. All rights reserved.
11+
//
12+
//
13+
14+
#import <Foundation/Foundation.h>
15+
16+
17+
@interface PayPalAmounts : NSObject {
18+
NSString *currency;
19+
NSDecimalNumber *payment_amount;
20+
NSDecimalNumber *tax;
21+
NSDecimalNumber *shipping;
22+
}
23+
@property (nonatomic, retain) NSString *currency;
24+
@property (nonatomic, retain) NSDecimalNumber *payment_amount;
25+
@property (nonatomic, retain) NSDecimalNumber *tax;
26+
@property (nonatomic, retain) NSDecimalNumber *shipping;
27+
@end

Libraries/Library/PayPalInvoiceData.h

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// PayPalInvoiceData.h
3+
//
4+
// MPL Library - Developer Interface
5+
//
6+
// Created by Paypal 2010
7+
// Modified by:
8+
// DiZoglio, James(jdizoglio) on 5/10/11.
9+
//
10+
// Copyright 2011 Paypal. All rights reserved.
11+
//
12+
//
13+
14+
#import <Foundation/Foundation.h>
15+
16+
17+
@interface PayPalInvoiceData : NSObject <NSCopying> {
18+
@private
19+
20+
//optional
21+
NSDecimalNumber *totalTax;
22+
NSDecimalNumber *totalShipping;
23+
NSMutableArray *invoiceItems; // Array of PayPalInvoiceItems
24+
}
25+
26+
@property (nonatomic, retain) NSDecimalNumber *totalTax;
27+
@property (nonatomic, retain) NSDecimalNumber *totalShipping;
28+
@property (nonatomic, retain) NSMutableArray *invoiceItems;
29+
30+
@end

Libraries/Library/PayPalInvoiceItem.h

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// PayPalInvoiceItem.h
3+
//
4+
// MPL Library - Developer Interface
5+
//
6+
// Created by Paypal 2010
7+
// Modified by:
8+
// DiZoglio, James(jdizoglio) on 5/10/11.
9+
//
10+
// Copyright 2011 Paypal. All rights reserved.
11+
//
12+
//
13+
14+
#import <Foundation/Foundation.h>
15+
16+
17+
@interface PayPalInvoiceItem : NSObject <NSCopying> {
18+
@private
19+
20+
//optional
21+
NSString *name;
22+
NSString *itemId;
23+
NSDecimalNumber *totalPrice;
24+
NSDecimalNumber *itemPrice;
25+
NSNumber *itemCount;
26+
}
27+
28+
@property (nonatomic, retain) NSString *name;
29+
@property (nonatomic, retain) NSString *itemId;
30+
@property (nonatomic, retain) NSDecimalNumber *totalPrice;
31+
@property (nonatomic, retain) NSDecimalNumber *itemPrice;
32+
@property (nonatomic, retain) NSNumber *itemCount;
33+
34+
@end

0 commit comments

Comments
 (0)