BTPaymentFlowDriver+ThreeDSecure.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #if __has_include("BraintreeCore.h")
  2. #import "BraintreeCore.h"
  3. #else
  4. #import <BraintreeCore/BraintreeCore.h>
  5. #endif
  6. #import "BTPaymentFlowDriver.h"
  7. NS_ASSUME_NONNULL_BEGIN
  8. /**
  9. Domain for 3D Secure flow errors.
  10. */
  11. extern NSString * const BTThreeDSecureFlowErrorDomain;
  12. /**
  13. Error codes associated with 3D Secure flow.
  14. */
  15. typedef NS_ENUM(NSInteger, BTThreeDSecureFlowErrorType) {
  16. /// Unknown error
  17. BTThreeDSecureFlowErrorTypeUnknown = 0,
  18. /// 3D Secure failed during the backend card lookup phase; please retry
  19. BTThreeDSecureFlowErrorTypeFailedLookup,
  20. /// 3D Secure failed during the user-facing authentication phase; please retry
  21. BTThreeDSecureFlowErrorTypeFailedAuthentication,
  22. /// 3D Secure was not configured correctly
  23. BTThreeDSecureFlowErrorTypeConfiguration,
  24. };
  25. /**
  26. Category on BTPaymentFlowDriver for 3D Secure
  27. */
  28. @interface BTPaymentFlowDriver (ThreeDSecure)
  29. /**
  30. Creates a stringified JSON object containing the information necessary to perform a lookup.
  31. @param request The BTThreeDSecureRequest object where prepareLookup was called.
  32. @param completionBlock This completion will be invoked exactly once with the client payload string or an error.
  33. */
  34. - (void)prepareLookup:(BTPaymentFlowRequest<BTPaymentFlowRequestDelegate> *)request completion:(void (^)(NSString * _Nullable lookupPayload, NSError * _Nullable error))completionBlock;
  35. /**
  36. Initialize a challenge from a server side lookup call.
  37. @param lookupResponse The json string returned by the server side lookup.
  38. @param request The BTThreeDSecureRequest object where prepareLookup was called.
  39. @param completionBlock This completion will be invoked exactly once when the payment flow is complete or an error occurs.
  40. */
  41. - (void)initializeChallengeWithLookupResponse:(NSString *)lookupResponse request:(BTPaymentFlowRequest<BTPaymentFlowRequestDelegate> *)request completion:(void (^)(BTPaymentFlowResult * _Nullable result, NSError * _Nullable error))completionBlock;
  42. @end
  43. NS_ASSUME_NONNULL_END