ConfigurationService.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\BillingPortal;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class ConfigurationService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of configurations that describe the functionality of the customer
  12. * portal.
  13. *
  14. * @param null|array $params
  15. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  16. *
  17. * @throws \Stripe\Exception\ApiErrorException if the request fails
  18. *
  19. * @return \Stripe\Collection<\Stripe\BillingPortal\Configuration>
  20. */
  21. public function all($params = null, $opts = null)
  22. {
  23. return $this->requestCollection('get', '/v1/billing_portal/configurations', $params, $opts);
  24. }
  25. /**
  26. * Creates a configuration that describes the functionality and behavior of a
  27. * PortalSession.
  28. *
  29. * @param null|array $params
  30. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\BillingPortal\Configuration
  35. */
  36. public function create($params = null, $opts = null)
  37. {
  38. return $this->request('post', '/v1/billing_portal/configurations', $params, $opts);
  39. }
  40. /**
  41. * Retrieves a configuration that describes the functionality of the customer
  42. * portal.
  43. *
  44. * @param string $id
  45. * @param null|array $params
  46. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  47. *
  48. * @throws \Stripe\Exception\ApiErrorException if the request fails
  49. *
  50. * @return \Stripe\BillingPortal\Configuration
  51. */
  52. public function retrieve($id, $params = null, $opts = null)
  53. {
  54. return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts);
  55. }
  56. /**
  57. * Updates a configuration that describes the functionality of the customer portal.
  58. *
  59. * @param string $id
  60. * @param null|array $params
  61. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  62. *
  63. * @throws \Stripe\Exception\ApiErrorException if the request fails
  64. *
  65. * @return \Stripe\BillingPortal\Configuration
  66. */
  67. public function update($id, $params = null, $opts = null)
  68. {
  69. return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts);
  70. }
  71. }