Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
Update library to 2.5.0. Fix iOS 6 crash; add optional delegate methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Goldman committed Oct 10, 2014
1 parent 0116a5c commit acbebd4
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 25 deletions.
2 changes: 1 addition & 1 deletion PayPal-iOS-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'PayPal-iOS-SDK'
spec.version = '2.4.2'
spec.version = '2.5.0'
spec.license = { type: 'BSD', file: 'LICENSE.md' }
spec.homepage = 'https://developer.paypal.com/webapps/developer/docs/integration/mobile/mobile-sdk-overview/'
spec.authors = { 'PayPal' => 'support@paypal.com' }

This comment has been minimized.

Copy link
@aimeedonahue
Expand Down
6 changes: 5 additions & 1 deletion PayPalMobile/PayPalConfiguration.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalConfiguration.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand Down Expand Up @@ -94,6 +94,10 @@ typedef NS_ENUM(NSInteger, PayPalShippingAddressOption) {
/// Defaults to NO.
@property(nonatomic, assign, readwrite) BOOL disableBlurWhenBackgrounding;

/// If you will present the SDK's view controller within a popover, then set this property to YES.
/// Defaults to NO.
@property(nonatomic, assign, readwrite) BOOL presentingInPopover;

/// Sandbox credentials can be difficult to type on a mobile device. Setting this flag to YES will
/// cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
///
Expand Down
34 changes: 26 additions & 8 deletions PayPalMobile/PayPalFuturePaymentViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalFuturePaymentViewController.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand All @@ -11,39 +11,57 @@
#import "PayPalConfiguration.h"

@class PayPalFuturePaymentViewController;
typedef void (^PayPalFuturePaymentDelegateCompletionBlock)(void);

#pragma mark - PayPalFuturePaymentDelegate

/// Exactly one of these delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these delegate methods.
/// Exactly one of these two required delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these required delegate methods.
@protocol PayPalFuturePaymentDelegate <NSObject>
@required

/// User canceled the future payment process.
/// Your code MUST dismiss the PayPalFuturePaymentViewController.
/// @param futurePaymentViewController The PayPalFuturePaymentViewController that the user canceled without agreement.
- (void)payPalFuturePaymentDidCancel:(PayPalFuturePaymentViewController *)futurePaymentViewController;

/// User successfully completed the future payment authorization.
/// @param futurePaymentViewController The PayPalPaymentViewController where the user successfullly made a payment.
/// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment.
/// The PayPalFuturePaymentViewController's activity indicator has been dismissed.
/// Your code MAY deal with the futurePaymentAuthorization, if it did not already do so within your optional
/// payPalFuturePaymentViewController:willAuthorizeFuturePayment:completionBlock: method.
/// Your code MUST dismiss the PayPalFuturePaymentViewController.
/// @param futurePaymentViewController The PayPalFuturePaymentViewController where the user successfullly authorized.
/// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment.
- (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController
didAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization;

@optional
/// User successfully completed the future payment authorization.
/// The PayPalFuturePaymentViewController's activity indicator is still visible.
/// Your code MAY deal with the futurePaymentAuthorization; e.g., send it to your server and await confirmation.
/// Your code MUST finish by calling the completionBlock.
/// Your code must NOT dismiss the PayPalFuturePaymentViewController.
/// @param futurePaymentViewController The PayPalFuturePaymentViewController where the user successfullly authorized.
/// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment.
/// @param completionBlock Block to execute when your processing is done.
- (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController
willAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization
completionBlock:(PayPalFuturePaymentDelegateCompletionBlock)completionBlock;
@end


#pragma mark - PayPalFuturePaymentViewController

@interface PayPalFuturePaymentViewController : UINavigationController

/// Delegate access
@property (nonatomic, weak, readonly) id<PayPalFuturePaymentDelegate> futurePaymentDelegate;

/// The designated initalizer. A new view controller MUST be initialized for each use.
/// @param configuration The configuration to be used for the lifetime of the controller.
/// The configuration properties merchantName, merchantPrivacyPolicyURL, and merchantUserAgreementURL must be provided.
/// @param delegate The delegate you want to receive updates about the future payment authorization.
- (instancetype)initWithConfiguration:(PayPalConfiguration *)configuration
delegate:(id<PayPalFuturePaymentDelegate>)delegate;

/// Delegate access
@property (nonatomic, weak, readonly) id<PayPalFuturePaymentDelegate> futurePaymentDelegate;

@end
2 changes: 1 addition & 1 deletion PayPalMobile/PayPalMobile.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalMobile.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion PayPalMobile/PayPalOAuthScopes.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalOAuthScopes.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion PayPalMobile/PayPalPayment.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalPayment.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand Down
29 changes: 25 additions & 4 deletions PayPalMobile/PayPalPaymentViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalPaymentViewController.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand All @@ -22,24 +22,45 @@
#pragma mark - Delegates and notifications

@class PayPalPaymentViewController;
typedef void (^PayPalPaymentDelegateCompletionBlock)(void);

/// Exactly one of these delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these delegate methods.
/// Exactly one of these two required delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these required delegate methods.
@protocol PayPalPaymentDelegate <NSObject>
@required

/// User canceled the payment process.
/// Your code MUST dismiss the PayPalPaymentViewController.
/// @param paymentViewController The PayPalPaymentViewController that the user canceled without making a payment.
- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController;

/// User successfully completed the payment.
/// The PayPalPaymentViewController's activity indicator has been dismissed.
/// Your code MAY deal with the completedPayment, if it did not already do so within your optional
/// payPalPaymentViewController:willCompletePayment:completionBlock: method.
/// Your code MUST dismiss the PayPalPaymentViewController.
/// See https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/ for
/// information about payment verification.
/// information about payment verification.
/// @param paymentViewController The PayPalPaymentViewController where the user successfullly made a payment.
/// @param completedPayment completedPayment.confirmation contains information your server will need to verify the payment.
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController
didCompletePayment:(PayPalPayment *)completedPayment;

@optional
/// User successfully completed the payment.
/// The PayPalPaymentViewController's activity indicator is still visible.
/// Your code MAY deal with the completedPayment; e.g., send it to your server and await confirmation.
/// Your code MUST finish by calling the completionBlock.
/// Your code must NOT dismiss the PayPalPaymentViewController.
/// See https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/ for
/// information about payment verification.
/// @param paymentViewController The PayPalPaymentViewController where the user successfullly made a payment.
/// @param completedPayment completedPayment.confirmation contains information your server will need to verify the payment.
/// @param completionBlock Block to execute when your processing is done.
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController
willCompletePayment:(PayPalPayment *)completedPayment
completionBlock:(PayPalPaymentDelegateCompletionBlock)completionBlock;

@end


Expand Down
30 changes: 24 additions & 6 deletions PayPalMobile/PayPalProfileSharingViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalProfileSharingViewController.h
//
// Version 2.4.2
// Version 2.5.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand All @@ -12,34 +12,49 @@
#import "PayPalOAuthScopes.h"

@class PayPalProfileSharingViewController;
typedef void (^PayPalProfileSharingDelegateCompletionBlock)(void);

#pragma mark - PayPalProfileSharingDelegate

/// Exactly one of these delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these delegate methods.
/// Exactly one of these two required delegate methods will get called when the UI completes.
/// You MUST dismiss the modal view controller from these required delegate methods.
@protocol PayPalProfileSharingDelegate <NSObject>
@required

/// User canceled without consenting.
/// Your code MUST dismiss the PayPalProfileSharingViewController.
/// @param profileSharingViewController The PayPalProfileSharingViewController that the user canceled without consenting.
- (void)userDidCancelPayPalProfileSharingViewController:(PayPalProfileSharingViewController *)profileSharingViewController;

/// User successfully logged in and consented.
/// The PayPalProfileSharingViewController's activity indicator has been dismissed.
/// Your code MAY deal with the profileSharingAuthorization, if it did not already do so within your optional
/// PayPalProfileSharingViewController:userWillLogInWithAuthorization:completionBlock: method.
/// Your code MUST dismiss the PayPalProfileSharingViewController.
/// @param profileSharingViewController The PayPalProfileSharingViewController where the user successfully consented.
/// @param authorization The authorization response, which you will return to your server.
- (void)payPalProfileSharingViewController:(PayPalProfileSharingViewController *)profileSharingViewController
userDidLogInWithAuthorization:(NSDictionary *)profileSharingAuthorization;

@optional
/// User successfully logged in and consented.
/// The PayPalProfileSharingViewController's activity indicator is still visible.
/// Your code MAY deal with the profileSharingAuthorization; e.g., send it to your server and await confirmation.
/// Your code MUST finish by calling the completionBlock.
/// Your code must NOT dismiss the PayPalProfileSharingViewController.
/// @param profileSharingViewController The PayPalProfileSharingViewController where the user successfully consented.
/// @param authorization The authorization response, which you will return to your server.
/// @param completionBlock Block to execute when your processing is done.
- (void)payPalProfileSharingViewController:(PayPalProfileSharingViewController *)profileSharingViewController
userWillLogInWithAuthorization:(NSDictionary *)profileSharingAuthorization
completionBlock:(PayPalProfileSharingDelegateCompletionBlock)completionBlock;
@end


#pragma mark - PayPalProfileSharingViewController

@interface PayPalProfileSharingViewController : UINavigationController

/// Delegate access
@property (nonatomic, weak, readonly) id<PayPalProfileSharingDelegate> profileSharingDelegate;

/// The designated initalizer. A new view controller MUST be initialized for each use.
/// @param scopeValues Set of requested scope-values. Each scope-value is defined in PayPalOAuthScopes.h.
/// @param configuration The configuration to be used for the lifetime of the controller
Expand All @@ -49,4 +64,7 @@
configuration:(PayPalConfiguration *)configuration
delegate:(id<PayPalProfileSharingDelegate>)delegate;

/// Delegate access
@property (nonatomic, weak, readonly) id<PayPalProfileSharingDelegate> profileSharingDelegate;

@end
Binary file modified PayPalMobile/libPayPalMobile.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.4.2</string>
<string>2.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.4.2</string>
<string>2.5.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down Expand Up @@ -84,3 +84,5 @@ st>
st>
st>
st>
st>
st>
9 changes: 9 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
PayPal iOS SDK release notes
============================

2.5.0
-----
* NOTE: version 2.5.0 requires Xcode 6 and iOS 8 SDK. If you are still using Xcode 5, please use version 2.3.2 of this SDK.
* Add `presentingInPopover` property to `PayPalConfiguration`.
* Add a new optional delegate method for each of our view controllers, to allow your app
to talk with your server while our activity indicator is still visible.
* Fix an iOS 6 crash. [issue #202](https://github.com/paypal/PayPal-iOS-SDK/issues/202)
* Update card.io library to 3.10.0.

2.4.2
-----
* NOTE: version 2.4.2 requires Xcode 6 and iOS 8 SDK. If you are still using Xcode 5, please use version 2.3.2 of this SDK.
Expand Down

0 comments on commit acbebd4

Please sign in to comment.