PPPStripeInvoice

Class Invoice.

Defined (1)

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

/includes/api/stripe-php/lib/Invoice.php  
  1. class Invoice extends ApiResource 
  2. /** 
  3. * @param array|null $params 
  4. * @param array|string|null $opts 
  5. * @return Invoice The created invoice. 
  6. */ 
  7. public static function create($params = null, $opts = null) 
  8. return self::_create($params, $opts); 
  9.  
  10. /** 
  11. * @param string $id The ID of the invoice to retrieve. 
  12. * @param array|string|null $opts 
  13. * @return Invoice 
  14. */ 
  15. public static function retrieve($id, $opts = null) 
  16. return self::_retrieve($id, $opts); 
  17.  
  18. /** 
  19. * @param array|null $params 
  20. * @param array|string|null $opts 
  21. * @return Collection of Invoices 
  22. */ 
  23. public static function all($params = null, $opts = null) 
  24. return self::_all($params, $opts); 
  25.  
  26. /** 
  27. * @param string $id The ID of the invoice to update. 
  28. * @param array|null $params 
  29. * @param array|string|null $options 
  30. * @return Invoice The updated invoice. 
  31. */ 
  32. public static function update($id, $params = null, $options = null) 
  33. return self::_update($id, $params, $options); 
  34.  
  35. /** 
  36. * @param array|null $params 
  37. * @param array|string|null $opts 
  38. * @return Invoice The upcoming invoice. 
  39. */ 
  40. public static function upcoming($params = null, $opts = null) 
  41. $url = static::classUrl() . '/upcoming'; 
  42. list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); 
  43. $obj = Util\Util::convertToStripeObject($response->json, $opts); 
  44. $obj->setLastResponse($response); 
  45. return $obj; 
  46.  
  47. /** 
  48. * @param array|string|null $opts 
  49. * @return Invoice The saved invoice. 
  50. */ 
  51. public function save($opts = null) 
  52. return $this->_save($opts); 
  53.  
  54. /** 
  55. * @return Invoice The paid invoice. 
  56. */ 
  57. public function pay($opts = null) 
  58. $url = $this->instanceUrl() . '/pay'; 
  59. list($response, $opts) = $this->_request('post', $url, null, $opts); 
  60. $this->refreshFrom($response, $opts); 
  61. return $this;