Example #1
0
 /**
  * @return Stripe_Subscription The updated subscription.
  */
 public function deleteDiscount()
 {
     $requestor = new M2_Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/discount';
     list($response, $apiKey) = $requestor->request('delete', $url);
     $this->refreshFrom(array('discount' => null), $apiKey, true);
 }
Example #2
0
 /**
  * @param string|null $params
  *
  * @return Stripe_ApplicationFee The refunded application fee.
  */
 public function refund($params = null)
 {
     $requestor = new M2_Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/refund';
     list($response, $apiKey) = $requestor->request('post', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Example #3
0
 /**
  * @return Stripe_Invoice The paid invoice.
  */
 public function pay()
 {
     $requestor = new M2_Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/pay';
     list($response, $apiKey) = $requestor->request('post', $url);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Example #4
0
 public function retrieve($id, $params = null)
 {
     $requestor = new M2_Stripe_ApiRequestor($this->_apiKey);
     $base = $this['url'];
     $id = M2_Stripe_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$base}/{$extn}", $params);
     return M2_Stripe_Util::convertToStripeObject($response, $apiKey);
 }
Example #5
0
 protected function _scopedDelete($class, $params = null)
 {
     self::_validateCall('delete');
     $requestor = new M2_Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl();
     list($response, $apiKey) = $requestor->request('delete', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }