[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/stripe-php/lib/Stripe/ -> Refund.php (source)

   1  <?php
   2  
   3  class Stripe_Refund extends Stripe_ApiResource
   4  {
   5    /**
   6     * @return string The API URL for this Stripe refund.
   7     */
   8    public function instanceUrl()
   9    {
  10      $id = $this['id'];
  11      $charge = $this['charge'];
  12      if (!$id) {
  13        throw new Stripe_InvalidRequestError(
  14            "Could not determine which URL to request: " .
  15            "class instance has invalid ID: $id",
  16            null
  17        );
  18      }
  19      $id = Stripe_ApiRequestor::utf8($id);
  20      $charge = Stripe_ApiRequestor::utf8($charge);
  21  
  22      $base = self::classUrl('Stripe_Charge');
  23      $chargeExtn = urlencode($charge);
  24      $extn = urlencode($id);
  25      return "$base/$chargeExtn/refunds/$extn";
  26    }
  27  
  28    /**
  29     * @return Stripe_Refund The saved refund.
  30     */
  31    public function save()
  32    {
  33      $class = get_class();
  34      return self::_scopedSave($class);
  35    }
  36  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1