ApplicationFee.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace Stripe;
  3. /**
  4. * Class ApplicationFee
  5. *
  6. * @package Stripe
  7. */
  8. class ApplicationFee extends ApiResource
  9. {
  10. /**
  11. * This is a special case because the application fee endpoint has an
  12. * underscore in it. The parent `className` function strips underscores.
  13. *
  14. * @return string The name of the class.
  15. */
  16. public static function className()
  17. {
  18. return 'application_fee';
  19. }
  20. /**
  21. * @param string $id The ID of the application fee to retrieve.
  22. * @param array|string|null $opts
  23. *
  24. * @return ApplicationFee
  25. */
  26. public static function retrieve($id, $opts = null)
  27. {
  28. return self::_retrieve($id, $opts);
  29. }
  30. /**
  31. * @param string $id The ID of the application fee to update.
  32. * @param array|null $params
  33. * @param array|string|null $options
  34. *
  35. * @return ApplicationFee The updated application fee.
  36. */
  37. public static function update($id, $params = null, $options = null)
  38. {
  39. return self::_update($id, $params, $options);
  40. }
  41. /**
  42. * @param array|null $params
  43. * @param array|string|null $opts
  44. *
  45. * @return Collection of ApplicationFees
  46. */
  47. public static function all($params = null, $opts = null)
  48. {
  49. return self::_all($params, $opts);
  50. }
  51. /**
  52. * @param array|null $params
  53. * @param array|string|null $opts
  54. *
  55. * @return ApplicationFee The refunded application fee.
  56. */
  57. public function refund($params = null, $opts = null)
  58. {
  59. $this->refunds->create($params, $opts);
  60. $this->refresh();
  61. return $this;
  62. }
  63. }