BTLocalPaymentRequest.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #import <Foundation/Foundation.h>
  2. #if __has_include("BraintreeCore.h")
  3. #import "BraintreeCore.h"
  4. #else
  5. #import <BraintreeCore/BraintreeCore.h>
  6. #endif
  7. #import "BTPaymentFlowRequest.h"
  8. #import "BTPaymentFlowDriver.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. @class BTLocalPaymentResult;
  11. @protocol BTLocalPaymentRequestDelegate;
  12. /**
  13. Used to initialize a local payment flow
  14. */
  15. @interface BTLocalPaymentRequest : BTPaymentFlowRequest <BTPaymentFlowRequestDelegate>
  16. /**
  17. The type of payment.
  18. */
  19. @property (nonatomic, nullable, copy) NSString *paymentType;
  20. /**
  21. The country code of the local payment.
  22. This value must be one of the supported country codes for a given local payment type listed at the link below. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.
  23. https://developers.braintreepayments.com/guides/local-payment-methods/client-side-custom/ios/v4#invoke-payment-flow
  24. */
  25. @property (nonatomic, nullable, copy) NSString *paymentTypeCountryCode;
  26. /**
  27. Optional: A non-default merchant account to use for tokenization.
  28. */
  29. @property (nonatomic, nullable, copy) NSString *merchantAccountId;
  30. /**
  31. Optional: The address of the customer. An error will occur if this address is not valid.
  32. */
  33. @property (nonatomic, nullable, copy) BTPostalAddress *address;
  34. /**
  35. The amount for the transaction.
  36. */
  37. @property (nonatomic, nullable, copy) NSString *amount;
  38. /**
  39. Optional: A valid ISO currency code to use for the transaction. Defaults to merchant currency code if not set.
  40. */
  41. @property (nonatomic, nullable, copy) NSString *currencyCode;
  42. /**
  43. Optional: Payer email of the customer.
  44. */
  45. @property (nonatomic, nullable, copy) NSString *email;
  46. /**
  47. Optional: Given (first) name of the customer.
  48. */
  49. @property (nonatomic, nullable, copy) NSString *givenName;
  50. /**
  51. Optional: Surname (last name) of the customer.
  52. */
  53. @property (nonatomic, nullable, copy) NSString *surname;
  54. /**
  55. Optional: Phone number of the customer.
  56. */
  57. @property (nonatomic, nullable, copy) NSString *phone;
  58. /**
  59. Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.
  60. */
  61. @property (nonatomic, getter=isShippingAddressRequired) BOOL shippingAddressRequired;
  62. /**
  63. A delegate for receiving information about the local payment flow.
  64. */
  65. @property (nonatomic, nullable, weak) id<BTLocalPaymentRequestDelegate> localPaymentFlowDelegate;
  66. @end
  67. /**
  68. Protocol for local payment flow
  69. */
  70. @protocol BTLocalPaymentRequestDelegate
  71. @required
  72. /**
  73. Required delegate method which returns the payment ID before the flow starts.
  74. Use this to do any preprocessing and setup for webhooks. Use the `start()` callback to continue the flow.
  75. */
  76. - (void)localPaymentStarted:(BTLocalPaymentRequest *)request paymentId:(NSString *)paymentId start:(void(^)(void))start;;
  77. @end
  78. NS_ASSUME_NONNULL_END