def test_read_body_messages(self):

        callback = Callback.from_xml_callback(
            self.load_xml_response('CardHolderMessageMustBeShownFalse.xml'))
        self.assertEqual('Failed', callback.result)
        self.assertEqual('TestAcquirer[pan=0466 or amount=4660]',
                         callback.merchant_error_message)
        self.assertEqual('Card Declined', callback.card_holder_error_message)
        self.assertEqual(False, callback.card_holder_message_must_be_shown)

        callback = Callback.from_xml_callback(
            self.load_xml_response('CardHolderMessageMustBeShownTrue.xml'))
        self.assertEqual(True, callback.card_holder_message_must_be_shown)
    def test_transaction_set_filter(self):
        callback = Callback.from_xml_callback(self.response_as_etree)

        transactions = callback.transactions(auth_type='subscription_payment')

        self.assertEqual(len(transactions), 1)
        self.assertIsInstance(transactions[0], Transaction)
Exemplo n.º 3
0
    def test_transaction_set_filter(self):
        callback = Callback.from_xml_callback(self.response_as_etree)

        transactions = callback.transactions(auth_type='subscription_payment')

        self.assertEqual(len(transactions), 1)
        self.assertIsInstance(transactions[0], Transaction)
    def test_transaction_set(self):
        callback = Callback.from_xml_callback(self.response_as_etree)

        transactions = callback.transactions()

        self.assertEqual(len(transactions), 2)
        for transaction in transactions:
            self.assertIsInstance(transaction, Transaction)
    def test_read_payment_id(self):
        callback = Callback.from_xml_callback(
            self.load_xml_response('ReasonCode.xml'))

        transactions = callback.transactions()

        self.assertEqual('17794956-9bb6-4854-9712-bce5931e6e3a',
                         transactions[0].payment_id)
    def test_read_reason_code(self):

        callback = Callback.from_xml_callback(
            self.load_xml_response('ReasonCode.xml'))

        transactions = callback.transactions()

        self.assertEqual('NONE', transactions[0].reason_code)
Exemplo n.º 7
0
    def test_transaction_set(self):
        callback = Callback.from_xml_callback(self.response_as_etree)

        transactions = callback.transactions()

        self.assertEqual(len(transactions), 2)
        for transaction in transactions:
            self.assertIsInstance(transaction, Transaction)
    def test_epayment_cancelled(self):
        callback = Callback.from_xml_callback(
            self.load_xml_response('200_epayment_cancelled.xml'))

        transactions = callback.transactions()

        self.assertIsInstance(transactions, list)
        self.assertEqual(len(transactions), 1)
        self.assertIsInstance(transactions[0], Transaction)

        self.assertEqual('Cancelled', callback.result)
        self.assertEqual('epayment_cancelled',
                         transactions[0].transaction_status)
    def test_load_from_etree(self):
        callback = Callback.from_xml_callback(self.response_as_etree)

        self.assertEqual(callback.result, 'Success')
Exemplo n.º 10
0
    def test_load_from_etree(self):
        callback = Callback.from_xml_callback(self.response_as_etree)

        self.assertEqual(callback.result, 'Success')