BTThreeDSecureRequest.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #import <Foundation/Foundation.h>
  2. #if __has_include("BraintreeCore.h")
  3. #import "BraintreeCore.h"
  4. #else
  5. #import <BraintreeCore/BraintreeCore.h>
  6. #endif
  7. #import "BTPaymentFlowRequest.h"
  8. #import "BTPaymentFlowDriver.h"
  9. #import "BTThreeDSecurePostalAddress.h"
  10. #import "BTThreeDSecureAdditionalInformation.h"
  11. #import "BTThreeDSecureLookup.h"
  12. #import "BTThreeDSecureV1UICustomization.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. /**
  15. Error codes that describe errors that occur during 3D Secure.
  16. */
  17. typedef NS_ENUM(NSInteger, BTThreeDSecureVersion){
  18. /// 3DS 1.0
  19. BTThreeDSecureVersion1,
  20. /// 3DS 2.0
  21. BTThreeDSecureVersion2
  22. };
  23. @class BTThreeDSecureRequest, UiCustomization;
  24. @protocol BTThreeDSecureRequestDelegate;
  25. /**
  26. Used to initialize a 3D Secure payment flow
  27. */
  28. @interface BTThreeDSecureRequest : BTPaymentFlowRequest <BTPaymentFlowRequestDelegate>
  29. /**
  30. A nonce to be verified by ThreeDSecure
  31. */
  32. @property (nonatomic, copy) NSString *nonce;
  33. /**
  34. The amount for the transaction
  35. */
  36. @property (nonatomic, copy) NSDecimalNumber *amount;
  37. /**
  38. Optional. The billing address used for verification
  39. @see BTThreeDSecurePostalAddress
  40. */
  41. @property (nonatomic, nullable, copy) BTThreeDSecurePostalAddress *billingAddress;
  42. /**
  43. Optional. The mobile phone number used for verification
  44. @note Only numbers. Remove dashes, parentheses and other characters
  45. */
  46. @property (nonatomic, nullable, copy) NSString *mobilePhoneNumber;
  47. /**
  48. Optional. The email used for verification
  49. */
  50. @property (nonatomic, nullable, copy) NSString *email;
  51. /**
  52. Optional. The 2-digit string indicating the shipping method chosen for the transaction
  53. Possible Values:
  54. 01 Same Day
  55. 02 Overnight / Expedited
  56. 03 Priority (2-3 Days)
  57. 04 Ground
  58. 05 Electronic Delivery
  59. 06 Ship to Store
  60. */
  61. @property (nonatomic, nullable, copy) NSString *shippingMethod;
  62. /**
  63. Optional. The additional information used for verification
  64. @see BTThreeDSecureAdditionalInformation
  65. */
  66. @property (nonatomic, nullable, strong) BTThreeDSecureAdditionalInformation *additionalInformation;
  67. /**
  68. Optional. Set to BTThreeDSecureVersion2 if ThreeDSecure V2 flows are desired, when possible. Defaults to BTThreeDSecureVersion2
  69. */
  70. @property (nonatomic, assign) BTThreeDSecureVersion versionRequested;
  71. /**
  72. Optional. If set to true, an authentication challenge will be forced if possible.
  73. */
  74. @property (nonatomic) BOOL challengeRequested;
  75. /**
  76. Optional. If set to true, an exemption to the authentication challenge will be requested.
  77. */
  78. @property (nonatomic) BOOL exemptionRequested;
  79. /**
  80. Optional. UI Customization for 3DS2 challenge views.
  81. @see https://cardinaldocs.atlassian.net/wiki/spaces/CMSDK/pages/873234760/iOS+UI+Customization
  82. */
  83. @property (nonatomic, nullable, strong) UiCustomization *uiCustomization;
  84. /**
  85. Optional. UI Customization for 3DS1 challenge views.
  86. */
  87. @property (nonatomic, nullable, strong) BTThreeDSecureV1UICustomization *v1UICustomization;
  88. /**
  89. A delegate for receiving information about the ThreeDSecure payment flow.
  90. */
  91. @property (nonatomic, nullable, weak) id<BTThreeDSecureRequestDelegate> threeDSecureRequestDelegate;
  92. @end
  93. /**
  94. Protocol for ThreeDSecure Request flow
  95. */
  96. @protocol BTThreeDSecureRequestDelegate
  97. @required
  98. /**
  99. Required delegate method which returns the ThreeDSecure lookup result before the flow continues.
  100. Use this to do any UI preparation or custom lookup result handling. Use the `next()` callback to continue the flow.
  101. */
  102. - (void)onLookupComplete:(BTThreeDSecureRequest *)request result:(BTThreeDSecureLookup *)result next:(void(^)(void))next;
  103. @end
  104. NS_ASSUME_NONNULL_END