ApplicationFee.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * @property string $id Unique identifier for the object.
  6. * @property string $object String representing the object's type. Objects of the same type share the same value.
  7. * @property string|\Stripe\Account $account ID of the Stripe account this fee was taken from.
  8. * @property int $amount Amount earned, in %s.
  9. * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the fee if a partial refund was issued)
  10. * @property string|\Stripe\StripeObject $application ID of the Connect application that earned the fee.
  11. * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).
  12. * @property string|\Stripe\Charge $charge ID of the charge that the application fee was taken from.
  13. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  14. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
  15. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
  16. * @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the <code>destination</code> parameter.
  17. * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.
  18. * @property \Stripe\Collection $refunds A list of refunds that have been applied to the fee.
  19. */
  20. class ApplicationFee extends ApiResource
  21. {
  22. const OBJECT_NAME = 'application_fee';
  23. use ApiOperations\All;
  24. use ApiOperations\NestedResource;
  25. use ApiOperations\Retrieve;
  26. const PATH_REFUNDS = '/refunds';
  27. /**
  28. * @param string $id the ID of the application fee on which to retrieve the fee refunds
  29. * @param null|array $params
  30. * @param null|array|string $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\Collection the list of fee refunds
  35. */
  36. public static function allRefunds($id, $params = null, $opts = null)
  37. {
  38. return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts);
  39. }
  40. /**
  41. * @param string $id the ID of the application fee on which to create the fee refund
  42. * @param null|array $params
  43. * @param null|array|string $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\ApplicationFeeRefund
  48. */
  49. public static function createRefund($id, $params = null, $opts = null)
  50. {
  51. return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts);
  52. }
  53. /**
  54. * @param string $id the ID of the application fee to which the fee refund belongs
  55. * @param string $refundId the ID of the fee refund to retrieve
  56. * @param null|array $params
  57. * @param null|array|string $opts
  58. *
  59. * @throws \Stripe\Exception\ApiErrorException if the request fails
  60. *
  61. * @return \Stripe\ApplicationFeeRefund
  62. */
  63. public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
  64. {
  65. return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
  66. }
  67. /**
  68. * @param string $id the ID of the application fee to which the fee refund belongs
  69. * @param string $refundId the ID of the fee refund to update
  70. * @param null|array $params
  71. * @param null|array|string $opts
  72. *
  73. * @throws \Stripe\Exception\ApiErrorException if the request fails
  74. *
  75. * @return \Stripe\ApplicationFeeRefund
  76. */
  77. public static function updateRefund($id, $refundId, $params = null, $opts = null)
  78. {
  79. return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
  80. }
  81. }