HostedPage.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. class ChargeBee_HostedPage extends ChargeBee_Model
  3. {
  4. protected $allowed = array('id', 'type', 'url', 'state', 'failureReason', 'passThruContent', 'embed', 'createdAt',
  5. 'expiresAt', 'updatedAt', 'resourceVersion', 'checkoutInfo');
  6. public function content()
  7. {
  8. if(isset($this->_values['content']))
  9. {
  10. return new ChargeBee_Content($this->_values['content']);
  11. }
  12. return null;
  13. }
  14. # OPERATIONS
  15. #-----------
  16. public static function checkoutNew($params, $env = null, $headers = array())
  17. {
  18. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","checkout_new"), $params, $env, $headers);
  19. }
  20. public static function checkoutExisting($params, $env = null, $headers = array())
  21. {
  22. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","checkout_existing"), $params, $env, $headers);
  23. }
  24. public static function updateCard($params, $env = null, $headers = array())
  25. {
  26. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","update_card"), $params, $env, $headers);
  27. }
  28. public static function updatePaymentMethod($params, $env = null, $headers = array())
  29. {
  30. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","update_payment_method"), $params, $env, $headers);
  31. }
  32. public static function managePaymentSources($params, $env = null, $headers = array())
  33. {
  34. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","manage_payment_sources"), $params, $env, $headers);
  35. }
  36. public static function collectNow($params, $env = null, $headers = array())
  37. {
  38. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","collect_now"), $params, $env, $headers);
  39. }
  40. public static function retrieveAgreementPdf($params, $env = null, $headers = array())
  41. {
  42. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages","retrieve_agreement_pdf"), $params, $env, $headers);
  43. }
  44. public static function acknowledge($id, $env = null, $headers = array())
  45. {
  46. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("hosted_pages",$id,"acknowledge"), array(), $env, $headers);
  47. }
  48. public static function retrieve($id, $env = null, $headers = array())
  49. {
  50. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("hosted_pages",$id), array(), $env, $headers);
  51. }
  52. public static function all($params = array(), $env = null, $headers = array())
  53. {
  54. return ChargeBee_Request::sendListRequest(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("hosted_pages"), $params, $env, $headers);
  55. }
  56. }
  57. ?>