CardinalSessionConfiguration.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. //
  2. // CardinalSessionConfiguration.h
  3. // CardinalMobileSDK
  4. //
  5. // Copyright © 2018 CardinalCommerce. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "UiCustomization.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. /*!
  11. * @typedef CardinalSessionEnvironment
  12. * @brief List of CardinalSession Enviroments
  13. * @constant CardinalSessionEnvironmentStaging Staging Environment
  14. * @constant CardinalSessionEnvironmentProduction Production Environment
  15. */
  16. typedef NS_ENUM(NSUInteger, CardinalSessionEnvironment) {
  17. CardinalSessionEnvironmentStaging,
  18. CardinalSessionEnvironmentProduction
  19. };
  20. /*!
  21. * @typedef CardinalSessionUIType
  22. * @brief List of CardinalSession UI Types
  23. * @constant CardinalSessionUITypeBoth Support for both Native and HTML
  24. * @constant CardinalSessionUITypeNative Support for Native UI Type
  25. * @constant CardinalSessionUITypeHTML Support for HTML UI Type
  26. */
  27. typedef NS_ENUM(NSUInteger, CardinalSessionUIType) {
  28. CardinalSessionUITypeNative,
  29. #if TARGET_OS_IOS
  30. CardinalSessionUITypeHTML,
  31. CardinalSessionUITypeBoth
  32. #endif
  33. };
  34. /*!
  35. * @typedef CardinalSessionRenderType
  36. * @brief NSString that represents different RenderTypes
  37. */
  38. typedef NSString CardinalSessionRenderType;
  39. /*!
  40. * @typedef CardinalSessionRenderTypeArray
  41. * @brief NSArray of type CardinalSessionRenderType for holding all the RenderTyper supported
  42. */
  43. typedef NSArray<const CardinalSessionRenderType *> CardinalSessionRenderTypeArray;
  44. /*!
  45. * @const CardinalSessionRenderTypeOTP
  46. * @brief CardinalSessionRenderType for OTP
  47. */
  48. extern CardinalSessionRenderType const *CardinalSessionRenderTypeOTP;
  49. /*!
  50. * @const CardinalSessionRenderTypeSingleSelect
  51. * @brief CardinalSessionRenderType for Single Select
  52. */
  53. extern CardinalSessionRenderType const *CardinalSessionRenderTypeSingleSelect;
  54. /*!
  55. * @const CardinalSessionRenderTypeMultiSelect
  56. * @brief CardinalSessionRenderType for Multi Select
  57. */
  58. extern CardinalSessionRenderType const *CardinalSessionRenderTypeMultiSelect;
  59. /*!
  60. * @const CardinalSessionRenderTypeOOB
  61. * @brief CardinalSessionRenderType for OOB
  62. */
  63. extern CardinalSessionRenderType const *CardinalSessionRenderTypeOOB;
  64. #if TARGET_OS_IOS
  65. /*!
  66. * @const CardinalSessionRenderTypeHTML
  67. * @brief CardinalSessionRenderType for HTML
  68. */
  69. extern CardinalSessionRenderType const *CardinalSessionRenderTypeHTML;
  70. #endif
  71. /*!
  72. * @const CardinalSessionEnvironmentDEFAULT
  73. * @brief CardinalSessionEnvironment constant that represents the Default Environment based on the Build
  74. * In Debug builds, evaluates to .sandbox; In Release builds, evaluates to .production.
  75. */
  76. extern const CardinalSessionEnvironment CardinalSessionEnvironmentDEFAULT;
  77. /*!
  78. * @const CardinalSessionTimeoutStandard
  79. * @brief Standard Timeout for Cardinal Session. About 8 second.
  80. */
  81. extern NSUInteger const CardinalSessionTimeoutStandard;
  82. /*!
  83. * @const CardinalSessionTimeoutShort
  84. * @brief Short Timeout for Cardinal Session. About 1 second.
  85. */
  86. extern NSUInteger const CardinalSessionTimeoutShort;
  87. /// Evaluates to Standard timeout value (about 8 seconds)
  88. extern NSUInteger const CardinalSessionTimeoutDEFAULT;
  89. /*!
  90. * @interface CardinalSessionConfiguration Session Configuration
  91. * @brief Various Configurations for CardinalSession
  92. */
  93. @interface CardinalSessionConfiguration : NSObject <NSCopying>
  94. /*!
  95. * @property deploymentEnvironment Deployment Environment
  96. * @brief Sets the server the Cardinal SDK Session will communicate with.
  97. * See CardinalSessionEnvironment. Default value is CardinalSessionEnvironmentProduction.
  98. */
  99. @property (nonatomic, assign) CardinalSessionEnvironment deploymentEnvironment;
  100. /*!
  101. * @property requestTimeout Timeout in Milliseconds
  102. * @brief Sets the default timeout in milliseconds for how long the SDK will wait for a response from a Cardinal server for all operations. See preset values for Standard and Short timeouts.
  103. * Default value is CardinalSessionTimeoutDEFAULT (about 8 seconds).
  104. */
  105. @property (nonatomic, assign) NSUInteger requestTimeout;
  106. /*!
  107. * @property timeout Challenge Screen Timeout in Minutes.
  108. * @brief Sets the time in Minute before how long the SDK Challenge Screen will timeout. Minimum timeout is 5 minutes.
  109. * Default value is 5 minutes.
  110. */
  111. @property (nonatomic, assign) NSUInteger challengeTimeout;
  112. /*!
  113. * @property proxyServerURL Proxy Server URL
  114. * @brief Sets a proxy server through which the Cardinal SDK Session operates.
  115. * Default value is nil, meaning no proxy server is used.
  116. */
  117. @property (nonatomic, copy, nullable) NSURL *proxyServerURL;
  118. #if TARGET_OS_IOS
  119. /*!
  120. * @property uiType UI Type
  121. * @brief Sets the Interface type that the device supports for displaying specific challenge user interfaces within the SDK.
  122. * Default value is CardinalSessionUITypeBoth.
  123. */
  124. @property (nonatomic, assign) CardinalSessionUIType uiType;
  125. #elif TARGET_OS_TV
  126. /*!
  127. * @property uiType UI Type
  128. * @brief The Interface type that the device supports for displaying specific challenge user interfaces within the SDK.
  129. * Default value is CardinalSessionUITypeNative.
  130. */
  131. @property (nonatomic, assign, readonly) CardinalSessionUIType uiType;
  132. #endif
  133. /*!
  134. * @property enableQuickAuth Enable Quick Authentication
  135. * @brief Sets enable quick auth. This property is deprecated in v2.2.4. This feature will no longer be supported in the SDK.
  136. * Default value is false.
  137. */
  138. @property (nonatomic) BOOL enableQuickAuth DEPRECATED_ATTRIBUTE;
  139. /*!
  140. * @property renderType Render Type
  141. * @brief Sets RenderTypes that the device supports for displaying specific challenge user interfaces within the SDK.
  142. * Default value is false.
  143. */
  144. @property (nonatomic, copy) CardinalSessionRenderTypeArray *renderType;
  145. /*!
  146. * @property uiCustomization UI Customization of Challenge Views
  147. * @brief Set the customization of different UITypes for Challege Views.
  148. * Default value is nil.
  149. */
  150. @property (nonatomic, strong) UiCustomization *uiCustomization;
  151. /*!
  152. * @property darkModeUiCustomization UI Customization of Dark Mode Challenge Views
  153. * @brief Set the customization of different UITypes for Dark Mode Challege Views.
  154. * Default value is nil.
  155. */
  156. @property (nonatomic, strong) UiCustomization *darkModeUiCustomization;
  157. /*!
  158. * @property enableDFSync Synchronize Setup Task with Lasso
  159. * @brief Enable synchronize setup task.
  160. * Default value is true.
  161. */
  162. @property (nonatomic) BOOL enableDFSync;
  163. /*!
  164. * @property threeDSRequestorAppURL Three DS Requester APP URL
  165. * @brief Merchant app declaring their URL within the CReq message so that the Authentication app can call the Merchant app after OOB authentication has occurred. Each transaction would require a unique Transaction ID by using the SDK Transaction ID.
  166. */
  167. @property (nonatomic, copy, nullable) NSString *threeDSRequestorAppURL;
  168. /*!
  169. * @property collectLogs Collect Logs
  170. * @brief Collect and send logs for each transaction.
  171. * Default value is true.
  172. */
  173. @property (nonatomic) BOOL collectLogs;
  174. @end
  175. NS_ASSUME_NONNULL_END