示例#1
0
    def check_create(self):
        acct = payment.create("AuthorizeNet", card="4222222222222")
        assert acct.__class__ == payment.AuthorizeNetPayment, \
               "create() didn't make the correct class."

        try:
            acct = payment.create("SOMETHING THAT DOESN'T EXIST")
        except NameError:
            gotError = 1
        else:
            gotError = 0

        assert gotError, \
               "Didn't get NameError when trying to create invalid class."
示例#2
0
    def check_charge(self):
        acct = payment.create(
            "Verisign", merchant=test.merchant["Verisign"], card="5105105105105100", expires="05/2005"
        )

        acct.charge(1)
        assert acct.result == payment.APPROVED, "charge didn't work!"

        acct.charge(101)
        assert acct.result == payment.DENIED, "charge should have failed but didn't!"
示例#3
0
    def check_charge(self):
        acct = payment.create("AuthorizeNet",
                              test=1,
                              merchant=test.merchant["AuthorizeNet"],
                              card="4222222222222",
                              expires="02/2003")

        acct.charge(1)
        assert acct.result == payment.APPROVED, \
               "charge didn't work!"
    def check_charge(self):
        acct = payment.create("AuthorizeNet",
                              test = 1,
                              merchant = test.merchant["AuthorizeNet"],
                              card = "4222222222222",
                              expires = "02/2003")

        acct.charge(1)
        assert acct.result == payment.APPROVED, \
               "charge didn't work!"
示例#5
0
    def check_charge(self):
        acct = payment.create("Verisign",
                              merchant=test.merchant["Verisign"],
                              card="5105105105105100",
                              expires="05/2005")

        acct.charge(1)
        assert acct.result == payment.APPROVED, \
               "charge didn't work!"

        acct.charge(101)
        assert acct.result == payment.DENIED, \
               "charge should have failed but didn't!"