Authorization.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace Stripe\Issuing;
  3. /**
  4. * Class Authorization
  5. *
  6. * @property string $id
  7. * @property string $object
  8. * @property bool $approved
  9. * @property string $authorization_method
  10. * @property int $authorized_amount
  11. * @property string $authorized_currency
  12. * @property \Stripe\Collection $balance_transactions
  13. * @property Card $card
  14. * @property Cardholder $cardholder
  15. * @property int $created
  16. * @property int $held_amount
  17. * @property string $held_currency
  18. * @property bool $is_held_amount_controllable
  19. * @property bool $livemode
  20. * @property mixed $merchant_data
  21. * @property \Stripe\StripeObject $metadata
  22. * @property int $pending_authorized_amount
  23. * @property int $pending_held_amount
  24. * @property mixed $request_history
  25. * @property string $status
  26. * @property mixed $request_history
  27. * @property \Stripe\Collection $transactions
  28. * @property mixed $verification_data
  29. *
  30. * @package Stripe\Issuing
  31. */
  32. class Authorization extends \Stripe\ApiResource
  33. {
  34. const OBJECT_NAME = "issuing.authorization";
  35. use \Stripe\ApiOperations\All;
  36. use \Stripe\ApiOperations\Retrieve;
  37. use \Stripe\ApiOperations\Update;
  38. /**
  39. * @param array|null $params
  40. * @param array|string|null $options
  41. *
  42. * @return Authorization The approved authorization.
  43. */
  44. public function approve($params = null, $options = null)
  45. {
  46. $url = $this->instanceUrl() . '/approve';
  47. list($response, $opts) = $this->_request('post', $url, $params, $options);
  48. $this->refreshFrom($response, $opts);
  49. return $this;
  50. }
  51. /**
  52. * @param array|null $params
  53. * @param array|string|null $options
  54. *
  55. * @return Authorization The declined authorization.
  56. */
  57. public function decline($params = null, $options = null)
  58. {
  59. $url = $this->instanceUrl() . '/decline';
  60. list($response, $opts) = $this->_request('post', $url, $params, $options);
  61. $this->refreshFrom($response, $opts);
  62. return $this;
  63. }
  64. }