Permalink
Browse files

PhoneGap and PayPal - July 2011

  • Loading branch information...
1 parent d95b796 commit 73aa042ac342050dd405e2e2cb6d1dca3d93dc79 Sidney Maestre committed Apr 26, 2012
Showing with 19,636 additions and 0 deletions.
  1. +6 −0 PhoneGapAndPayPal-July2011/TALDonate/.gitignore
  2. +16 −0 PhoneGapAndPayPal-July2011/TALDonate/Classes/TALDonateAppDelegate.h
  3. +81 −0 PhoneGapAndPayPal-July2011/TALDonate/Classes/TALDonateAppDelegate.m
  4. BIN PhoneGapAndPayPal-July2011/TALDonate/Default-Landscape.png
  5. BIN PhoneGapAndPayPal-July2011/TALDonate/Default-Portrait.png
  6. BIN PhoneGapAndPayPal-July2011/TALDonate/Default.png
  7. +30 −0 PhoneGapAndPayPal-July2011/TALDonate/PayPal_MobilePayments_Library/MEPAddress.h
  8. +22 −0 PhoneGapAndPayPal-July2011/TALDonate/PayPal_MobilePayments_Library/MEPAmounts.h
  9. +140 −0 PhoneGapAndPayPal-July2011/TALDonate/PayPal_MobilePayments_Library/PayPal.h
  10. +46 −0 PhoneGapAndPayPal-July2011/TALDonate/PayPal_MobilePayments_Library/PayPalContext.h
  11. +28 −0 PhoneGapAndPayPal-July2011/TALDonate/PayPal_MobilePayments_Library/PayPalMEPPayment.h
  12. BIN PhoneGapAndPayPal-July2011/TALDonate/PayPal_MobilePayments_Library/libPayPalMEP.a
  13. +14 −0 PhoneGapAndPayPal-July2011/TALDonate/PhoneGap.plist
  14. +8 −0 PhoneGapAndPayPal-July2011/TALDonate/PhoneGapBuildSettings.xcconfig
  15. +1 −0 PhoneGapAndPayPal-July2011/TALDonate/Plugins/README
  16. +43 −0 PhoneGapAndPayPal-July2011/TALDonate/Plugins/SAiOSPaypalPlugin.h
  17. +178 −0 PhoneGapAndPayPal-July2011/TALDonate/Plugins/SAiOSPaypalPlugin.m
  18. +49 −0 PhoneGapAndPayPal-July2011/TALDonate/TALDonate-Info.plist
  19. +481 −0 PhoneGapAndPayPal-July2011/TALDonate/TALDonate.xcodeproj/project.pbxproj
  20. +8 −0 PhoneGapAndPayPal-July2011/TALDonate/TALDonate_Prefix.pch
  21. BIN PhoneGapAndPayPal-July2011/TALDonate/icon-72.png
  22. BIN PhoneGapAndPayPal-July2011/TALDonate/icon.png
  23. BIN PhoneGapAndPayPal-July2011/TALDonate/icon@2x.png
  24. +17 −0 PhoneGapAndPayPal-July2011/TALDonate/main.m
  25. +121 −0 PhoneGapAndPayPal-July2011/TALDonate/www/SAiOSPaypalPlugin.js
  26. BIN PhoneGapAndPayPal-July2011/TALDonate/www/This-American-Life.jpg
  27. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/ajax-loader.png
  28. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/conf2.jpg
  29. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/form-check-off.png
  30. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/form-check-on.png
  31. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/form-radio-off.png
  32. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/form-radio-on.png
  33. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/goldentix.gif
  34. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/goldentix.jpg
  35. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/icon-search-black.png
  36. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/icons-18-black.png
  37. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/icons-18-white.png
  38. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/icons-36-black.png
  39. BIN PhoneGapAndPayPal-July2011/TALDonate/www/images/icons-36-white.png
  40. +130 −0 PhoneGapAndPayPal-July2011/TALDonate/www/index.html
  41. +18 −0 PhoneGapAndPayPal-July2011/TALDonate/www/jquery-1.6.1.min.js
  42. +1,659 −0 PhoneGapAndPayPal-July2011/TALDonate/www/jquery.mobile-1.0a4.1.css
  43. +5,116 −0 PhoneGapAndPayPal-July2011/TALDonate/www/jquery.mobile-1.0a4.1.js
  44. +3,169 −0 PhoneGapAndPayPal-July2011/TALDonate/www/phonegap.0.9.5.js
  45. +1 −0 PhoneGapAndPayPal-July2011/TALDonate/www/phonegap.0.9.5.min.js
  46. +4,127 −0 PhoneGapAndPayPal-July2011/TALDonate/www/phonegap.1.3.0.js
  47. +4,127 −0 PhoneGapAndPayPal-July2011/TALDonate/www/phonegap.1.3.0.min.js
  48. BIN PhoneGapAndPayPal-July2011/phoneGapEcosystem.key
