CardinalResponse.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. //
  2. // CardinalResponse.h
  3. // CardinalMobileSDK
  4. //
  5. // Copyright © 2018 CardinalCommerce. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. /// For further documentation: https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects
  10. /*!
  11. * @typedef CardinalResponseActionCode
  12. * @brief List of resulting state of the transaction.
  13. * @constant CardinalResponseActionCodeSuccess The transaction resulted in success for the payment type used.
  14. * @constant CardinalResponseActionCodeNoAction The API calls to Centinel API were completed and there is no further actionable items to complete.
  15. * @constant CardinalResponseActionCodeFailure The transaction resulted in an error.
  16. * @constant CardinalResponseActionCodeError A service level error was encountered.
  17. * @constant CardinalResponseActionCodeCancel The transaction was cancelled by the user.
  18. * @constant CardinalResponseActionCodeTimeout The transaction was timed out.
  19. */
  20. typedef NS_ENUM(NSUInteger, CardinalResponseActionCode) {
  21. CardinalResponseActionCodeSuccess,
  22. CardinalResponseActionCodeNoAction,
  23. CardinalResponseActionCodeFailure,
  24. CardinalResponseActionCodeError,
  25. CardinalResponseActionCodeCancel,
  26. CardinalResponseActionCodeTimeout
  27. };
  28. // REVISIT: Turn these string values into enums for better type/value checking (wjf, 2018-02)
  29. @interface CardinalPaymentExtendedData : NSObject
  30. /*!
  31. * @property enrolled Enrolled
  32. * @brief Status of Authentication eligibility.
  33. * Possible Values:
  34. * Y = Yes- Bank is participating in 3D Secure protocol and will return the ACSUrl
  35. * N = No - Bank is not participating in 3D Secure protocol
  36. * U = Unavailable - The DS or ACS is not available for authentication at the time of the request
  37. * B = Bypass- Merchant authentication rule is triggered to bypass authentication in this use case
  38. */
  39. @property (nonatomic, readonly) NSString *enrolled;
  40. /*!
  41. * @property paResStatus PA Res Status
  42. * @brief Transaction status result identifier.
  43. * Possible Values:
  44. * Y – Successful Authentication
  45. * N – Failed Authentication
  46. * U – Unable to Complete Authentication
  47. * A – Successful Attempts Transaction
  48. */
  49. @property (nonatomic, readonly) NSString *paResStatus;
  50. /*!
  51. * @property signatureVerification Signature Verification
  52. * @brief Transaction Signature status identifier.
  53. * Possible Values:
  54. * Y - Indicates that the signature of the PARes has been validated successfully and the message contents can be trusted.
  55. * N - Indicates that the PARes could not be validated. This result could be for a variety of reasons; tampering, certificate expiration, etc., and the result should not be trusted.
  56. */
  57. @property (nonatomic, readonly) NSString *signatureVerification;
  58. /*!
  59. * @property cavv CAVV
  60. * @brief Cardholder Authentication Verification Value (CAVV)
  61. */
  62. @property (nonatomic, readonly) NSString *cavv;
  63. /*!
  64. * @property eciFlag ECIFlag
  65. * @brief Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data elements that indicate the transaction was processed electronically.
  66. */
  67. @property (nonatomic, readonly) NSString *eciFlag;
  68. /*!
  69. * @property xid XId
  70. * @brief Transaction identifier resulting from authentication processing.
  71. */
  72. @property (nonatomic, readonly) NSString *xid;
  73. + (instancetype)new NS_UNAVAILABLE;
  74. - (instancetype)init NS_UNAVAILABLE;
  75. @end
  76. // TODO: Turn these string values into enums for better type/value checking (wjf, 2018-02)
  77. @interface CardinalPayment : NSObject
  78. /*!
  79. * @property type Type
  80. * @brief The payment type of this transaction.
  81. * Possible Values:
  82. * CCA - Cardinal Consumer Authentication
  83. * Paypal
  84. * Wallet
  85. * VisaCheckout
  86. * ApplePay
  87. * DiscoverWallet
  88. */
  89. @property (nonatomic, readonly) NSString *type;
  90. /*!
  91. * @property processorTransactionId Processor Transaction Id
  92. * @brief The Transaction Identifier returned back from the Processor.
  93. * Possible Values:
  94. * CCA - Cardinal Consumer Authentication
  95. * Paypal
  96. * Wallet
  97. * VisaCheckout
  98. * ApplePay
  99. * DiscoverWallet
  100. */
  101. @property (nonatomic, readonly) NSString *processorTransactionId;
  102. /*!
  103. * @property extendedData Extended Data
  104. * @brief This will contain an extension object that corresponds to the Payment Type of this transaction.
  105. */
  106. @property (nullable, nonatomic, readonly) CardinalPaymentExtendedData *extendedData;
  107. + (instancetype)new NS_UNAVAILABLE;
  108. - (instancetype)init NS_UNAVAILABLE;
  109. @end
  110. /*!
  111. * @interface CardinalResponse Cardinal Response
  112. * @brief Response from the Cardinal after Validation.
  113. */
  114. @interface CardinalResponse : NSObject
  115. /*!
  116. * @property isValidated isValidated
  117. * @brief This value represents whether transaction was successfully or not.
  118. */
  119. @property (nonatomic, readonly) BOOL isValidated;
  120. /*!
  121. * @property payment Payment
  122. * @brief CardinalPayment object.
  123. * Check CardinalPayment object for detail information.
  124. */
  125. @property (nullable, nonatomic, readonly) CardinalPayment *payment;
  126. /*!
  127. * @property actionCode Action Code
  128. * @brief The resulting state of the transaction.
  129. * Check CardinalResponseActionCode enum for detail.
  130. */
  131. @property (nonatomic, readonly) CardinalResponseActionCode actionCode;
  132. /*!
  133. * @property errorNumber Error Number
  134. * @brief Application error number. A non-zero value represents the error encountered while attempting the process the message request.
  135. */
  136. @property (nonatomic, readonly) NSInteger errorNumber;
  137. /*!
  138. * @property errorDescription Error Description
  139. * @brief Application error description for the associated error number.
  140. */
  141. @property (nonatomic, readonly) NSString *errorDescription;
  142. + (instancetype)new NS_UNAVAILABLE;
  143. - (instancetype)init NS_UNAVAILABLE;
  144. @end
  145. NS_ASSUME_NONNULL_END