M2_Stripe_Invoice

The Membership 2 M2 Stripe Invoice class.

Defined (1)

The class is defined in the following location(s).

/lib/stripe-php/lib/Stripe/Invoice.php  
  1. class M2_Stripe_Invoice extends M2_Stripe_ApiResource 
  2. /** 
  3. * @param array|null $params 
  4. * @param string|null $apiKey 
  5. * @return Stripe_Invoice The created invoice. 
  6. */ 
  7. public static function create($params=null, $apiKey=null) 
  8. $class = get_class(); 
  9. return self::_scopedCreate($class, $params, $apiKey); 
  10.  
  11. /** 
  12. * @param string $id The ID of the invoice to retrieve. 
  13. * @param string|null $apiKey 
  14. * @return Stripe_Invoice 
  15. */ 
  16. public static function retrieve($id, $apiKey=null) 
  17. $class = get_class(); 
  18. return self::_scopedRetrieve($class, $id, $apiKey); 
  19.  
  20. /** 
  21. * @param array|null $params 
  22. * @param string|null $apiKey 
  23. * @return array An array of Stripe_Invoices. 
  24. */ 
  25. public static function all($params=null, $apiKey=null) 
  26. $class = get_class(); 
  27. return self::_scopedAll($class, $params, $apiKey); 
  28.  
  29. /** 
  30. * @param array|null $params 
  31. * @param string|null $apiKey 
  32. * @return Stripe_Invoice The upcoming invoice. 
  33. */ 
  34. public static function upcoming($params=null, $apiKey=null) 
  35. $requestor = new M2_Stripe_ApiRequestor($apiKey); 
  36. $url = self::classUrl(get_class()) . '/upcoming'; 
  37. list($response, $apiKey) = $requestor->request('get', $url, $params); 
  38. return M2_Stripe_Util::convertToStripeObject($response, $apiKey); 
  39.  
  40. /** 
  41. * @return Stripe_Invoice The saved invoice. 
  42. */ 
  43. public function save() 
  44. $class = get_class(); 
  45. return self::_scopedSave($class); 
  46.  
  47. /** 
  48. * @return Stripe_Invoice The paid invoice. 
  49. */ 
  50. public function pay() 
  51. $requestor = new M2_Stripe_ApiRequestor($this->_apiKey); 
  52. $url = $this->instanceUrl() . '/pay'; 
  53. list($response, $apiKey) = $requestor->request('post', $url); 
  54. $this->refreshFrom($response, $apiKey); 
  55. return $this;