Gateway.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <?php
  2. namespace Braintree;
  3. /**
  4. * Braintree Gateway module
  5. *
  6. * @package Braintree
  7. * @category Resources
  8. */
  9. class Gateway
  10. {
  11. /**
  12. *
  13. * @var Configuration
  14. */
  15. public $config;
  16. public function __construct($config)
  17. {
  18. if (is_array($config)) {
  19. $config = new Configuration($config);
  20. }
  21. $this->config = $config;
  22. }
  23. /**
  24. *
  25. * @return AddOnGateway
  26. */
  27. public function addOn()
  28. {
  29. return new AddOnGateway($this);
  30. }
  31. /**
  32. *
  33. * @return AddressGateway
  34. */
  35. public function address()
  36. {
  37. return new AddressGateway($this);
  38. }
  39. /**
  40. *
  41. * @return ApplePayGateway
  42. */
  43. public function applePay()
  44. {
  45. return new ApplePayGateway($this);
  46. }
  47. /**
  48. *
  49. * @return ClientTokenGateway
  50. */
  51. public function clientToken()
  52. {
  53. return new ClientTokenGateway($this);
  54. }
  55. /**
  56. *
  57. * @return CreditCardGateway
  58. */
  59. public function creditCard()
  60. {
  61. return new CreditCardGateway($this);
  62. }
  63. /**
  64. *
  65. * @return CreditCardVerificationGateway
  66. */
  67. public function creditCardVerification()
  68. {
  69. return new CreditCardVerificationGateway($this);
  70. }
  71. /**
  72. *
  73. * @return CustomerGateway
  74. */
  75. public function customer()
  76. {
  77. return new CustomerGateway($this);
  78. }
  79. /**
  80. *
  81. * @return DiscountGateway
  82. */
  83. public function discount()
  84. {
  85. return new DiscountGateway($this);
  86. }
  87. /**
  88. *
  89. * @return DisputeGateway
  90. */
  91. public function dispute()
  92. {
  93. return new DisputeGateway($this);
  94. }
  95. /**
  96. *
  97. * @return DocumentUploadGateway
  98. */
  99. public function documentUpload()
  100. {
  101. return new DocumentUploadGateway($this);
  102. }
  103. /**
  104. *
  105. * @return MerchantGateway
  106. */
  107. public function merchant()
  108. {
  109. return new MerchantGateway($this);
  110. }
  111. /**
  112. *
  113. * @return MerchantAccountGateway
  114. */
  115. public function merchantAccount()
  116. {
  117. return new MerchantAccountGateway($this);
  118. }
  119. /**
  120. *
  121. * @return OAuthGateway
  122. */
  123. public function oauth()
  124. {
  125. return new OAuthGateway($this);
  126. }
  127. /**
  128. *
  129. * @return PaymentMethodGateway
  130. */
  131. public function paymentMethod()
  132. {
  133. return new PaymentMethodGateway($this);
  134. }
  135. /**
  136. *
  137. * @return PaymentMethodNonceGateway
  138. */
  139. public function paymentMethodNonce()
  140. {
  141. return new PaymentMethodNonceGateway($this);
  142. }
  143. /**
  144. *
  145. * @return PayPalAccountGateway
  146. */
  147. public function payPalAccount()
  148. {
  149. return new PayPalAccountGateway($this);
  150. }
  151. /**
  152. *
  153. * @return PlanGateway
  154. */
  155. public function plan()
  156. {
  157. return new PlanGateway($this);
  158. }
  159. /**
  160. *
  161. * @return SettlementBatchSummaryGateway
  162. */
  163. public function settlementBatchSummary()
  164. {
  165. return new SettlementBatchSummaryGateway($this);
  166. }
  167. /**
  168. *
  169. * @return SubscriptionGateway
  170. */
  171. public function subscription()
  172. {
  173. return new SubscriptionGateway($this);
  174. }
  175. /**
  176. *
  177. * @return TestingGateway
  178. */
  179. public function testing()
  180. {
  181. return new TestingGateway($this);
  182. }
  183. /**
  184. *
  185. * @return TransactionGateway
  186. */
  187. public function transaction()
  188. {
  189. return new TransactionGateway($this);
  190. }
  191. /**
  192. *
  193. * @return TransactionLineItemGateway
  194. */
  195. public function transactionLineItem()
  196. {
  197. return new TransactionLineItemGateway($this);
  198. }
  199. /**
  200. *
  201. * @return TransparentRedirectGateway
  202. */
  203. public function transparentRedirect()
  204. {
  205. return new TransparentRedirectGateway($this);
  206. }
  207. /**
  208. *
  209. * @return UsBankAccountGateway
  210. */
  211. public function usBankAccount()
  212. {
  213. return new UsBankAccountGateway($this);
  214. }
  215. /**
  216. *
  217. * @return UsBankAccountVerificationGateway
  218. */
  219. public function usBankAccountVerification()
  220. {
  221. return new UsBankAccountVerificationGateway($this);
  222. }
  223. /**
  224. *
  225. * @return IdealPaymentGateway
  226. */
  227. public function idealPayment()
  228. {
  229. return new IdealPaymentGateway($this);
  230. }
  231. /**
  232. *
  233. * @return WebhookNotificationGateway
  234. */
  235. public function webhookNotification()
  236. {
  237. return new WebhookNotificationGateway($this);
  238. }
  239. /**
  240. *
  241. * @return WebhookTestingGateway
  242. */
  243. public function webhookTesting()
  244. {
  245. return new WebhookTestingGateway($this);
  246. }
  247. }
  248. class_alias('Braintree\Gateway', 'Braintree_Gateway');