9 * @property string $object
10 * @property string $account
11 * @property int $amount
12 * @property int $amount_refunded
13 * @property string $application
14 * @property string $balance_transaction
15 * @property string $charge
16 * @property int $created
17 * @property string $currency
18 * @property bool $livemode
19 * @property string $originating_transaction
20 * @property bool $refunded
21 * @property Collection $refunds
25 class ApplicationFee
extends ApiResource
28 const OBJECT_NAME
= "application_fee";
30 use ApiOperations\All
;
31 use ApiOperations\NestedResource
;
32 use ApiOperations\Retrieve
;
34 const PATH_REFUNDS
= '/refunds';
37 * This is a special case because the application fee endpoint has an
38 * underscore in it. The parent `className` function strips underscores.
40 * @return string The name of the class.
42 public static function className()
44 return 'application_fee';
48 * @param array|null $params
49 * @param array|string|null $opts
51 * @return ApplicationFee The refunded application fee.
53 public function refund($params = null, $opts = null)
55 $this->refunds
->create($params, $opts);
61 * @param array|null $id The ID of the application fee on which to create the refund.
62 * @param array|null $params
63 * @param array|string|null $opts
65 * @return ApplicationFeeRefund
67 public static function createRefund($id, $params = null, $opts = null)
69 return self
::_createNestedResource($id, static::PATH_REFUNDS
, $params, $opts);
73 * @param array|null $id The ID of the application fee to which the refund belongs.
74 * @param array|null $refundId The ID of the refund to retrieve.
75 * @param array|null $params
76 * @param array|string|null $opts
78 * @return ApplicationFeeRefund
80 public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
82 return self
::_retrieveNestedResource($id, static::PATH_REFUNDS
, $refundId, $params, $opts);
86 * @param array|null $id The ID of the application fee to which the refund belongs.
87 * @param array|null $refundId The ID of the refund to update.
88 * @param array|null $params
89 * @param array|string|null $opts
91 * @return ApplicationFeeRefund
93 public static function updateRefund($id, $refundId, $params = null, $opts = null)
95 return self
::_updateNestedResource($id, static::PATH_REFUNDS
, $refundId, $params, $opts);
99 * @param array|null $id The ID of the application fee on which to retrieve the refunds.
100 * @param array|null $params
101 * @param array|string|null $opts
103 * @return ApplicationFeeRefund
105 public static function allRefunds($id, $params = null, $opts = null)
107 return self
::_allNestedResources($id, static::PATH_REFUNDS
, $params, $opts);