Environment status
Sandbox Environment
Environment status
Production Environment
Configuration Status
Test and debug your payment integration
Click "Check Configuration" to verify your settings
Status Codes Reference
Successful
Transaction completed successfully
Failed
Transaction failed
Settle
Successful, queued for settlement
Settled
Successfully settled
Declined
Failed fraud check
Abandoned
Transaction abandoned after 24 hours
Attempted
Customer attempted payment
Initializing
Payment URL loaded/returned
Initialize Payment
Test the payment initialization flow
Verify
Verify Payment
Check the status of a transaction
Webhook Inbox
Watch real Credo callbacks and webhooks as they arrive
Webhook endpoint
{{ callback_url|default:"Not configured" }}
Sandbox testing
Use a public tunnel for localhost, then register that public webhook URL and token in Credo.
Webhook inbox is idle
Initialize a debug payment to start watching for Credo callbacks and webhooks.
Integration Reference
Uses your configured settingsEnvironment
{{ environment }}
{{ base_url }}
Callback/Webhook
{{ callback_url|default:"Not configured" }}
Amount Unit
Pass Naira/main-unit values. The SDK sends kobo/minor-unit values to Credo.
Initialize Payment
from credo_pay import CredoClient
client = CredoClient()
response = client.initialize_payment(
amount=1000, # NGN 1,000; SDK sends 100000 kobo to Credo
email="customer@example.com",
callback_url="{{ callback_url }}",
reference_prefix="ORDER",
first_name="John",
last_name="Doe",
)
redirect_url = response.authorization_url
trans_ref = response.trans_ref
business_reference = response.reference
Verify Payment And Amount
verification = client.verify_payment(trans_ref)
if verification.is_successful:
verification.assert_amount(1000, currency="NGN")
print(verification.trans_amount_major)
elif verification.is_failed:
print(verification.status_description)
else:
print("Payment is still pending")
Readable References
from credo_pay import generate_payment_reference
reference = generate_payment_reference(prefix="codex")
response = client.initialize_payment(
amount=1000,
email="customer@example.com",
reference=reference,
callback_url="{{ callback_url }}",
)
Callback/Webhook View
from django.shortcuts import redirect
from credo_pay import CredoWebhookView
class MyCredoView(CredoWebhookView):
def handle_callback(self, callback_data, verify_response):
if verify_response and verify_response.is_successful:
Order.objects.filter(
reference=callback_data.reference
).update(status="paid")
return redirect("/payment/success/")
return redirect("/payment/failed/")
def handle_webhook(self, event):
if event.is_successful:
Order.objects.filter(
credo_trans_ref=event.trans_ref
).update(status="paid")
elif event.is_failed:
Order.objects.filter(
credo_trans_ref=event.trans_ref
).update(status="failed")
URL And Idempotency
# urls.py
from django.urls import path
urlpatterns = [
path(
"api/credo/callback-webhook/",
MyCredoView.as_view(),
name="credo-callback-webhook",
),
]
# In callback/webhook handlers
from credo_pay import model_payment_lock, process_payment_event
process_payment_event(
reference=event.trans_ref,
event=event,
lock=model_payment_lock(Order, lookup_field="credo_trans_ref"),
on_success=lambda event, order: order.mark_paid_once(),
on_failure=lambda event, order: order.mark_failed_once(),
)