@@ -0,0 +1,6 @@
+*.mode1v3
+*.perspectivev3
+*.pbxuser
+.DS_Store
+build
+www/phonegap.js
@@ -0,0 +1,16 @@
+//
+// TALDonateAppDelegate.h
+// TALDonate
+//
+// Created by Maestre, Sidney(smaestre) on 6/8/11.
+// Copyright __MyCompanyName__ 2011. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "PhoneGapDelegate.h"
+
+@interface TALDonateAppDelegate : PhoneGapDelegate {
+}
+
+@end
+
@@ -0,0 +1,81 @@
+//
+// TALDonateAppDelegate.m
+// TALDonate
+//
+// Created by Maestre, Sidney(smaestre) on 6/8/11.
+// Copyright __MyCompanyName__ 2011. All rights reserved.
+//
+
+#import "TALDonateAppDelegate.h"
+#import "PhoneGapViewController.h"
+
+@implementation TALDonateAppDelegate
+
+- (id) init
+{
+ /** If you need to do any extra app-specific initialization, you can do it here
+ * -jm
+ **/
+ return [super init];
+}
+
+/**
+ * This is main kick off after the app inits, the views and Settings are setup here.
+ */
+- (void)applicationDidFinishLaunching:(UIApplication *)application
+{
+ [ super applicationDidFinishLaunching:application ];
+}
+
+-(id) getCommandInstance:(NSString*)className
+{
+ /** You can catch your own commands here, if you wanted to extend the gap: protocol, or add your
+ * own app specific protocol to it. -jm
+ **/
+ return [super getCommandInstance:className];
+}
+
+/**
+ Called when the webview finishes loading. This stops the activity view and closes the imageview
+ */
+- (void)webViewDidFinishLoad:(UIWebView *)theWebView
+{
+ return [ super webViewDidFinishLoad:theWebView ];
+}
+
+- (void)webViewDidStartLoad:(UIWebView *)theWebView
+{
+ return [ super webViewDidStartLoad:theWebView ];
+}
+
+/**
+ * Fail Loading With Error
+ * Error - If the webpage failed to load display an error with the reson.
+ */
+- (void)webView:(UIWebView *)theWebView didFailLoadWithError:(NSError *)error
+{
+ return [ super webView:theWebView didFailLoadWithError:error ];
+}
+
+/**
+ * Start Loading Request
+ * This is where most of the magic happens... We take the request(s) and process the response.
+ * From here we can re direct links and other protocalls to different internal methods.
+ */
+- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
+{
+ return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
+}
+
+
+- (BOOL) execute:(InvokedUrlCommand*)command
+{
+ return [ super execute:command];
+}
+
+- (void)dealloc
+{
+ [ super dealloc ];
+}
+
+@end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,30 @@
+//
+// MEPAddress.h
+// PPMEP
+//
+// Created by richard smith on 2/25/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface MEPAddress : NSObject {
+ NSString *name;
+ NSString *street1;
+ NSString *street2;
+ NSString *city;
+ NSString *state;
+ NSString *postalcode;
+ NSString *countrycode;
+ NSString *country;
+}
+@property (readonly) NSString *name;
+@property (readonly) NSString *street1;
+@property (readonly) NSString *street2;
+@property (readonly) NSString *city;
+@property (readonly) NSString *state;
+@property (readonly) NSString *postalcode;
+@property (readonly) NSString *countrycode;
+@property (readonly) NSString *country;
+@end
@@ -0,0 +1,22 @@
+//
+// MEPAmounts.h
+// PPMEP
+//
+// Created by richard smith on 2/25/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface MEPAmounts : NSObject {
+ NSString *currency;
+ NSString *payment_amount;
+ NSString *tax;
+ NSString *shipping;
+}
+@property (nonatomic, retain) NSString *currency;
+@property (nonatomic, retain) NSString *payment_amount;
+@property (nonatomic, retain) NSString *tax;
+@property (nonatomic, retain) NSString *shipping;
+@end
@@ -0,0 +1,140 @@
+//
+// PayPalMEP.h
+// PPMEP
+//
+// Created by johanna wilson on 10/1/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class PPMEPRootViewController;
+@class PayPalContext;
+@class MEPAmounts;
+@class MEPAddress;
+@class PayPalMEPPayment;
+@class PayPalMEPButton;
+
+typedef enum PayPalResponse{
+ PAYMENT_SUCCESS = 0,
+ PAYMENT_FAILED = 1,
+ PAYMENT_CANCELED = 2,
+}PAYPAL_RESPONSE;
+
+typedef enum PayPalEnvironment {
+ ENV_LIVE,
+ ENV_SANDBOX,
+ ENV_NONE,
+} PAYPAL_ENVIRONMENT;
+
+typedef enum PayPalButtonType {
+ BUTTON_68x24,
+ BUTTON_68x33,
+ BUTTON_118x24,
+ BUTTON_152x33,
+ BUTTON_194x37,
+ BUTTON_278x43,
+ BUTTON_294x43,
+ BUTTON_TYPE_COUNT,
+}PayPalButtonType;
+
+typedef enum PayPalPaymentType {
+ HARD_GOODS,
+ SERVICE,
+ PERSONAL,
+ DONATION,
+}PayPalPaymentType;
+
+typedef enum PayPalFailureType {
+ SYSTEM_ERROR,
+ RECIPIENT_ERROR,
+ APPLICATION_ERROR,
+ CONSUMER_ERROR,
+}PAYPAL_FAILURE;
+
+@protocol PayPalMEPDelegate
+@required
+-(void)paymentSuccess:(NSString const *)transactionID;
+-(void)paymentCanceled;
+-(void)paymentFailed:(PAYPAL_FAILURE)errorType;
+
+@optional
+-(MEPAmounts*)AdjustAmounts:(MEPAddress const *)defaultAddress Currency:(NSString const *)inCurrency Amount:(NSString const *)inAmount Tax:(NSString const *)inTax Shipping:(NSString const *)inShipping;
+@end
+
+@interface PayPal : NSObject {
+ @private
+ id<PayPalMEPDelegate> delegate;
+ BOOL paymentsEnabled;
+ PPMEPRootViewController *rootvc;
+ NSString *appID;
+ NSString *lang;
+ PAYPAL_ENVIRONMENT environment;
+ PayPalPaymentType paymentType;
+
+ //items that can change with each purchased item
+ NSString *amount;
+ NSString *tax;
+ NSString *shipping;
+ NSString *currencyCode;
+ NSString *itemDesc;
+ BOOL shippable; //determines if quickpay is available or not
+ NSString *recipientEmail; //the email address the payment should go to
+ NSString *senderEmail; //the email address or phone number of the user making the payment
+ NSString *merchantName;//the merchant name
+
+ PAYPAL_RESPONSE paymentStatus;
+ PayPalContext *payPalContext;
+
+ BOOL initialized;//determines if the initialization call has finished and the PayPal object is initialized.
+ BOOL recipientPaysFee;
+ BOOL dynamicAmountUpdate;
+
+ NSMutableArray *paypalButtons;
+
+ @public
+ NSString *errorMessage;
+}
+
+@property (nonatomic, retain) id delegate;
+@property (nonatomic, retain, readonly) NSString *appID;
+@property (nonatomic, retain) NSString *lang;
+@property (nonatomic, retain) NSMutableArray *paypalButtons;
+
+//items that can change with each purchased item
+@property (nonatomic, retain) NSString *amount;
+@property (nonatomic, retain) NSString *tax;
+@property (nonatomic, retain) NSString *shipping;
+@property (nonatomic, retain) NSString *currencyCode;
+@property (nonatomic, retain) NSString *itemDesc;
+@property BOOL shippable;
+@property (nonatomic, retain) NSString *recipientEmail;
+@property (nonatomic, retain) NSString *senderEmail;
+@property (nonatomic, retain) NSString *merchantName;
+@property (readonly) NSString *totalAmount;
+@property (nonatomic, retain) PayPalContext *payPalContext;
+@property (nonatomic, readonly) PayPalPaymentType paymentType;
+@property (readonly) BOOL initialized;
+@property (nonatomic, retain) NSString *errorMessage;
+@property BOOL recipientPaysFee;
+@property BOOL dynamicAmountUpdate;
+
++(PayPal*)getInstance;
++(PayPal*)initializeWithAppID:(NSString const *)inAppID;
++(PayPal*)initializeWithAppID:(NSString const *)inAppID forEnvironment:(PAYPAL_ENVIRONMENT)env;
+-(UIButton *)getPayButton:(UIViewController const *)target buttonType:(PayPalButtonType)buttonType startCheckOut:(SEL)payWithPayPal PaymentType:(PayPalPaymentType)inPaymentType withLeft:(int)left withTop:(int)top;
+-(void)Checkout:(PayPalMEPPayment *)currentPayment;
+-(void)paymentFinished:(PAYPAL_RESPONSE)reponse;
+-(void)setLang:(NSString *)language;
+-(void)finishPayment;
+-(void)setDefaults;
+-(void)EnableShipping;
+-(void)DisableShipping;
+-(void)SetSenderEmailorPhone:(NSString const *)sender;
+-(void)feePaidByReceiver;
+-(void)enableDynamicAmountUpdate;
+-(PAYPAL_ENVIRONMENT)GetEnvironment;
+-(NSString const *)getErrorMessage;
+
+@end
+
@@ -0,0 +1,46 @@
+//
+// PayPalContext.h
+// PPMEP
+//
+// Created by johanna wilson on 12/10/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "PayPal.h"
+
+@interface PayPalContext : NSObject {
+ @private
+ NSString *sessionToken;
+ NSString *amount;
+ NSString *tax;
+ NSString *shipping;
+ NSString *currencyCode;
+ NSString *itemDesc;
+ BOOL shippable;
+ NSString *recipientEmail;
+ NSString *merchantName;
+ BOOL recipientPaysFee;
+ BOOL enableDynamicAmountUpdate;
+ PAYPAL_ENVIRONMENT environment;
+ PayPalPaymentType paymentType;
+}
+
+@property (nonatomic, retain) NSString *sessionToken;
+@property (nonatomic, retain) NSString *amount;
+@property (nonatomic, retain) NSString *tax;
+@property (nonatomic, retain) NSString *shipping;
+@property (nonatomic, retain) NSString *currencyCode;
+@property (nonatomic, retain) NSString *itemDesc;
+@property BOOL shippable;
+@property (nonatomic, retain) NSString *recipientEmail;
+@property (nonatomic, retain) NSString *merchantName;
+@property PAYPAL_ENVIRONMENT environment;
+@property PayPalPaymentType paymentType;
+@property BOOL recipientPaysFee;
+@property BOOL enableDynamicAmountUpdate;
+
+-(NSDictionary*)serialize;
+-(BOOL)deserialize:(NSDictionary*)contextData;
+
+@end
@@ -0,0 +1,28 @@
+//
+// PayPalMEPPayment.h
+// PPMEP
+//
+// Created by richard smith on 4/8/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface PayPalMEPPayment : NSObject {
+ NSString *paymentCurrency;
+ NSString *paymentAmount;
+ NSString *itemDesc;
+ NSString *recipient;
+ NSString *taxAmount;
+ NSString *shippingAmount;
+ NSString *merchantName;
+}
+@property (nonatomic, retain) NSString *paymentCurrency;
+@property (nonatomic, retain) NSString *paymentAmount;
+@property (nonatomic, retain) NSString *itemDesc;
+@property (nonatomic, retain) NSString *recipient;
+@property (nonatomic, retain) NSString *taxAmount;
+@property (nonatomic, retain) NSString *shippingAmount;
+@property (nonatomic, retain) NSString *merchantName;
+
+@end
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>DetectPhoneNumber</key>
+ <true/>
+ <key>TopActivityIndicator</key>
+ <string>gray</string>
+ <key>EnableLocation</key>
+ <true/>
+ <key>EnableAcceleration</key>
+ <true/>
+</dict>
+</plist>
Oops, something went wrong.

0 comments on commit 73aa042

Please sign in to comment.