ThreeDS2Service.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. //
  2. // ThreeDS2Service.h
  3. // CardinalEMVCoSDK
  4. //
  5. // Copyright © 2018 Cardinal Commerce. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "ConfigParameters.h"
  9. #import "UiCustomization.h"
  10. #import "Warning.h"
  11. #import "CardinalTransaction.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. * The ThreeDS2Service protocol is the main 3DS SDK protocol. It shall provide methods to process transactions.
  15. */
  16. @protocol ThreeDS2Service
  17. /**
  18. * The Merchant App should call the initialize method at the start of the payment stage of a transaction.
  19. * The app should pass configuration parameters, UI configuration parameters, and (optionally)
  20. * user locale to this method.
  21. * @param configParameters Configuration information that is used during initialization.
  22. * @param locale String that represents the locale for the app’s user interface.
  23. For example, the value of locale can be “en_US” in Java.
  24. * @param uiCustomization UI configuration information that is used to specify the UI layout and theme. For example, font style and font size.
  25. * @param error Reference to NSError Object to handle exceptions.
  26. */
  27. - (BOOL) initializeWithConfig: (nonnull ConfigParameters *) configParameters
  28. locale: (nullable NSString *) locale
  29. uiCustomization: (nullable UiCustomization *) uiCustomization
  30. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(initialize(_:locale:uiCustomization:));
  31. /**
  32. * The Merchant App should call the initialize method at the start of the payment stage of a transaction.
  33. * The app should pass configuration parameters, UI configuration parameters, and (optionally)
  34. * user locale to this method.
  35. * @param configParameters Configuration information that is used during initialization.
  36. * @param error Reference to NSError Object to handle exceptions.
  37. */
  38. - (BOOL) initializeWithConfig: (nonnull ConfigParameters *) configParameters
  39. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(initialize(_:));
  40. /**
  41. * The Merchant App should call the initialize method at the start of the payment stage of a transaction.
  42. * The app should pass configuration parameters, UI configuration parameters, and (optionally)
  43. * user locale to this method.
  44. * @param configParameters Configuration information that is used during initialization.
  45. * @param locale String that represents the locale for the app’s user interface.
  46. For example, the value of locale can be “en_US” in Java.
  47. * @param error Reference to NSError Object to handle exceptions.
  48. */
  49. - (BOOL) initializeWithConfig: (nonnull ConfigParameters *) configParameters
  50. locale: (nullable NSString *) locale
  51. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(initialize(_:locale:));
  52. /**
  53. * The Merchant App should call the initialize method at the start of the payment stage of a transaction.
  54. * The app should pass configuration parameters, UI configuration parameters, and (optionally)
  55. * user locale to this method.
  56. * @param configParameters Configuration information that is used during initialization.
  57. * @param uiCustomization UI configuration information that is used to specify the UI layout and theme. For example, font style and font size.
  58. * @param error Reference to NSError Object to handle exceptions.
  59. */
  60. - (BOOL) initializeWithConfig: (nonnull ConfigParameters *) configParameters
  61. uiCustomization: (nullable UiCustomization *) uiCustomization
  62. error: (NSError **)error __attribute__((swift_error(nonnull_error)))
  63. NS_SWIFT_NAME(initialize(_:uiCustomization:));
  64. /**
  65. * The createTransaction method shall create an instance of the Transaction through which the
  66. * Merchant App shall get the data that is required to perform the transaction.
  67. * @param directoryServerId Registered Application Provider Identifier (RID) that is unique to the Payment System.
  68. * @param messageVersion Protocol version according to which the transaction shall be created.
  69. * @param error Reference to NSError Object to handle exceptions.
  70. * @return CETransaction
  71. */
  72. - (CardinalTransaction *) createTransactionWithDirectoryServerId: (NSString *) directoryServerId
  73. messageVersion: (NSString *) messageVersion
  74. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(createTransaction(_:messageVersion:));
  75. /**
  76. * The createTransaction method creates an instance of the Transaction through which the
  77. * Merchant App will get the data that is required to perform the transaction.
  78. * @param directoryServerId Registered Application Provider Identifier (RID) that is unique to the Payment System.
  79. * @param error Reference to NSError Object to handle exceptions.
  80. * @return CETransaction Transaction for given Directory Server ID.
  81. */
  82. - (CardinalTransaction *) createTransactionWithDirectoryServerId: (NSString *) directoryServerId
  83. error: (NSError **)error __attribute__((swift_error(nonnull_error)))
  84. NS_SWIFT_NAME(createTransaction(_:));
  85. /**
  86. * The cleanup method frees up resources that are used by the 3DS SDK.
  87. * It shall be called only once during a single Merchant App session.
  88. * @param error Reference to NSError Object to handle exceptions.
  89. */
  90. - (BOOL) cleanup:(NSError **)error __attribute__((swift_error(nonnull_error)))
  91. NS_SWIFT_NAME(cleanup());
  92. /**
  93. * The getSDKVersion method returns the version of the 3DS SDK that is integrated with the Merchant App.
  94. * @param error Reference to NSError Object to handle exceptions.
  95. */
  96. - (NSString *) getSDKVersion:(NSError **)error __attribute__((swift_error(nonnull_error)))
  97. NS_SWIFT_NAME(getSDKVersion());
  98. /**
  99. * The getWarnings method returns the warnings produced by the 3DS SDK during initialization.
  100. * @return List of Warnings
  101. */
  102. - (NSArray<Warning *> *) getWarnings;
  103. @end
  104. NS_ASSUME_NONNULL_END