AuthorizationService.php 3.3 KB

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