Closed Br3mah closed 3 years ago
from rave_python import Rave, RaveExceptions, Misc
def payslo(self): rave = Rave("FLWPUBK_TEST-MY-PUBKEY", "FLWSECK_TEST_MY-SEC_KEY", usingEnv = False) payload = { "cardno": "5531886652142950", "cvv": "564", "expirymonth": "09", "expiryyear": "32", "amount": "1300", "email": "python@gmail.com", "phonenumber": "0902620185", "firstname": "temi", "lastname": "desola", } try: res = rave.Card.charge(payload)
if res["suggestedAuth"]: arg = Misc.getTypeOfArgsRequired(res["suggestedAuth"]) if arg == "pin": Misc.updatePayload(res["suggestedAuth"], payload, pin="3310") if arg == "address": Misc.updatePayload(res["suggestedAuth"], payload, address= {"billingzip": "07205", "billingcity": "Hillside", "billingaddress": "470 Mundet PI", "billingstate": "NJ", "billingcountry": "US"}) if arg == "otp": Misc.updatePayload(res["suggestedAuth"], payload, otp = 12345) res = rave.Card.charge(payload) if res["validationRequired"]: rave.Card.validate(res["flwRef"], "") res = rave.Card.verify(res["txRef"]) print(res["transactionComplete"]) except RaveExceptions.CardChargeError as e: print(e.err["errMsg"]) print(e.err["flwRef"]) except RaveExceptions.TransactionValidationError as e: print(e.err) print(e.err["flwRef"]) except RaveExceptions.TransactionVerificationError as e: print(e.err["errMsg"]) print(e.err["txRef"])
Hello @Br3mah ,
Please pass the value of the OTP (12345) into the validate method rave.Card.validate(res["flwRef"], "12345")
rave.Card.validate(res["flwRef"], "12345")
from rave_python import Rave, RaveExceptions, Misc
def payslo(self): rave = Rave("FLWPUBK_TEST-MY-PUBKEY", "FLWSECK_TEST_MY-SEC_KEY", usingEnv = False) payload = { "cardno": "5531886652142950", "cvv": "564", "expirymonth": "09", "expiryyear": "32", "amount": "1300", "email": "python@gmail.com", "phonenumber": "0902620185", "firstname": "temi", "lastname": "desola", } try: res = rave.Card.charge(payload)