PPOTAppSwitchResponse.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // PPOTAppSwitchResponse.h
  3. // PayPalOneTouch
  4. //
  5. // Copyright © 2014 PayPal, Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "PPOTAppSwitchUtil.h"
  9. @class PPOTConfigurationRecipe;
  10. @interface PPOTAppSwitchResponse : NSObject
  11. /**
  12. info from the most recent request
  13. */
  14. @property (nonatomic, readonly) NSString *encryptionKey;
  15. @property (nonatomic, readonly) PPAppSwitchResponseAction action;
  16. /**
  17. represents payment_code_type for version 3 for now
  18. */
  19. @property (nonatomic, readonly) PPAppSwitchResponseType responseType;
  20. @property (nonatomic, readonly) NSInteger version;
  21. @property (nonatomic, readonly) NSString *displayName;
  22. @property (nonatomic, readonly) NSString *email;
  23. @property (nonatomic, readonly) NSString *accessToken;
  24. /**
  25. represents payment_code in version 3 for now
  26. */
  27. @property (nonatomic, readonly) NSString *authorizationCode;
  28. @property (nonatomic, readonly) NSInteger expiresIn;
  29. @property (nonatomic, readonly) NSArray *scope;
  30. /**
  31. not sent yet
  32. */
  33. @property (nonatomic, readonly) NSString *photoURL;
  34. @property (nonatomic, readonly) NSDictionary *decodedPayload;
  35. /**
  36. can contain debug_id and message
  37. */
  38. @property (nonatomic, readonly) NSDictionary *error;
  39. @property (nonatomic, readonly) NSString *environment;
  40. /**
  41. version 0 and 2
  42. */
  43. @property (nonatomic, readonly) NSString *webURL;
  44. /**
  45. version 3
  46. */
  47. @property (nonatomic, readonly) NSDate *timeStamp;
  48. @property (nonatomic, readonly) NSString *msgID;
  49. /**
  50. version 0
  51. */
  52. - (instancetype)initWithHermesURL:(NSURL *)url environment:(NSString *)environment;
  53. /**
  54. version 1, 2, 3
  55. */
  56. - (instancetype)initWithEncodedURL:(NSURL *)url encryptionKey:(NSString *)encryptionKey;
  57. - (BOOL)validResponse;
  58. @end