Ejemplo n.º 1
0
 def test_rejected(self):
     self.transaction.status = constants.STATUS_COMPLETED
     self.transaction.save()
     reversal({'tracking_id': self.transaction_uuid, 'pay_key': 'foo'},
              {'amount': {'amount': 10, 'currency': 'USD'}})
     types = [s.type for s in Transaction.objects.all()]
     eq_([constants.TYPE_REVERSAL, constants.TYPE_PAYMENT], types)
Ejemplo n.º 2
0
 def test_rejected(self):
     self.transaction.status = constants.STATUS_COMPLETED
     self.transaction.save()
     reversal({'tracking_id': self.transaction_uuid, 'pay_key': 'foo'},
              {'amount': {'amount': 10, 'currency': 'USD'}})
     types = [s.type for s in Transaction.objects.all()]
     eq_([constants.TYPE_REVERSAL, constants.TYPE_PAYMENT], types)
Ejemplo n.º 3
0
    def test_rejected_already_done(self):
        PaypalTransaction.objects.create(
            type=constants.TYPE_REVERSAL, status=constants.STATUS_PENDING,
            correlation_id='asd-123', pay_key='asd-123',
            seller=self.paypal, amount=Decimal('-10'),
            currency='USD', uuid=self.transaction_uuid + 'another',
            related=self.transaction)

        eq_(reversal({'tracking_id': self.transaction_uuid}, {}), False)
Ejemplo n.º 4
0
    def test_rejected_already_done(self):
        Transaction.objects.create(
            type=constants.TYPE_REVERSAL,
            status=constants.STATUS_PENDING,
            uid_support='asd-123',
            uid_pay='asd-123',
            seller_product=self.product,
            amount=Decimal('-10'),
            currency='USD',
            provider=constants.SOURCE_PAYPAL,
            uuid=self.transaction_uuid + 'another',
            related=self.transaction)

        eq_(reversal({'tracking_id': self.transaction_uuid}, {}), False)
Ejemplo n.º 5
0
    def test_rejected_already_done(self):
        Transaction.objects.create(
            type=constants.TYPE_REVERSAL,
            status=constants.STATUS_PENDING,
            uid_support='asd-123',
            uid_pay='asd-123',
            seller_product=self.product,
            amount=Decimal('-10'),
            currency='USD',
            provider=constants.PROVIDER_PAYPAL,
            uuid=self.transaction_uuid + 'another',
            related=self.transaction)

        eq_(reversal({'tracking_id': self.transaction_uuid}, {}), False)
Ejemplo n.º 6
0
 def test_reject_missing(self):
     eq_(reversal({'tracking_id': self.transaction_uuid + 'nope'}, {}),
         False)
Ejemplo n.º 7
0
 def test_reject_missing(self):
     eq_(reversal({'tracking_id': self.transaction_uuid + 'nope'}, {}),
         False)