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.8.0. Update http: header; update card.io.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Goldman committed Dec 2, 2014
1 parent 06e06c0 commit e662fbb
Show file tree
Hide file tree
Showing 25 changed files with 222 additions and 85 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.7.2'
spec.version = '2.8.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' }
Expand Down
5 changes: 3 additions & 2 deletions PayPalMobile/CardIO.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// CardIO.h
// Version 3.10.1
// Version 4.0.0
//
// Copyright (c) 2011-2014 PayPal. All rights reserved.
// See the file "LICENSE.md" for the full license governing this code.
//

// All-in-one header file for card.io sdk.
Expand All @@ -11,3 +11,4 @@
#import "CardIOViewDelegate.h"
#import "CardIOPaymentViewController.h"
#import "CardIOPaymentViewControllerDelegate.h"
#import "CardIOUtilities.h"
6 changes: 4 additions & 2 deletions PayPalMobile/CardIOCreditCardInfo.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// CardIOCreditCardInfo.h
// Version 3.10.1
// Version 4.0.0
//
// Copyright (c) 2011-2014 PayPal. All rights reserved.
// See the file "LICENSE.md" for the full license governing this code.
//

#import <Foundation/Foundation.h>
Expand Down Expand Up @@ -62,6 +62,8 @@ typedef NS_ENUM(NSInteger, CardIOCreditCardType) {
/// Was the card number scanned (as opposed to entered manually)?
@property(nonatomic, assign, readwrite) BOOL scanned;

/// The rectified card image; usually 428x270.
@property(nonatomic, strong, readwrite) UIImage *cardImage;

/// Derived from cardNumber.
/// @note CardIOCreditInfo objects returned by either of the delegate methods
Expand Down
18 changes: 18 additions & 0 deletions PayPalMobile/CardIODetectionMode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// CardIODetectionMode.h
// Version 4.0.0
//
// See the file "LICENSE.md" for the full license governing this code.
//
//

#ifndef icc_CardIODetectionMode_h
#define icc_CardIODetectionMode_h

typedef NS_ENUM(NSInteger, CardIODetectionMode) {
CardIODetectionModeCardImageAndNumber = 0,
CardIODetectionModeCardImageOnly,
CardIODetectionModeAutomatic
};

#endif
80 changes: 56 additions & 24 deletions PayPalMobile/CardIOPaymentViewController.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//
// CardIOPaymentViewController.h
// Version 3.10.1
// Version 4.0.0
//
// Copyright (c) 2011-2014 PayPal. All rights reserved.
// See the file "LICENSE.md" for the full license governing this code.
//

#import <UIKit/UIKit.h>
#import "CardIOPaymentViewControllerDelegate.h"
#import "CardIODetectionMode.h"

/// CardIOPaymentViewController is one of two main entry points into the card.io SDK.
/// @see CardIOView
Expand Down Expand Up @@ -38,7 +39,7 @@
/// E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
///
/// These localizations are currently included:
/// ar,da,de,en,en_AU,en_GB,en_SE,es,es_MX,fr,he,is,it,ja,ko,ms,nb,nl,pl,pt,pt_BR,ru,sv,th,tr,zh-Hans,zh-Hant,zh-Hant_TW.
/// ar,da,de,en,en_AU,en_GB,en_SE,es,es_MX,fr,he,it,ja,ko,ms,nb,nl,pl,pt,pt_BR,ru,sv,th,tr,zh-Hans,zh-Hant,zh-Hant_TW.
@property(nonatomic, copy, readwrite) NSString *languageOrLocale;

/// If YES, the status bar's style will be kept as whatever your app has set it to.
Expand Down Expand Up @@ -80,6 +81,40 @@
/// Mask the card number digits as they are manually entered by the user. Defaults to NO.
@property(nonatomic, assign, readwrite) BOOL maskManualEntryDigits;

/// Set the scan instruction text. If nil, use the default text. Defaults to nil.
/// Use newlines as desired to control the wrapping of text onto multiple lines.
@property(nonatomic, copy, readwrite) NSString *scanInstructions;

/// Hide the PayPal or card.io logo in the scan view. Defaults to NO.
@property(nonatomic, assign, readwrite) BOOL hideCardIOLogo;

/// A custom view that will be overlaid atop the entire scan view. Defaults to nil.
/// If you set a scanOverlayView, be sure to:
///
/// * Consider rotation. Be sure to test on the iPad with rotation both enabled and disabled.
/// To make rotation synchronization easier, whenever a scanOverlayView is set, and card.io does an
/// in-place rotation (rotates its UI elements relative to their containers), card.io will generate
/// rotation notifications; see CardIOScanningOrientationDidChangeNotification
/// and associated userInfo key documentation below.
/// As with UIKit, the initial rotation is always UIInterfaceOrientationPortrait.
///
/// * Be sure to pass touches through to the superview as appropriate. Note that the entire camera
/// preview responds to touches (triggers refocusing). Test the light button and the toolbar buttons.
///
/// * Minimize animations, redrawing, or any other CPU/GPU/memory intensive activities
@property(nonatomic, retain, readwrite) UIView *scanOverlayView;

/// CardIODetectionModeCardImageAndNumber: the scanner must successfully identify the card number.
/// CardIODetectionModeCardImageOnly: don't scan the card, just detect a credit-card-shaped card.
/// CardIODetectionModeAutomatic: start as CardIODetectionModeCardImageAndNumber, but fall back to
/// CardIODetectionModeCardImageOnly if scanning has not succeeded within a reasonable time.
/// Defaults to CardIODetectionModeCardImageAndNumber.
///
/// @note Images returned in CardIODetectionModeCardImageOnly mode may be less focused, to accomodate scanning
/// cards that are dominantly white (e.g., the backs of drivers licenses), and thus
/// hard to calculate accurate focus scores for.
@property(nonatomic, assign, readwrite) CardIODetectionMode detectionMode;

/// Set to NO if you don't need to collect the card expiration. Defaults to YES.
@property(nonatomic, assign, readwrite) BOOL collectExpiry;

Expand All @@ -104,36 +139,33 @@

/// Set to YES to prevent card.io from showing its "Enter Manually" button. Defaults to NO.
///
/// @note If +canReadCardWithCamera returns false, then if card.io is presented it will
/// @note If [CardIOUtilities canReadCardWithCamera] returns false, then if card.io is presented it will
/// automatically display its manual entry screen.
/// Therefore, if you want to prevent users from *ever* seeing card.io's manual entry screen,
/// you should first check +canReadCardWithCamera before initing the view controller.
/// you should first check [CardIOUtilities canReadCardWithCamera] before initing the view controller.
@property(nonatomic, assign, readwrite) BOOL disableManualEntryButtons;

/// Access to the delegate.
@property(nonatomic, weak, readwrite) id<CardIOPaymentViewControllerDelegate> paymentDelegate;

/// The preload method prepares card.io to launch faster. Calling preload is optional but suggested.
/// On an iPhone 5S, for example, preloading makes card.io launch ~400ms faster.
/// The best time to call preload is when displaying a view from which card.io might be launched;
/// e.g., inside your view controller's viewWillAppear: method.
/// preload works in the background; the call to preload returns immediately.
/// The preload method of CardIOPaymentViewController and of CardIOView do the same work,
/// so a call to either of them suffices.
+ (void)preload;

/// Determine whether this device supports camera-based card scanning, considering
/// factors such as hardware support and OS version.
/// Name for orientation change notification.
extern NSString * const CardIOScanningOrientationDidChangeNotification;

/// userInfo key for orientation change notification, to get the current scanning orientation.
///
/// card.io automatically provides manual entry of cards as a fallback,
/// so it is not typically necessary for your app to check this.
/// Returned as an NSValue wrapping a UIDeviceOrientation. Sample extraction code:
/// @code
/// NSValue *wrappedOrientation = notification.userInfo[CardIOCurrentScanningOrientation];
/// UIDeviceOrientation scanningOrientation = UIDeviceOrientationPortrait; // set a default value just to be safe
/// [wrappedOrientation getValue:&scanningOrientation];
/// // use scanningOrientation...
/// @endcode
extern NSString * const CardIOCurrentScanningOrientation;

/// userInfo key for orientation change notification, to get the duration of the card.io rotation animations.
///
/// @return YES iff the user's device supports camera-based card scanning.
+ (BOOL)canReadCardWithCamera;

/// Please send the output of this method with any technical support requests.
/// @return Human-readable version of this library.
+ (NSString *)libraryVersion;
/// Returned as an NSNumber wrapping an NSTimeInterval (i.e. a double).
extern NSString * const CardIOScanningOrientationAnimationDuration;


#pragma mark - Deprecated properties
Expand Down
4 changes: 2 additions & 2 deletions PayPalMobile/CardIOPaymentViewControllerDelegate.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// CardIOPaymentViewControllerDelegate.h
// Version 3.10.1
// Version 4.0.0
//
// Copyright (c) 2011-2014 PayPal. All rights reserved.
// See the file "LICENSE.md" for the full license governing this code.
//

#import <Foundation/Foundation.h>
Expand Down
37 changes: 37 additions & 0 deletions PayPalMobile/CardIOUtilities.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// CardIOUtilities.h
// Version 4.0.0
//
// See the file "LICENSE.md" for the full license governing this code.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface CardIOUtilities : NSObject

/// Please send the output of this method with any technical support requests.
/// @return Human-readable version of this library.
+ (NSString *)libraryVersion;

/// Determine whether this device supports camera-based card scanning, considering
/// factors such as hardware support and OS version.
///
/// card.io automatically provides manual entry of cards as a fallback,
/// so it is not typically necessary for your app to check this.
///
/// @return YES iff the user's device supports camera-based card scanning.
+ (BOOL)canReadCardWithCamera;

/// The preload method prepares card.io to launch faster. Calling preload is optional but suggested.
/// On an iPhone 5S, for example, preloading makes card.io launch ~400ms faster.
/// The best time to call preload is when displaying a view from which card.io might be launched;
/// e.g., inside your view controller's viewWillAppear: method.
/// preload works in the background; the call to preload returns immediately.
+ (void)preload;

/// Returns a doubly Gaussian-blurred screenshot, intended for screenshots when backgrounding.
/// @return Blurred screenshot.
+ (UIImageView *)blurredScreenImageView;

@end
76 changes: 58 additions & 18 deletions PayPalMobile/CardIOView.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
//
// CardIOView.h
// Version 3.10.1
// Version 4.0.0
//
// Copyright (c) 2011-2014 PayPal. All rights reserved.
// See the file "LICENSE.md" for the full license governing this code.
//

#import <UIKit/UIKit.h>
#import "CardIOViewDelegate.h"
#import "CardIODetectionMode.h"

/// CardIOView is one of two main entry points into the card.io SDK.
/// @see CardIOPaymentViewController
@interface CardIOView : UIView

/// Determine whether this device supports camera-based card scanning, considering
/// factors such as hardware support and OS version.
/// @return YES iff the user's device supports camera-based card scanning.
+ (BOOL)canReadCardWithCamera;

/// The preload method prepares card.io to launch faster. Calling preload is optional but suggested.
/// On an iPhone 5S, for example, preloading makes card.io launch ~400ms faster.
/// The best time to call preload is when displaying a view from which card.io might be launched;
/// e.g., inside your view controller's viewWillAppear: method.
/// preload works in the background; the call to preload returns immediately.
/// The preload method of CardIOPaymentViewController and of CardIOView do the same work,
/// so a call to either of them suffices.
+ (void)preload;


#pragma mark - Properties you MUST set

/// Typically, your view controller will set itself as this delegate.
@property(nonatomic, strong, readwrite) id<CardIOViewDelegate> delegate;
@property(nonatomic, weak, readwrite) id<CardIOViewDelegate> delegate;


#pragma mark - Properties you MAY set
Expand All @@ -47,7 +34,7 @@
/// E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
///
/// These localizations are currently included:
/// ar,da,de,en,en_AU,en_GB,en_SE,es,es_MX,fr,he,is,it,ja,ko,ms,nb,nl,pl,pt,pt_BR,ru,sv,th,tr,zh-Hans,zh-Hant,zh-Hant_TW.
/// ar,da,de,en,en_AU,en_GB,en_SE,es,es_MX,fr,he,it,ja,ko,ms,nb,nl,pl,pt,pt_BR,ru,sv,th,tr,zh-Hans,zh-Hant,zh-Hant_TW.
@property(nonatomic, copy, readwrite) NSString *languageOrLocale;

/// Alter the card guide (bracket) color. Opaque colors recommended.
Expand All @@ -64,13 +51,66 @@
/// Set to NO to follow standard iOS constraints. Defaults to YES. (Does not affect the manual entry screen.)
@property(nonatomic, assign, readwrite) BOOL allowFreelyRotatingCardGuide;

/// Set the scan instruction text. If nil, use the default text. Defaults to nil.
/// Use newlines as desired to control the wrapping of text onto multiple lines.
@property(nonatomic, copy, readwrite) NSString *scanInstructions;

/// Hide the PayPal or card.io logo in the scan view. Defaults to NO.
@property(nonatomic, assign, readwrite) BOOL hideCardIOLogo;

/// A custom view that will be overlaid atop the entire scan view. Defaults to nil.
/// If you set a scanOverlayView, be sure to:
///
/// * Consider rotation. Be sure to test on the iPad with rotation both enabled and disabled.
/// To make rotation synchronization easier, whenever a scanOverlayView is set, and card.io does an
/// in-place rotation (rotates its UI elements relative to their containers), card.io will generate
/// rotation notifications; see CardIOScanningOrientationDidChangeNotification
/// and associated userInfo key documentation below.
/// As with UIKit, the initial rotation is always UIInterfaceOrientationPortrait.
///
/// * Be sure to pass touches through to the superview as appropriate. Note that the entire camera
/// preview responds to touches (triggers refocusing). Test the light button and the toolbar buttons.
///
/// * Minimize animations, redrawing, or any other CPU/GPU/memory intensive activities
@property(nonatomic, retain, readwrite) UIView *scanOverlayView;

/// CardIODetectionModeCardImageAndNumber: the scanner must successfully identify the card number.
/// CardIODetectionModeCardImageOnly: don't scan the card, just detect a credit-card-shaped card.
/// CardIODetectionModeAutomatic: start as CardIODetectionModeCardImageAndNumber, but fall back to
/// CardIODetectionModeCardImageOnly if scanning has not succeeded within a reasonable time.
/// Defaults to CardIODetectionModeCardImageAndNumber.
///
/// @note Images returned in CardIODetectionModeCardImageOnly mode may be less focused, to accomodate scanning
/// cards that are dominantly white (e.g., the backs of drivers licenses), and thus
/// hard to calculate accurate focus scores for.
@property(nonatomic, assign, readwrite) CardIODetectionMode detectionMode;

/// After a successful scan, the CardIOView will briefly display an image of the card with
/// the computed card number superimposed. This property controls how long (in seconds)
/// that image will be displayed.
/// Set this to 0.0 to suppress the display entirely.
/// Defaults to 1.0.
@property(nonatomic, assign, readwrite) CGFloat scannedImageDuration;

/// Name for orientation change notification.
extern NSString * const CardIOScanningOrientationDidChangeNotification;

/// userInfo key for orientation change notification, to get the current scanning orientation.
///
/// Returned as an NSValue wrapping a UIDeviceOrientation. Sample extraction code:
/// @code
/// NSValue *wrappedOrientation = notification.userInfo[CardIOCurrentScanningOrientation];
/// UIDeviceOrientation scanningOrientation = UIDeviceOrientationPortrait; // set a default value just to be safe
/// [wrappedOrientation getValue:&scanningOrientation];
/// // use scanningOrientation...
/// @endcode
extern NSString * const CardIOCurrentScanningOrientation;

/// userInfo key for orientation change notification, to get the duration of the card.io rotation animations.
///
/// Returned as an NSNumber wrapping an NSTimeInterval (i.e. a double).
extern NSString * const CardIOScanningOrientationAnimationDuration;


#pragma mark - Property you MAY get

Expand Down
4 changes: 2 additions & 2 deletions PayPalMobile/CardIOViewDelegate.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// CardIOViewDelegate.h
// Version 3.10.1
// Version 4.0.0
//
// Copyright (c) 2011-2014 PayPal. All rights reserved.
// See the file "LICENSE.md" for the full license governing this code.
//

#import <Foundation/Foundation.h>
Expand Down
2 changes: 1 addition & 1 deletion PayPalMobile/PayPalConfiguration.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalConfiguration.h
//
// Version 2.7.2
// Version 2.8.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion PayPalMobile/PayPalFuturePaymentViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// PayPalFuturePaymentViewController.h
//
// Version 2.7.2
// Version 2.8.0
//
// Copyright (c) 2014, PayPal
// All rights reserved.
Expand Down
Loading

0 comments on commit e662fbb

Please sign in to comment.