Card.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class ChargeBee_Card extends ChargeBee_Model
  3. {
  4. protected $allowed = array('customerId', 'status', 'gateway', 'firstName', 'lastName', 'iin', 'last4', 'cardType',
  5. 'expiryMonth', 'expiryYear', 'billingAddr1', 'billingAddr2', 'billingCity', 'billingStateCode','billingState', 'billingCountry', 'billingZip', 'ipAddress', 'maskedNumber');
  6. # OPERATIONS
  7. #-----------
  8. public static function retrieve($id, $env = null, $headers = array())
  9. {
  10. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("cards",$id), array(), $env, $headers);
  11. }
  12. public static function updateCardForCustomer($id, $params, $env = null, $headers = array())
  13. {
  14. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"credit_card"), $params, $env, $headers);
  15. }
  16. public static function deleteCardForCustomer($id, $env = null, $headers = array())
  17. {
  18. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"delete_card"), array(), $env, $headers);
  19. }
  20. }
  21. ?>