PPOTRequestFactory.h 5.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // PPOTRequestFactory.h
  3. // PayPalOneTouch
  4. //
  5. // Copyright © 2015 PayPal, Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "PPOTRequest.h"
  9. /**
  10. Used to build request objects that initialize PayPay payment flows
  11. */
  12. @interface PPOTRequestFactory : NSObject
  13. /**
  14. Factory method. Non-empty values for all parameters MUST be provided.
  15. @param approvalURL Client has already created a payment on PayPal server; this is the resulting HATEOS ApprovalURL
  16. @param clientID The app's Client ID, as obtained from developer.paypal.com
  17. @param environment `PayPalEnvironmentProduction`, `PayPalEnvironmentMock`, or `PayPalEnvironmentSandbox`;
  18. or else a stage indicated as `base-url:port`
  19. @param callbackURLScheme The URL scheme to be used for returning to this app, following an app-switch
  20. */
  21. + (nullable PPOTCheckoutRequest *)checkoutRequestWithApprovalURL:(nonnull NSURL *)approvalURL
  22. clientID:(nonnull NSString *)clientID
  23. environment:(nonnull NSString *)environment
  24. callbackURLScheme:(nonnull NSString *)callbackURLScheme;
  25. /**
  26. Factory method. Only `pairingId` can be nil.
  27. @param approvalURL Client has already created a payment on PayPal server; this is the resulting HATEOS ApprovalURL
  28. @param pairingId The pairing ID for the risk component. Optional.
  29. @param clientID The app's Client ID, as obtained from developer.paypal.com
  30. @param environment `PayPalEnvironmentProduction`, `PayPalEnvironmentMock`, or `PayPalEnvironmentSandbox`;
  31. or else a stage indicated as `base-url:port`
  32. @param callbackURLScheme The URL scheme to be used for returning to this app, following an app-switch
  33. */
  34. + (nullable PPOTCheckoutRequest *)checkoutRequestWithApprovalURL:(nonnull NSURL *)approvalURL
  35. pairingId:(nullable NSString *)pairingId
  36. clientID:(nonnull NSString *)clientID
  37. environment:(nonnull NSString *)environment
  38. callbackURLScheme:(nonnull NSString *)callbackURLScheme;
  39. /**
  40. Factory method. Non-empty values for all parameters MUST be provided.
  41. @param scopeValues Set of requested scope-values.
  42. Available scope-values are listed at https://developer.paypal.com/webapps/developer/docs/integration/direct/identity/attributes/
  43. @param privacyURL The URL of the merchant's privacy policy
  44. @param agreementURL The URL of the merchant's user agreement
  45. @param clientID The app's Client ID, as obtained from developer.paypal.com
  46. @param environment `PayPalEnvironmentProduction`, `PayPalEnvironmentMock`, or `PayPalEnvironmentSandbox`;
  47. or else a stage indicated as `base-url:port`
  48. @param callbackURLScheme The URL scheme to be used for returning to this app, following an app-switch
  49. */
  50. + (nullable PPOTAuthorizationRequest *)authorizationRequestWithScopeValues:(nonnull NSSet *)scopeValues
  51. privacyURL:(nonnull NSURL *)privacyURL
  52. agreementURL:(nonnull NSURL *)agreementURL
  53. clientID:(nonnull NSString *)clientID
  54. environment:(nonnull NSString *)environment
  55. callbackURLScheme:(nonnull NSString *)callbackURLScheme;
  56. /**
  57. Factory method. Non-empty values for all parameters MUST be provided.
  58. @param approvalURL Client has already created a payment on PayPal server; this is the resulting HATEOS ApprovalURL
  59. @param clientID The app's Client ID, as obtained from developer.paypal.com
  60. @param environment `PayPalEnvironmentProduction`, `PayPalEnvironmentMock`, or `PayPalEnvironmentSandbox`;
  61. or else a stage indicated as `base-url:port`
  62. @param callbackURLScheme The URL scheme to be used for returning to this app, following an app-switch
  63. */
  64. + (nullable PPOTBillingAgreementRequest *)billingAgreementRequestWithApprovalURL:(nonnull NSURL *)approvalURL
  65. clientID:(nonnull NSString *)clientID
  66. environment:(nonnull NSString *)environment
  67. callbackURLScheme:(nonnull NSString *)callbackURLScheme;
  68. /**
  69. Factory method. Only pairingId can be nil.
  70. @param approvalURL Client has already created a payment on PayPal server; this is the resulting HATEOS ApprovalURL
  71. @param pairingId The pairing ID for the risk component. Optional.
  72. @param clientID The app's Client ID, as obtained from developer.paypal.com
  73. @param environment `PayPalEnvironmentProduction`, `PayPalEnvironmentMock`, or `PayPalEnvironmentSandbox`;
  74. or else a stage indicated as `base-url:port`
  75. @param callbackURLScheme The URL scheme to be used for returning to this app, following an app-switch
  76. */
  77. + (nullable PPOTBillingAgreementRequest *)billingAgreementRequestWithApprovalURL:(nonnull NSURL *)approvalURL
  78. pairingId:(nullable NSString *)pairingId
  79. clientID:(nonnull NSString *)clientID
  80. environment:(nonnull NSString *)environment
  81. callbackURLScheme:(nonnull NSString *)callbackURLScheme;
  82. @end