ApplicationFeeRefund.php 917 B

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