ApplicationFeeRefund.php 2.4 KB

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