PaymentMethodDomainService.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class PaymentMethodDomainService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Lists the details of existing payment method domains.
  12. *
  13. * @param null|array $params
  14. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  15. *
  16. * @throws \Stripe\Exception\ApiErrorException if the request fails
  17. *
  18. * @return \Stripe\Collection<\Stripe\PaymentMethodDomain>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/payment_method_domains', $params, $opts);
  23. }
  24. /**
  25. * Creates a payment method domain.
  26. *
  27. * @param null|array $params
  28. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  29. *
  30. * @throws \Stripe\Exception\ApiErrorException if the request fails
  31. *
  32. * @return \Stripe\PaymentMethodDomain
  33. */
  34. public function create($params = null, $opts = null)
  35. {
  36. return $this->request('post', '/v1/payment_method_domains', $params, $opts);
  37. }
  38. /**
  39. * Retrieves the details of an existing payment method domain.
  40. *
  41. * @param string $id
  42. * @param null|array $params
  43. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\PaymentMethodDomain
  48. */
  49. public function retrieve($id, $params = null, $opts = null)
  50. {
  51. return $this->request('get', $this->buildPath('/v1/payment_method_domains/%s', $id), $params, $opts);
  52. }
  53. /**
  54. * Updates an existing payment method domain.
  55. *
  56. * @param string $id
  57. * @param null|array $params
  58. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  59. *
  60. * @throws \Stripe\Exception\ApiErrorException if the request fails
  61. *
  62. * @return \Stripe\PaymentMethodDomain
  63. */
  64. public function update($id, $params = null, $opts = null)
  65. {
  66. return $this->request('post', $this->buildPath('/v1/payment_method_domains/%s', $id), $params, $opts);
  67. }
  68. /**
  69. * Some payment methods such as Apple Pay require additional steps to verify a
  70. * domain. If the requirements weren’t satisfied when the domain was created, the
  71. * payment method will be inactive on the domain. The payment method doesn’t appear
  72. * in Elements for this domain until it is active.
  73. *
  74. * To activate a payment method on an existing payment method domain, complete the
  75. * required validation steps specific to the payment method, and then validate the
  76. * payment method domain with this endpoint.
  77. *
  78. * Related guides: <a
  79. * href="/docs/payments/payment-methods/pmd-registration">Payment method
  80. * domains</a>.
  81. *
  82. * @param string $id
  83. * @param null|array $params
  84. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  85. *
  86. * @throws \Stripe\Exception\ApiErrorException if the request fails
  87. *
  88. * @return \Stripe\PaymentMethodDomain
  89. */
  90. public function validate($id, $params = null, $opts = null)
  91. {
  92. return $this->request('post', $this->buildPath('/v1/payment_method_domains/%s/validate', $id), $params, $opts);
  93. }
  94. }