AuthorizationService.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Issuing;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class AuthorizationService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of Issuing <code>Authorization</code> objects. The objects are
  12. * sorted in descending order by creation date, with the most recently created
  13. * object appearing first.
  14. *
  15. * @param null|array $params
  16. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  17. *
  18. * @throws \Stripe\Exception\ApiErrorException if the request fails
  19. *
  20. * @return \Stripe\Collection<\Stripe\Issuing\Authorization>
  21. */
  22. public function all($params = null, $opts = null)
  23. {
  24. return $this->requestCollection('get', '/v1/issuing/authorizations', $params, $opts);
  25. }
  26. /**
  27. * [Deprecated] Approves a pending Issuing <code>Authorization</code> object. This
  28. * request should be made within the timeout window of the <a
  29. * href="/docs/issuing/controls/real-time-authorizations">real-time
  30. * authorization</a> flow. This method is deprecated. Instead, <a
  31. * href="/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
  32. * directly to the webhook request to approve an authorization</a>.
  33. *
  34. * @deprecated this method is deprecated, please refer to the description for details
  35. *
  36. * @param string $id
  37. * @param null|array $params
  38. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  39. *
  40. * @throws \Stripe\Exception\ApiErrorException if the request fails
  41. *
  42. * @return \Stripe\Issuing\Authorization
  43. */
  44. public function approve($id, $params = null, $opts = null)
  45. {
  46. return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/approve', $id), $params, $opts);
  47. }
  48. /**
  49. * [Deprecated] Declines a pending Issuing <code>Authorization</code> object. This
  50. * request should be made within the timeout window of the <a
  51. * href="/docs/issuing/controls/real-time-authorizations">real time
  52. * authorization</a> flow. This method is deprecated. Instead, <a
  53. * href="/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
  54. * directly to the webhook request to decline an authorization</a>.
  55. *
  56. * @deprecated this method is deprecated, please refer to the description for details
  57. *
  58. * @param string $id
  59. * @param null|array $params
  60. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  61. *
  62. * @throws \Stripe\Exception\ApiErrorException if the request fails
  63. *
  64. * @return \Stripe\Issuing\Authorization
  65. */
  66. public function decline($id, $params = null, $opts = null)
  67. {
  68. return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/decline', $id), $params, $opts);
  69. }
  70. /**
  71. * Retrieves an Issuing <code>Authorization</code> object.
  72. *
  73. * @param string $id
  74. * @param null|array $params
  75. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  76. *
  77. * @throws \Stripe\Exception\ApiErrorException if the request fails
  78. *
  79. * @return \Stripe\Issuing\Authorization
  80. */
  81. public function retrieve($id, $params = null, $opts = null)
  82. {
  83. return $this->request('get', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts);
  84. }
  85. /**
  86. * Updates the specified Issuing <code>Authorization</code> object by setting the
  87. * values of the parameters passed. Any parameters not provided will be left
  88. * unchanged.
  89. *
  90. * @param string $id
  91. * @param null|array $params
  92. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  93. *
  94. * @throws \Stripe\Exception\ApiErrorException if the request fails
  95. *
  96. * @return \Stripe\Issuing\Authorization
  97. */
  98. public function update($id, $params = null, $opts = null)
  99. {
  100. return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts);
  101. }
  102. }