Skip to content

Instantly share code, notes, and snippets.

@gbozee
Created October 23, 2018 05:12
Show Gist options
  • Save gbozee/330988b0d47f115d2f13d4cf39493b57 to your computer and use it in GitHub Desktop.
Save gbozee/330988b0d47f115d2f13d4cf39493b57 to your computer and use it in GitHub Desktop.
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