Customer.php 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. class ChargeBee_Customer extends ChargeBee_Model
  3. {
  4. protected $allowed = array('id', 'firstName', 'lastName', 'email', 'phone', 'company', 'vatNumber', 'autoCollection',
  5. 'netTermDays', 'allowDirectDebit', 'createdAt', 'createdFromIp', 'taxability', 'entityCode','exemptNumber', 'resourceVersion', 'updatedAt', 'locale', 'cardStatus', 'fraudFlag', 'billingAddress','contacts', 'paymentMethod', 'invoiceNotes', 'preferredCurrencyCode', 'promotionalCredits','refundableCredits', 'excessPayments', 'metaData', 'deleted');
  6. # OPERATIONS
  7. #-----------
  8. public static function create($params = array(), $env = null, $headers = array())
  9. {
  10. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers"), $params, $env, $headers);
  11. }
  12. public static function all($params = array(), $env = null, $headers = array())
  13. {
  14. return ChargeBee_Request::sendListRequest(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("customers"), $params, $env, $headers);
  15. }
  16. public static function retrieve($id, $env = null, $headers = array())
  17. {
  18. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("customers",$id), array(), $env, $headers);
  19. }
  20. public static function update($id, $params = array(), $env = null, $headers = array())
  21. {
  22. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id), $params, $env, $headers);
  23. }
  24. public static function updatePaymentMethod($id, $params, $env = null, $headers = array())
  25. {
  26. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"update_payment_method"), $params, $env, $headers);
  27. }
  28. public static function updateBillingInfo($id, $params = array(), $env = null, $headers = array())
  29. {
  30. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"update_billing_info"), $params, $env, $headers);
  31. }
  32. public static function addContact($id, $params, $env = null, $headers = array())
  33. {
  34. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"add_contact"), $params, $env, $headers);
  35. }
  36. public static function updateContact($id, $params, $env = null, $headers = array())
  37. {
  38. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"update_contact"), $params, $env, $headers);
  39. }
  40. public static function deleteContact($id, $params, $env = null, $headers = array())
  41. {
  42. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"delete_contact"), $params, $env, $headers);
  43. }
  44. public static function addPromotionalCredits($id, $params, $env = null, $headers = array())
  45. {
  46. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"add_promotional_credits"), $params, $env, $headers);
  47. }
  48. public static function deductPromotionalCredits($id, $params, $env = null, $headers = array())
  49. {
  50. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"deduct_promotional_credits"), $params, $env, $headers);
  51. }
  52. public static function setPromotionalCredits($id, $params, $env = null, $headers = array())
  53. {
  54. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"set_promotional_credits"), $params, $env, $headers);
  55. }
  56. public static function recordExcessPayment($id, $params, $env = null, $headers = array())
  57. {
  58. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"record_excess_payment"), $params, $env, $headers);
  59. }
  60. public static function delete($id, $params = array(), $env = null, $headers = array())
  61. {
  62. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"delete"), $params, $env, $headers);
  63. }
  64. }
  65. ?>