Transaction.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. class ChargeBee_Transaction extends ChargeBee_Model
  3. {
  4. protected $allowed = array('id', 'customerId', 'subscriptionId', 'paymentMethod', 'referenceNumber', 'gateway',
  5. 'type', 'date', 'amount', 'idAtGateway', 'status', 'errorCode', 'errorText', 'voidedAt', 'amountUnused','maskedCardNumber', 'referenceTransactionId', 'refundedTxnId', 'reversalTransactionId', 'linkedInvoices','linkedCreditNotes', 'linkedRefunds', 'currencyCode');
  6. # OPERATIONS
  7. #-----------
  8. public static function all($params = array(), $env = null, $headers = array())
  9. {
  10. return ChargeBee_Request::sendListRequest(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("transactions"), $params, $env, $headers);
  11. }
  12. public static function transactionsForCustomer($id, $params = array(), $env = null, $headers = array())
  13. {
  14. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("customers",$id,"transactions"), $params, $env, $headers);
  15. }
  16. public static function transactionsForSubscription($id, $params = array(), $env = null, $headers = array())
  17. {
  18. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("subscriptions",$id,"transactions"), $params, $env, $headers);
  19. }
  20. public static function paymentsForInvoice($id, $params = array(), $env = null, $headers = array())
  21. {
  22. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("invoices",$id,"payments"), $params, $env, $headers);
  23. }
  24. public static function retrieve($id, $env = null, $headers = array())
  25. {
  26. return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("transactions",$id), array(), $env, $headers);
  27. }
  28. }
  29. ?>