ConfigurationService.php 2.3 KB

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