Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{'error': True, 'txRef': 'MC-1673349994077', 'flwRef': None, 'errMsg': "Cannot read property 'data' of undefined"} Charge from francophone seems not working #103

Open
noungajo opened this issue Jan 10, 2023 · 1 comment

Comments

@noungajo
Copy link

noungajo commented Jan 10, 2023

The function

  from rave_python import Rave, RaveExceptions, Misc
  rave = Rave("ENTER_YOUR_PUBLIC_KEY", "ENTER_YOUR_SECRET_KEY", usingEnv = False)
  
  # mobile payload
    payload = {
    "amount": "50",
    "email": "toto@toto.fr",
    "fullName" : "",
    "currency":"XAF",
    "phonenumber": "00237690291718",
    "redirectUrl": "https://rave-webhook.herokuapp.com/receivepayment",
    "country":"CM",
    "network":"",
    "voucher":"",
    "phone_number":"00237690291718"
    }
  
  try:
    res = rave.Francophone.charge(payload)
    print(res)
    res = rave.Francophone.verify(res["txRef"])
    print(res)
  
  except RaveExceptions.TransactionChargeError as e:
    print(e.err)
    print(e.err["flwRef"])
  
  except RaveExceptions.TransactionVerificationError as e:
    print(e.err["errMsg"])
    print(e.err["txRef"])

The result

  /home/stage/Documents/projets/cheel/cheel_venv/lib/python3.8/site-packages/rave_python/rave_base.py:120: SyntaxWarning: Though you can use the usingEnv flag to pass secretKey as an argument, it is advised to store it in an environment variable, especially in production.
    warnings.warn("Though you can use the usingEnv flag to pass secretKey as an argument, it is advised to store it in an environment variable, especially in production.", SyntaxWarning)
  {'error': True, 'txRef': 'MC-1673349994077', 'flwRef': None, 'errMsg': "Cannot read property 'data' of undefined"}
  None
@Messanga11
Copy link

I have the same issue but in my case:
image
I want to fix the issue in a PR, so that the code don't crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants