Card.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. class ChargeBee_Card extends ChargeBee_Model
  3. {
  4. protected $allowed = array('paymentSourceId', 'status', 'gateway', 'gatewayAccountId', 'firstName', 'lastName',
  5. 'iin', 'last4', 'cardType', 'fundingType', 'expiryMonth', 'expiryYear', 'issuingCountry', 'billingAddr1','billingAddr2', 'billingCity', 'billingStateCode', 'billingState', 'billingCountry', 'billingZip','ipAddress', 'customerId', '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 switchGatewayForCustomer($id, $params, $env = null, $headers = array())
  17. {
  18. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"switch_gateway"), $params, $env, $headers);
  19. }
  20. public static function copyCardForCustomer($id, $params, $env = null, $headers = array())
  21. {
  22. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"copy_card"), $params, $env, $headers);
  23. }
  24. public static function deleteCardForCustomer($id, $env = null, $headers = array())
  25. {
  26. return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"delete_card"), array(), $env, $headers);
  27. }
  28. }
  29. ?>