ApplicationFeeRefund.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * <code>Application Fee Refund</code> objects allow you to refund an application fee that
  6. * has previously been created but not yet refunded. Funds will be refunded to
  7. * the Stripe account from which the fee was originally collected.
  8. *
  9. * Related guide: <a href="https://stripe.com/docs/connect/destination-charges#refunding-app-fee">Refunding application fees</a>
  10. *
  11. * @property string $id Unique identifier for the object.
  12. * @property string $object String representing the object's type. Objects of the same type share the same value.
  13. * @property int $amount Amount, in cents (or local equivalent).
  14. * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance.
  15. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  16. * @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>.
  17. * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded.
  18. * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  19. */
  20. class ApplicationFeeRefund extends ApiResource
  21. {
  22. const OBJECT_NAME = 'fee_refund';
  23. use ApiOperations\Update {
  24. save as protected _save;
  25. }
  26. /**
  27. * @return string the API URL for this Stripe refund
  28. */
  29. public function instanceUrl()
  30. {
  31. $id = $this['id'];
  32. $fee = $this['fee'];
  33. if (!$id) {
  34. throw new Exception\UnexpectedValueException(
  35. 'Could not determine which URL to request: ' .
  36. "class instance has invalid ID: {$id}",
  37. null
  38. );
  39. }
  40. $id = Util\Util::utf8($id);
  41. $fee = Util\Util::utf8($fee);
  42. $base = ApplicationFee::classUrl();
  43. $feeExtn = \urlencode($fee);
  44. $extn = \urlencode($id);
  45. return "{$base}/{$feeExtn}/refunds/{$extn}";
  46. }
  47. /**
  48. * @param null|array|string $opts
  49. *
  50. * @return ApplicationFeeRefund the saved refund
  51. */
  52. public function save($opts = null)
  53. {
  54. return $this->_save($opts);
  55. }
  56. }