BTPayPalDriver_Internal.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #if __has_include(<Braintree/BraintreePayPal.h>)
  2. #import <Braintree/BTPayPalDriver.h>
  3. #else
  4. #import <BraintreePayPal/BTPayPalDriver.h>
  5. #endif
  6. #import <AuthenticationServices/AuthenticationServices.h>
  7. #import "BTPayPalRequest_Internal.h"
  8. @class BTPayPalCreditFinancing;
  9. @class BTPayPalCreditFinancingAmount;
  10. @class BTJSON;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @interface BTPayPalDriver ()
  13. /**
  14. Exposed for testing the approvalURL construction
  15. */
  16. @property (nonatomic, strong) NSURL *approvalUrl;
  17. /**
  18. Exposed for testing to get the instance of BTAPIClient
  19. */
  20. @property (nonatomic, strong, nullable) BTAPIClient *apiClient;
  21. /**
  22. Exposed for testing the clientMetadataID associated with this request
  23. */
  24. @property (nonatomic, strong) NSString *clientMetadataID;
  25. /**
  26. Exposed for testing the intent associated with this request
  27. */
  28. @property (nonatomic, strong) BTPayPalRequest *payPalRequest;
  29. /**
  30. Exposed for testing, the ASWebAuthenticationSession instance used for the PayPal flow
  31. */
  32. @property (nonatomic, strong, nullable) ASWebAuthenticationSession *authenticationSession;
  33. /**
  34. Exposed for testing, for determining if ASWebAuthenticationSession was started
  35. */
  36. @property (nonatomic, assign) BOOL isAuthenticationSessionStarted;
  37. + (nullable BTPayPalCreditFinancingAmount *)creditFinancingAmountFromJSON:(BTJSON *)amountJSON;
  38. + (nullable BTPayPalCreditFinancing *)creditFinancingFromJSON:(BTJSON *)creditFinancingOfferedJSON;
  39. /**
  40. Exposed for testing the flow after the customer has authorized the payment in the browser
  41. */
  42. - (void)handleBrowserSwitchReturnURL:(NSURL *)url paymentType:(BTPayPalPaymentType)paymentType completion:(void (^)(BTPayPalAccountNonce * _Nullable tokenizedCheckout, NSError * _Nullable error))completionBlock;
  43. @end
  44. NS_ASSUME_NONNULL_END