Ejemplo n.º 1
0
 public static function upcoming($params = null, $apiKey = null)
 {
     $requestor = new Stripe_ApiRequestor($apiKey);
     $url = self::classUrl(get_class()) . '/upcoming';
     list($response, $apiKey) = $requestor->request('get', $url, $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }
Ejemplo n.º 2
0
 /**
  * @return Stripe_Subscription The updated subscription.
  */
 public function deleteDiscount()
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/discount';
     list($response, $apiKey) = $requestor->request('delete', $url);
     $this->refreshFrom(array('discount' => null), $apiKey, true);
 }
Ejemplo n.º 3
0
 public function transactions($params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/transactions';
     list($response, $apiKey) = $requestor->request('get', $url, $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }
Ejemplo n.º 4
0
 public function updateDispute($params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/dispute';
     list($response, $apiKey) = $requestor->request('post', $url, $params);
     $this->refreshFrom(array('dispute' => $response), $apiKey, true);
     return $this->dispute;
 }
 public function closeDispute()
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/dispute/close';
     list($response, $apiKey) = $requestor->request('post', $url);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Ejemplo n.º 6
0
 public function capture($params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/capture';
     list($response, $apiKey) = $requestor->request('post', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Ejemplo n.º 7
0
 public function cancelSubscription($params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/subscription';
     list($response, $apiKey) = $requestor->request('delete', $url, $params);
     $this->refreshFrom(array('subscription' => $response), $apiKey, true);
     return $this->subscription;
 }
Ejemplo n.º 8
0
 public function retrieve($id, $params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $base = $this['url'];
     $id = Stripe_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$base}/{$extn}", $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }
Ejemplo n.º 9
0
 public function retrieve($id, $params = null)
 {
     list($url, $params) = $this->extractPathAndUpdateParams($params);
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $id = Stripe_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$url}/{$extn}", $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }
Ejemplo n.º 10
0
 public function markAsSafe()
 {
     $params = array('fraud_details' => array('user_report' => 'safe'));
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl();
     list($response, $apiKey) = $requestor->request('post', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Ejemplo n.º 11
0
 protected function _scopedDelete($class, $params = null, $options = null)
 {
     self::_validateCall('delete', $params, $options);
     $opts = Stripe_RequestOptions::parse($options);
     $key = $opts->apiKey ? $opts->apiKey : $this->_apiKey;
     $requestor = new Stripe_ApiRequestor($key, self::baseUrl());
     $url = $this->instanceUrl();
     list($response, $apiKey) = $requestor->request('delete', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Ejemplo n.º 12
0
 protected function _scopedDelete($class, $params = null)
 {
     self::_validateCall('delete');
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl();
     list($response, $apiKey) = $requestor->request('delete', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
Ejemplo n.º 13
0
 public function all($params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     list($response, $apiKey) = $requestor->request('get', $this['url'], $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }