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."
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!"
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!"
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!"