Created
October 23, 2018 05:12
-
-
Save gbozee/330988b0d47f115d2f13d4cf39493b57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verify_payment(request, order): | |
amount = request.GET.get("amount") | |
txrf = request.GET.get("trxref") | |
paystack_instance = PaystackAPI() | |
response = paystack_instance.verify_payment(txrf, amount=int(amount)) | |
if response[0]: | |
p_signals.payment_verified.send( | |
sender=PaystackAPI, ref=txrf, amount=int(amount), order=order | |
) | |
return JsonResponse({"success": True}) | |
return JsonResponse({"success": False}, status=400) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment