Пример #1
0
 def test_call_start_transaction(self):
     Pagarme.api_key = 'api_key'
     transaction = Pagarme.start_transaction(amount=10,
                                             card_hash='ahsh',
                                             piranha='doida',
                                             mane='garrinha')
     self.assertIsInstance(transaction, Transaction)
Пример #2
0
 def test_start_transaction_invalid_installments(self):
     pagarme = Pagarme(self.api_key)
     with self.assertRaises(ValueError):
         transaction = pagarme.start_transaction(amount=314, card_hash='hashcard', installments=0)
Пример #3
0
 def test_start_transaction_invalid_payment_method(self):
     pagarme = Pagarme(self.api_key)
     with self.assertRaises(ValueError):
         transaction = pagarme.start_transaction(amount=314, card_hash='hashcard', payment_method='rice_bag')
Пример #4
0
 def test_start_transaction_invalid_amount(self):
     pagarme = Pagarme(self.api_key)
     with self.assertRaises(ValueError):
         transaction = pagarme.start_transaction(amount=None, card_hash='hashcard')
Пример #5
0
 def test_start_transaction(self):
     pagarme = Pagarme(self.api_key)
     transaction = pagarme.start_transaction(amount=314, card_hash='hashcard')
     self.assertIsInstance(transaction, Transaction)
Пример #6
0
 def test_call_start_transaction(self):
     Pagarme.api_key = 'api_key'
     transaction = Pagarme.start_transaction(amount=10, card_hash='ahsh', piranha='doida', mane='garrinha')
     self.assertIsInstance(transaction, Transaction)
Пример #7
0
 def test_start_transaction_invalid_installments(self):
     pagarme = Pagarme(self.api_key)
     with self.assertRaises(ValueError):
         transaction = pagarme.start_transaction(amount=314,
                                                 card_hash='hashcard',
                                                 installments=0)
Пример #8
0
 def test_start_transaction_invalid_payment_method(self):
     pagarme = Pagarme(self.api_key)
     with self.assertRaises(ValueError):
         transaction = pagarme.start_transaction(amount=314,
                                                 card_hash='hashcard',
                                                 payment_method='rice_bag')
Пример #9
0
 def test_start_transaction_invalid_amount(self):
     pagarme = Pagarme(self.api_key)
     with self.assertRaises(ValueError):
         transaction = pagarme.start_transaction(amount=None,
                                                 card_hash='hashcard')
Пример #10
0
 def test_start_transaction(self):
     pagarme = Pagarme(self.api_key)
     transaction = pagarme.start_transaction(amount=314,
                                             card_hash='hashcard')
     self.assertIsInstance(transaction, Transaction)