PaymentLinkService.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  4. class PaymentLinkService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of your payment links.
  8. *
  9. * @param null|array $params
  10. * @param null|array|\Stripe\Util\RequestOptions $opts
  11. *
  12. * @throws \Stripe\Exception\ApiErrorException if the request fails
  13. *
  14. * @return \Stripe\Collection<\Stripe\PaymentLink>
  15. */
  16. public function all($params = null, $opts = null)
  17. {
  18. return $this->requestCollection('get', '/v1/payment_links', $params, $opts);
  19. }
  20. /**
  21. * When retrieving a payment link, there is an includable
  22. * <strong>line_items</strong> property containing the first handful of those
  23. * items. There is also a URL where you can retrieve the full (paginated) list of
  24. * line items.
  25. *
  26. * @param string $id
  27. * @param null|array $params
  28. * @param null|array|\Stripe\Util\RequestOptions $opts
  29. *
  30. * @throws \Stripe\Exception\ApiErrorException if the request fails
  31. *
  32. * @return \Stripe\Collection<\Stripe\PaymentLink>
  33. */
  34. public function allLineItems($id, $params = null, $opts = null)
  35. {
  36. return $this->requestCollection('get', $this->buildPath('/v1/payment_links/%s/line_items', $id), $params, $opts);
  37. }
  38. /**
  39. * Creates a payment link.
  40. *
  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\PaymentLink
  47. */
  48. public function create($params = null, $opts = null)
  49. {
  50. return $this->request('post', '/v1/payment_links', $params, $opts);
  51. }
  52. /**
  53. * Retrieve a payment link.
  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\PaymentLink
  62. */
  63. public function retrieve($id, $params = null, $opts = null)
  64. {
  65. return $this->request('get', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts);
  66. }
  67. /**
  68. * Updates a payment link.
  69. *
  70. * @param string $id
  71. * @param null|array $params
  72. * @param null|array|\Stripe\Util\RequestOptions $opts
  73. *
  74. * @throws \Stripe\Exception\ApiErrorException if the request fails
  75. *
  76. * @return \Stripe\PaymentLink
  77. */
  78. public function update($id, $params = null, $opts = null)
  79. {
  80. return $this->request('post', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts);
  81. }
  82. }