diff --git a/PayPal-iOS-SDK.podspec b/PayPal-iOS-SDK.podspec index fbb5a37..84e90ce 100644 --- a/PayPal-iOS-SDK.podspec +++ b/PayPal-iOS-SDK.podspec @@ -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' } diff --git a/PayPalMobile/CardIO.h b/PayPalMobile/CardIO.h index 20c529b..f62ac87 100644 --- a/PayPalMobile/CardIO.h +++ b/PayPalMobile/CardIO.h @@ -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. @@ -11,3 +11,4 @@ #import "CardIOViewDelegate.h" #import "CardIOPaymentViewController.h" #import "CardIOPaymentViewControllerDelegate.h" +#import "CardIOUtilities.h" diff --git a/PayPalMobile/CardIOCreditCardInfo.h b/PayPalMobile/CardIOCreditCardInfo.h index bb7e673..70c0a31 100644 --- a/PayPalMobile/CardIOCreditCardInfo.h +++ b/PayPalMobile/CardIOCreditCardInfo.h @@ -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 @@ -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 diff --git a/PayPalMobile/CardIODetectionMode.h b/PayPalMobile/CardIODetectionMode.h new file mode 100644 index 0000000..cf80939 --- /dev/null +++ b/PayPalMobile/CardIODetectionMode.h @@ -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 diff --git a/PayPalMobile/CardIOPaymentViewController.h b/PayPalMobile/CardIOPaymentViewController.h index 9232a71..7b162a0 100644 --- a/PayPalMobile/CardIOPaymentViewController.h +++ b/PayPalMobile/CardIOPaymentViewController.h @@ -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 #import "CardIOPaymentViewControllerDelegate.h" +#import "CardIODetectionMode.h" /// CardIOPaymentViewController is one of two main entry points into the card.io SDK. /// @see CardIOView @@ -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. @@ -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; @@ -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 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 diff --git a/PayPalMobile/CardIOPaymentViewControllerDelegate.h b/PayPalMobile/CardIOPaymentViewControllerDelegate.h index b2f6682..ec4dbd5 100644 --- a/PayPalMobile/CardIOPaymentViewControllerDelegate.h +++ b/PayPalMobile/CardIOPaymentViewControllerDelegate.h @@ -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 diff --git a/PayPalMobile/CardIOUtilities.h b/PayPalMobile/CardIOUtilities.h new file mode 100644 index 0000000..0212862 --- /dev/null +++ b/PayPalMobile/CardIOUtilities.h @@ -0,0 +1,37 @@ +// +// CardIOUtilities.h +// Version 4.0.0 +// +// See the file "LICENSE.md" for the full license governing this code. +// + +#import +#import + +@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 diff --git a/PayPalMobile/CardIOView.h b/PayPalMobile/CardIOView.h index 96e4f72..598171f 100644 --- a/PayPalMobile/CardIOView.h +++ b/PayPalMobile/CardIOView.h @@ -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 #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 delegate; +@property(nonatomic, weak, readwrite) id delegate; #pragma mark - Properties you MAY set @@ -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. @@ -64,6 +51,40 @@ /// 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. @@ -71,6 +92,25 @@ /// 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 diff --git a/PayPalMobile/CardIOViewDelegate.h b/PayPalMobile/CardIOViewDelegate.h index 3a23158..1b3d333 100644 --- a/PayPalMobile/CardIOViewDelegate.h +++ b/PayPalMobile/CardIOViewDelegate.h @@ -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 diff --git a/PayPalMobile/PayPalConfiguration.h b/PayPalMobile/PayPalConfiguration.h index 1acdf4e..a60f9b2 100644 --- a/PayPalMobile/PayPalConfiguration.h +++ b/PayPalMobile/PayPalConfiguration.h @@ -1,7 +1,7 @@ // // PayPalConfiguration.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. diff --git a/PayPalMobile/PayPalFuturePaymentViewController.h b/PayPalMobile/PayPalFuturePaymentViewController.h index 9c1c781..48f366c 100644 --- a/PayPalMobile/PayPalFuturePaymentViewController.h +++ b/PayPalMobile/PayPalFuturePaymentViewController.h @@ -1,7 +1,7 @@ // // PayPalFuturePaymentViewController.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. diff --git a/PayPalMobile/PayPalMobile.h b/PayPalMobile/PayPalMobile.h index 909f5a0..45a206d 100644 --- a/PayPalMobile/PayPalMobile.h +++ b/PayPalMobile/PayPalMobile.h @@ -1,7 +1,7 @@ // // PayPalMobile.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. @@ -60,11 +60,11 @@ extern NSString *const PayPalEnvironmentNoNetwork; /// This method MUST be called prior to initiating a pre-consented payment (a "future payment") from a mobile device. /// Pass the result to your server, to include in the payment request sent to PayPal. /// Do not otherwise cache or store this value. -/// @param environment -/// The PayPal Mobile SDK can operate in different environments to facilitate development and testing. -/// See PayPalEnvironmentProduction, PayPalEnvironmentSandbox, PayPalEnvironmentNoNetwork for more details. -/// @return applicationCorrelationID Your server will send this to PayPal in a 'Paypal-Application-Correlation-Id' header. -+ (NSString *)applicationCorrelationIDForEnvironment:(NSString *)environment; +/// @return clientMetadataID Your server will send this to PayPal in a 'PayPal-Client-Metadata-Id' header. ++ (NSString *)clientMetadataID; + +/// Method deprecated use clientMetadataID instead ++ (NSString *)applicationCorrelationIDForEnvironment:(NSString *)environment __attribute__((deprecated("Use clientMetadataID instead."))); /// Delete all previously remembered user data (credit card, email, phone, PayPal account), /// for all environments. (See PayPalEnvironmentProduction, PayPalEnvironmentSandbox, PayPalEnvironmentNoNetwork.) diff --git a/PayPalMobile/PayPalOAuthScopes.h b/PayPalMobile/PayPalOAuthScopes.h index 9ec2972..2623719 100644 --- a/PayPalMobile/PayPalOAuthScopes.h +++ b/PayPalMobile/PayPalOAuthScopes.h @@ -1,7 +1,7 @@ // // PayPalOAuthScopes.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. diff --git a/PayPalMobile/PayPalPayment.h b/PayPalMobile/PayPalPayment.h index f39c941..dc8821c 100644 --- a/PayPalMobile/PayPalPayment.h +++ b/PayPalMobile/PayPalPayment.h @@ -1,7 +1,7 @@ // // PayPalPayment.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. diff --git a/PayPalMobile/PayPalPaymentViewController.h b/PayPalMobile/PayPalPaymentViewController.h index 4a1e3ea..9c8a899 100644 --- a/PayPalMobile/PayPalPaymentViewController.h +++ b/PayPalMobile/PayPalPaymentViewController.h @@ -1,7 +1,7 @@ // // PayPalPaymentViewController.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. diff --git a/PayPalMobile/PayPalProfileSharingViewController.h b/PayPalMobile/PayPalProfileSharingViewController.h index 1086393..15a7cd1 100644 --- a/PayPalMobile/PayPalProfileSharingViewController.h +++ b/PayPalMobile/PayPalProfileSharingViewController.h @@ -1,7 +1,7 @@ // // PayPalProfileSharingViewController.h // -// Version 2.7.2 +// Version 2.8.0 // // Copyright (c) 2014, PayPal // All rights reserved. diff --git a/PayPalMobile/libPayPalMobile.a b/PayPalMobile/libPayPalMobile.a index f15c6d8..25a8d44 100644 Binary files a/PayPalMobile/libPayPalMobile.a and b/PayPalMobile/libPayPalMobile.a differ diff --git a/README.md b/README.md index e48e5f8..871004c 100755 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Your customer logs in to PayPal just one time and consents to future payments: Later, when that customer initiates a payment: -1. [Obtain an Application Correlation ID](docs/future_payments_mobile.md#obtain-an-application-correlation-id) that you'll pass to your server. -2. On your server, [Create a Payment](docs/future_payments_server.md#create-a-payment) using your OAuth2 tokens, the Application Correlation ID, and PayPal's API. +1. [Obtain a Client Metadata ID](docs/future_payments_mobile.md#obtain-an-application-correlation-id) that you'll pass to your server. +2. On your server, [Create a Payment](docs/future_payments_server.md#create-a-payment) using your OAuth2 tokens, the Client Metadata ID, and PayPal's API. ### Profile Sharing diff --git a/SampleApp/PayPal-iOS-SDK-Sample-App/PayPal-iOS-SDK-Sample-App-Info.plist b/SampleApp/PayPal-iOS-SDK-Sample-App/PayPal-iOS-SDK-Sample-App-Info.plist index 59eb882..b9a511d 100644 --- a/SampleApp/PayPal-iOS-SDK-Sample-App/PayPal-iOS-SDK-Sample-App-Info.plist +++ b/SampleApp/PayPal-iOS-SDK-Sample-App/PayPal-iOS-SDK-Sample-App-Info.plist @@ -30,11 +30,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.7.2 + 2.8.0 CFBundleSignature ???? CFBundleVersion - 2.7.2 + 2.8.0 LSRequiresIPhoneOS UIMainStoryboardFile diff --git a/acknowledgments.md b/acknowledgments.md index 00ec138..09f3af5 100644 --- a/acknowledgments.md +++ b/acknowledgments.md @@ -21,7 +21,7 @@ Full licenses PayPal's card.io, MIT license: - Copyright (c) 2013-2014 PayPal + Copyright (c) 2013-2014 eBay Software Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/future_payments_mobile.md b/docs/future_payments_mobile.md index eb90e30..4ac6f09 100755 --- a/docs/future_payments_mobile.md +++ b/docs/future_payments_mobile.md @@ -21,13 +21,13 @@ First, you must [obtain customer consent](#obtain-customer-consent) to take paym 1. Receives an OAuth2 authorization code from the SDK. 2. Sends the authorization code to your server, which then [exchanges the code for OAuth2 access and refresh tokens](future_payments_server.md#obtain-oauth2-tokens). -Later, when initiating a pre-consented payment, you must [obtain an Application Correlation ID](#obtain-an-application-correlation-id). How this works: +Later, when initiating a pre-consented payment, you must [obtain a Client Metadata ID](#obtain-an-application-correlation-id). How this works: * The PayPal iOS SDK... - * Provides an Application Correlation ID. + * Provides a Client Metadata ID. * Your app... * Sends the Correlation ID and transaction information to your server. - * Your server then [uses its OAuth2 tokens, Application Correlation ID, and transaction info to create a payment](future_payments_server.md). + * Your server then [uses its OAuth2 tokens, Client Metadata ID, and transaction info to create a payment](future_payments_server.md). Obtain Customer Consent @@ -169,12 +169,12 @@ Obtain Customer Consent ``` -Obtain an Application Correlation ID ------------------------ +Obtain a Client Metadata ID +--------------------------- -When initiating a pre-consented payment (a "future payment") from a mobile device, your mobile application must obtain an Application Correlation ID from the Mobile SDK to pass to your server. Your server must include this Application Correlation ID in its payment request sent to PayPal. +When initiating a pre-consented payment (a "future payment") from a mobile device, your mobile application must obtain a Client Metadata ID from the Mobile SDK to pass to your server. Your server must include this Client Metadata ID in its payment request sent to PayPal. -PayPal uses this Application Correlation ID to verify that the payment is originating from a valid, user-consented device+application. This helps reduce fraud and decrease declines. **PayPal does not provide any loss protection for transactions that do not correctly supply an Application Correlation ID.** +PayPal uses this Client Metadata ID to verify that the payment is originating from a valid, user-consented device+application. This helps reduce fraud and decrease declines. **PayPal does not provide any loss protection for transactions that do not correctly supply a Client Metadata ID.** **Do not cache or store this value.** @@ -185,13 +185,13 @@ Example: // Display activity indicator... - NSString *correlationId = [PayPalMobile applicationCorrelationIDForEnvironment:PayPalEnvironmentProduction]; + NSString *metadataID = [PayPalMobile clientMetadataID]; - // Send correlationId and transaction details to your server for processing with PayPal... + // Send metadataID and transaction details to your server for processing with PayPal... } ``` -When your server makes its payment request to PayPal, it must include a `Paypal-Application-Correlation-Id` HTTP header with this Application Correlation ID value obtained from the SDK. +When your server makes its payment request to PayPal, it must include a `PayPal-Client-Metadata-Id` HTTP header with this Client Metadata ID value obtained from the SDK. diff --git a/docs/future_payments_server.md b/docs/future_payments_server.md index ff6aa2d..eb98330 100755 --- a/docs/future_payments_server.md +++ b/docs/future_payments_server.md @@ -135,7 +135,7 @@ Tips: * For more information, see [creating a payment](https://developer.paypal.com/webapps/developer/docs/api/#create-a-payment). -* When a payment is initiated from a mobile device, all payment API requests should include the `Paypal-Application-Correlation-Id` header value obtained using the [Mobile SDK](future_payments_mobile.md#obtain-an-application-correlation-id). +* When a payment is initiated from a mobile device, all payment API requests should include the `PayPal-Client-Metadata-Id` header value obtained using the [Mobile SDK](future_payments_mobile.md#obtain-an-application-correlation-id). * Unlike the standard REST API docs that demonstrate a one time payment, a future payment doesn't require you to separately [get payment approval](https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/#get-payment-approval) after getting initial user consent. The payment is pre-approved by the user. @@ -149,7 +149,7 @@ For example, to first [authorize the payment](https://developer.paypal.com/webap ```bash curl 'https://api.paypal.com/v1/payments/payment' \ -H "Content-Type: application/json" \ - -H "Paypal-Application-Correlation-Id: c2edbd6e97b14ff2b19ddb8eec9d264c" \ + -H "PayPal-Client-Metadata-Id: c2edbd6e97b14ff2b19ddb8eec9d264c" \ -H "Authorization: Bearer WfXdnxmyJtdF4q59ofxuQuAAk6eEV-Njm6puht3Nk3w" \ -d '{ "intent":"authorize", diff --git a/docs/ja/future_payments_mobile.md b/docs/ja/future_payments_mobile.md index 9299590..e9abc36 100755 --- a/docs/ja/future_payments_mobile.md +++ b/docs/ja/future_payments_mobile.md @@ -183,13 +183,13 @@ PayPalは、このアプリケーション相関IDを使用して、ユーザー // アクティビティインジケーターを表示します。 - NSString *correlationId = [PayPalMobile applicationCorrelationIDForEnvironment:PayPalEnvironmentProduction]; + NSString *metadataID = [PayPalMobile clientMetadataID]; // PayPalでの処理のため、相関IDと取引の詳細をサーバーに送信します。 } ``` -サーバーは、PayPalへの支払いリクエストを作成する際、HTTPヘッダー`Paypal-Application-Correlation-Id`に、SDKから取得したこのアプリケーション相関IDの値を含める必要があります。 +サーバーは、PayPalへの支払いリクエストを作成する際、HTTPヘッダー`PayPal-Client-Metadata-Id`に、SDKから取得したこのアプリケーション相関IDの値を含める必要があります。 diff --git a/docs/ja/future_payments_server.md b/docs/ja/future_payments_server.md index f499734..e3cecc9 100755 --- a/docs/ja/future_payments_server.md +++ b/docs/ja/future_payments_server.md @@ -134,7 +134,7 @@ Authorization: Bearer YOUR_ACCESS_TOKEN * 詳細は[支払いの作成](https://developer.paypal.com/webapps/developer/docs/api/#create-a-payment)を参照してください。 -* モバイル端末から支払いが開始された場合、すべての決済APIリクエストに、[モバイルSDK]を使用して取得された`Paypal-Application-Correlation-Id`ヘッダー値(future_payments_mobile.md#obtain-an-application-correlation-id)が含まれる必要があります。 +* モバイル端末から支払いが開始された場合、すべての決済APIリクエストに、[モバイルSDK]を使用して取得された`PayPal-Client-Metadata-Id`ヘッダー値(future_payments_mobile.md#obtain-an-application-correlation-id)が含まれる必要があります。 * 1回払いの実例を示す標準的なREST APIのドキュメントとは異なり、今後の支払いでは、最初にユーザーの同意を得た後は、そのつど[支払いの承認を得る](https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/#get-payment-approval)必要はありません。支払いは、ユーザーによって事前承認されています。 @@ -148,7 +148,7 @@ Authorization: Bearer YOUR_ACCESS_TOKEN ```bash curl 'https://api.paypal.com/v1/payments/payment' \ -H "Content-Type: application/json" \ - -H "Paypal-Application-Correlation-Id: c2edbd6e97b14ff2b19ddb8eec9d264c" \ + -H "PayPal-Client-Metadata-Id: c2edbd6e97b14ff2b19ddb8eec9d264c" \ -H "Authorization: Bearer WfXdnxmyJtdF4q59ofxuQuAAk6eEV-Njm6puht3Nk3w" \ -d '{ "intent":"authorize", @@ -308,7 +308,7 @@ curl 'https://api.paypal.com/v1/payments/authorization/4TD55050SV609544L/capture "update_time": "2013-10-01T00:43:30Z" } ``` - + `state`が`completed`と表示されると、販売は完了です。 diff --git a/release_notes.md b/release_notes.md index 1efa733..f321411 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,6 +1,13 @@ PayPal iOS SDK release notes ============================ +2.8.0 +----- +* Update `Paypal-Application-Correlation-Id` header to `PayPal-Client-Metadata-Id`, + and deprecate `[PayPalMobile applicationCorrelationIDForEnvironment:]` in favor + of `[PayPalMobile clientMetadataID]`. +* Update card.io library to 4.0.0. + 2.7.2 ----- * Minor bug fixes.