def test_credit_void_from_transaction_id(self): response = self.card.authorize(10) \ .with_currency('USD') \ .with_allow_duplicates(True) \ .execute() self.assertNotEqual(None, response) self.assertEqual('00', response.response_code) void_response = Transaction.from_id(response.transaction_id) \ .void() \ .execute() self.assertNotEqual(None, void_response) self.assertEqual('00', void_response.response_code)
def test_check_void_from_transaction_id(self): response = self.check.charge(10) \ .with_currency('USD') \ .with_address(self.address) \ .execute('ach') self.assertNotEqual(None, response) self.assertEqual('00', response.response_code) void_response = Transaction.from_id(response.transaction_id, PaymentMethodType.ACH) \ .void() \ .execute('ach') self.assertNotEqual(None, void_response) self.assertEqual('00', void_response.response_code)
def test_ebt_cannot_refund_from_transaction_id_only(self): with self.assertRaises(UnsupportedTransactionException): Transaction.from_id("1234567890", PaymentMethodType.EBT) \ .refund() \ .with_currency('USD') \ .execute('ebt')
def test_debit_cannot_reverse_from_transaction_id_only(self): with self.assertRaises(UnsupportedTransactionException): Transaction.from_id("1234567890", PaymentMethodType.Debit) \ .reverse() \ .with_currency('USD') \ .execute('debit')