// // PPOTConfiguration.h // PayPalOneTouch // // Copyright © 2015 PayPal, Inc. All rights reserved. // #import #import "PPOTCore.h" #import "PPOTRequest.h" @interface PPOTConfigurationRecipe : NSObject @property (nonatomic, assign, readwrite) PPOTRequestTarget target; @property (nonatomic, strong, readwrite) NSNumber *protocolVersion; @property (nonatomic, strong, readwrite) NSArray *supportedLocales; // these have been uppercased, to prevent capitalization mistakes @property (nonatomic, strong, readwrite) NSString *targetAppURLScheme; @property (nonatomic, strong, readwrite) NSArray *targetAppBundleIDs; @end @interface PPOTConfigurationRecipeEndpoint : NSObject @property (nonatomic, strong, readwrite) NSString *url; @property (nonatomic, strong, readwrite) NSString *certificateSerialNumber; @property (nonatomic, strong, readwrite) NSString *base64EncodedCertificate; @end @interface PPOTConfigurationOAuthRecipe : PPOTConfigurationRecipe @property (nonatomic, strong, readwrite) NSSet *scope; @property (nonatomic, strong, readwrite) NSDictionary *endpoints; // dictionary of PPOTConfigurationRecipeEndpoint @end @interface PPOTConfigurationCheckoutRecipe : PPOTConfigurationRecipe // no subclass-specific properties, so far @end @interface PPOTConfigurationBillingAgreementRecipe : PPOTConfigurationRecipe // no subclass-specific properties, so far @end @class PPOTConfiguration; typedef void (^PPOTConfigurationCompletionBlock)(PPOTConfiguration *currentConfiguration); @interface PPOTConfiguration : NSObject /** In the background: if the cached configuration is stale, then downloads the latest version. */ + (void)updateCacheAsNecessary; /** Returns the current configuration, either from cache or else the hardcoded default configuration. */ + (PPOTConfiguration *)getCurrentConfiguration; /** This method is here only for PPOTConfigurationTest. Everyone else, please stick to using [PPOTConfiguration getCurrentConfiguration]!!! */ + (PPOTConfiguration *)configurationWithDictionary:(NSDictionary *)dictionary; #ifdef DEBUG + (void)useHardcodedConfiguration:(BOOL)useHardcodedConfiguration; #endif @property (nonatomic, strong, readwrite) NSString *fileTimestamp; @property (nonatomic, strong, readwrite) NSArray *prioritizedOAuthRecipes; @property (nonatomic, strong, readwrite) NSArray *prioritizedCheckoutRecipes; @property (nonatomic, strong, readwrite) NSArray *prioritizedBillingAgreementRecipes; @end // The following definitions are for backwards compatibility @interface PPConfiguration: PPOTConfiguration @end @interface PPConfigurationCheckoutRecipe : PPOTConfigurationCheckoutRecipe @end @interface PPConfigurationBillingAgreementRecipe : PPOTConfigurationBillingAgreementRecipe @end @interface PPConfigurationOAuthRecipe : PPOTConfigurationOAuthRecipe @end @interface PPConfigurationRecipeEndpoint : PPOTConfigurationRecipeEndpoint @end