PPPStripeOrder

Class Order.

Defined (1)

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

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