ApplicationFeeRefund.php 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Stripe;
  3. /**
  4. * Class ApplicationFeeRefund
  5. *
  6. * @package Stripe
  7. */
  8. class ApplicationFeeRefund extends ApiResource
  9. {
  10. /**
  11. * @return string The API URL for this Stripe refund.
  12. */
  13. public function instanceUrl()
  14. {
  15. $id = $this['id'];
  16. $fee = $this['fee'];
  17. if (!$id) {
  18. throw new Error\InvalidRequest(
  19. "Could not determine which URL to request: " .
  20. "class instance has invalid ID: $id",
  21. null
  22. );
  23. }
  24. $id = Util\Util::utf8($id);
  25. $fee = Util\Util::utf8($fee);
  26. $base = ApplicationFee::classUrl();
  27. $feeExtn = urlencode($fee);
  28. $extn = urlencode($id);
  29. return "$base/$feeExtn/refunds/$extn";
  30. }
  31. /**
  32. * @param array|string|null $opts
  33. *
  34. * @return ApplicationFeeRefund The saved refund.
  35. */
  36. public function save($opts = null)
  37. {
  38. return $this->_save($opts);
  39. }
  40. }