From 502fa9f99a72b13c815df69ea5d07ce7136c4415 Mon Sep 17 00:00:00 2001 From: Mickey Reiss Date: Mon, 9 Feb 2015 13:33:25 -0800 Subject: [PATCH] Conslidate BTClient_Metadata.h with BTClient_Internal.h `BTClient_Metadata.h` was intended to be a private header but it has been in `@Public` incidentally since it was introduced. This commit corrects that by moving it to the BTClient extension in `BTClient_Internal.h`. --- Braintree.xcodeproj/project.pbxproj | 2 -- Braintree/API/@Public/BTClient_Metadata.h | 15 --------------- Braintree/API/Client/BTClient.m | 2 -- Braintree/API/Client/BTClient_Internal.h | 13 +++++++++---- Braintree/Drop-In/BTDropInViewController.m | 2 +- Braintree/PayPal/BTPayPalAppSwitchHandler.m | 2 +- Braintree/PayPal/BTPayPalViewController.m | 2 +- Braintree/Venmo/BTVenmoAppSwitchHandler.m | 2 +- CHANGELOG.md | 15 +++++++++++---- Specs/Braintree-API-Specs/BTClientSpec.m | 1 - Specs/Braintree-API-Specs/BTClient_MetadataSpec.m | 2 +- 11 files changed, 25 insertions(+), 33 deletions(-) delete mode 100644 Braintree/API/@Public/BTClient_Metadata.h diff --git a/Braintree.xcodeproj/project.pbxproj b/Braintree.xcodeproj/project.pbxproj index 603fff4900..d6dfa7f81f 100644 --- a/Braintree.xcodeproj/project.pbxproj +++ b/Braintree.xcodeproj/project.pbxproj @@ -692,7 +692,6 @@ A7B7434019A3E4B5000A6A7A /* BTVenmoAppSwitchRequestURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BTVenmoAppSwitchRequestURL.m; sourceTree = ""; }; A7C7F82D19B905C400493311 /* BTPaymentProviderErrors.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BTPaymentProviderErrors.m; sourceTree = ""; }; A7CB617319B7B13000E972A8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - A7E5BEAF19ABDA59006AEB9B /* BTClient_Metadata.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BTClient_Metadata.h; sourceTree = ""; }; A7E5BEB019ABE5D0006AEB9B /* BTAppSwitchSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTAppSwitchSpec.m; sourceTree = ""; }; A7E5BEB319ABE5F3006AEB9B /* BTAppSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BTAppSwitch.h; sourceTree = ""; }; A7E5BEB419ABE5F3006AEB9B /* BTAppSwitch.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BTAppSwitch.m; sourceTree = ""; }; @@ -1035,7 +1034,6 @@ A7E5BEB519ABE5F3006AEB9B /* BTAppSwitching.h */, 77037AD319B0112A0097DADE /* BTAppSwitchingDelegate.h */, 16217420192D85EB008DC35D /* BTCardPaymentMethod.h */, - A7E5BEAF19ABDA59006AEB9B /* BTClient_Metadata.h */, 16217423192D85EB008DC35D /* BTClient.h */, 16217421192D85EB008DC35D /* BTClient+Offline.h */, 16217422192D85EB008DC35D /* BTClient+Testing.h */, diff --git a/Braintree/API/@Public/BTClient_Metadata.h b/Braintree/API/@Public/BTClient_Metadata.h deleted file mode 100644 index 0d68e4d0cb..0000000000 --- a/Braintree/API/@Public/BTClient_Metadata.h +++ /dev/null @@ -1,15 +0,0 @@ -#import "BTClient.h" -#import "BTClientMetadata.h" - -@interface BTClient () - -@property (nonatomic, copy, readonly) BTClientMetadata *metadata; - -/// Copy of the instance, but with different metadata -/// -/// Useful for temporary metadata overrides. -/// -/// @param metadataBlock block for customizing metadata -- (instancetype)copyWithMetadata:(void (^)(BTClientMutableMetadata *metadata))metadataBlock; - -@end diff --git a/Braintree/API/Client/BTClient.m b/Braintree/API/Client/BTClient.m index ebba2c055e..f12058f580 100644 --- a/Braintree/API/Client/BTClient.m +++ b/Braintree/API/Client/BTClient.m @@ -1,7 +1,5 @@ @import PassKit; -#import "BTClient.h" -#import "BTClient_Metadata.h" #import "BTClient_Internal.h" #import "BTClientToken.h" #import "BTLogger_Internal.h" diff --git a/Braintree/API/Client/BTClient_Internal.h b/Braintree/API/Client/BTClient_Internal.h index d494253124..f8082bf30c 100644 --- a/Braintree/API/Client/BTClient_Internal.h +++ b/Braintree/API/Client/BTClient_Internal.h @@ -1,6 +1,7 @@ #import "BTClient.h" #import "BTHTTP.h" #import "BTClientToken.h" +#import "BTClientMetadata.h" @interface BTClient () @property (nonatomic, strong, readwrite) BTHTTP *clientApiHttp; @@ -9,9 +10,13 @@ /// Models the contents of the client token, as it is received from the merchant server @property (nonatomic, strong) BTClientToken *clientToken; -// Internal helpers -// Declared here to make available for testing -// TODO: Delete me -//+ (BTPayPalPaymentMethod *)payPalPaymentMethodFromAPIResponseDictionary:(NSDictionary *)response; +@property (nonatomic, copy, readonly) BTClientMetadata *metadata; + +/// Copy of the instance, but with different metadata +/// +/// Useful for temporary metadata overrides. +/// +/// @param metadataBlock block for customizing metadata +- (instancetype)copyWithMetadata:(void (^)(BTClientMutableMetadata *metadata))metadataBlock; @end diff --git a/Braintree/Drop-In/BTDropInViewController.m b/Braintree/Drop-In/BTDropInViewController.m index 4e51576080..8033391e7f 100644 --- a/Braintree/Drop-In/BTDropInViewController.m +++ b/Braintree/Drop-In/BTDropInViewController.m @@ -10,7 +10,7 @@ #import "BTDropInErrorAlert.h" #import "BTDropInLocalizedString.h" #import "BTPaymentMethodCreationDelegate.h" -#import "BTClient_Metadata.h" +#import "BTClient_Internal.h" #import "BTLogger_Internal.h" @interface BTDropInViewController () < BTDropInSelectPaymentMethodViewControllerDelegate, BTUIScrollViewScrollRectToVisibleDelegate, BTUICardFormViewDelegate, BTPaymentMethodCreationDelegate, BTDropInViewControllerDelegate> diff --git a/Braintree/PayPal/BTPayPalAppSwitchHandler.m b/Braintree/PayPal/BTPayPalAppSwitchHandler.m index e30c4acfd4..af611e3db1 100644 --- a/Braintree/PayPal/BTPayPalAppSwitchHandler.m +++ b/Braintree/PayPal/BTPayPalAppSwitchHandler.m @@ -1,6 +1,6 @@ #import "BTPayPalAppSwitchHandler_Internal.h" -#import "BTClient_Metadata.h" +#import "BTClient_Internal.h" #import "BTClient+BTPayPal.h" #import "BTMutablePayPalPaymentMethod.h" #import "BTLogger_Internal.h" diff --git a/Braintree/PayPal/BTPayPalViewController.m b/Braintree/PayPal/BTPayPalViewController.m index 6af3fd88fa..a6527cb858 100644 --- a/Braintree/PayPal/BTPayPalViewController.m +++ b/Braintree/PayPal/BTPayPalViewController.m @@ -1,7 +1,7 @@ #import "BTPayPalViewController_Internal.h" #import "BTClient+BTPayPal.h" -#import "BTClient_Metadata.h" +#import "BTClient_Internal.h" #import "BTErrors+BTPayPal.h" #import "BTMutablePayPalPaymentMethod.h" diff --git a/Braintree/Venmo/BTVenmoAppSwitchHandler.m b/Braintree/Venmo/BTVenmoAppSwitchHandler.m index 85b3efa1fd..3e32676c7e 100644 --- a/Braintree/Venmo/BTVenmoAppSwitchHandler.m +++ b/Braintree/Venmo/BTVenmoAppSwitchHandler.m @@ -3,7 +3,7 @@ #import "BTVenmoAppSwitchRequestURL.h" #import "BTVenmoAppSwitchReturnURL.h" #import "BTClient+BTVenmo.h" -#import "BTClient_Metadata.h" +#import "BTClient_Internal.h" #import "BTMutableCardPaymentMethod.h" @implementation BTVenmoAppSwitchHandler diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fd5c0805e..f99ad6afa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,17 @@ ## 3.6.0 -* Make Apple Pay a build option, enabled via `Braintree/Apple-Pay` subspec, - which adds a `BT_ENABLE_APPLE_PAY=1` preprocesor macro. - * Addresses an issue [reported by developers attempting to submit v.zero integrations without Apple Pay to the app store](https://github.com/braintree/braintree_ios/issues/60). -* Internal simplifications to API response parsing logic +* New Features + * Make Apple Pay a build option, enabled via `Braintree/Apple-Pay` subspec, + which adds a `BT_ENABLE_APPLE_PAY=1` preprocesor macro. + * Addresses an issue [reported by developers attempting to submit v.zero integrations without Apple Pay to the app store](https://github.com/braintree/braintree_ios/issues/60). + +* Enhancements + * Internal simplifications to API response parsing logic + +* Bug fixes + * Fix swift build by making BTClient_Metadata.h private (https://github.com/braintree/braintree_ios/pull/84 and https://github.com/braintree/braintree_ios/pull/85) + ## 3.5.0 (2014-12-03) diff --git a/Specs/Braintree-API-Specs/BTClientSpec.m b/Specs/Braintree-API-Specs/BTClientSpec.m index 159d197a82..3c9767f9d5 100644 --- a/Specs/Braintree-API-Specs/BTClientSpec.m +++ b/Specs/Braintree-API-Specs/BTClientSpec.m @@ -5,7 +5,6 @@ #import "BTClient+Testing.h" #import "BTTestClientTokenFactory.h" #import "BTAnalyticsMetadata.h" -#import "BTClient_Metadata.h" #import "BTLogger_Internal.h" diff --git a/Specs/Braintree-API-Specs/BTClient_MetadataSpec.m b/Specs/Braintree-API-Specs/BTClient_MetadataSpec.m index ea9de66b5a..46853da508 100644 --- a/Specs/Braintree-API-Specs/BTClient_MetadataSpec.m +++ b/Specs/Braintree-API-Specs/BTClient_MetadataSpec.m @@ -1,7 +1,7 @@ #import "BTClient_Internal.h" #import "BTClient+Offline.h" #import "BTClient+Testing.h" -#import "BTClient_Metadata.h" +#import "BTClient_Internal.h" SpecBegin(BTClient_Metadata)