Flutterwave / Python-v2

Python library for Flutterwave for Business (F4B) v2 APIs
https://developer.flutterwave.com/
MIT License
21 stars 15 forks source link

M-pesa payment verification #87

Closed zacid closed 3 years ago

zacid commented 3 years ago

When trying to verify an m-pesa payment - I suspect that JSON isn't being returned to python-rave from flutterwave API:

  File "/local/lib/python2.7/site-packages/rave_python/rave_mpesa.py", line 37, in verify
    return super(Mpesa, self).verify(txRef, endpoint)
  File "/local/lib/python2.7/site-packages/rave_python/rave_payment.py", line 257, in verify
    return self._handleVerifyResponse(response, txRef)
  File "/local/lib/python2.7/site-packages/rave_python/rave_payment.py", line 111, in _handleVerifyResponse
    res = self._preliminaryResponseChecks(response, TransactionVerificationError, txRef=txRef)
  File "/local/lib/python2.7/site-packages/rave_python/rave_payment.py", line 46, in _preliminaryResponseChecks
    raise ServerError({"error": True, "txRef": txRef, "flwRef": flwRef, "errMsg": response})

Caused by:

        try:
            responseJson = response.json()
        except:
            raise ServerError({"error": True, "txRef": txRef, "flwRef": flwRef, "errMsg": response})

https://github.com/Flutterwave/rave-python/blob/master/rave_python/rave_payment.py#L43-L46

corneliusyaovi commented 3 years ago

Hi @zac156 , can you please retry the mpesa verification?

zacid commented 3 years ago

@Corvus97 are mpesa payments working with Flutterwave again? They have been completely offline for the past few weeks due to a problem with Safaricom?

zacid commented 3 years ago

@Corvus97 When I perform a Flutterwave Mpesa transaction using:

rave.Mpesa.charge(payload)

This is the response I am getting back:

TransactionChargeError: Your account charge call failed with message: Payment option currently undergoing maintenance updates. Please try another or contact support

Please advise?

corneliusyaovi commented 3 years ago

@zac156 Mpesa is online, kindly retry.