Ozow One API¶
PayBridge uses Ozow's current One API hosted checkout, not the deprecated Payments API. The adapter supports ZAR payment creation, transaction status lookups, partial or full refunds, and Svix signed webhook verification.
Account setup¶
Create an Ozow One API client and site code in the Ozow merchant portal. The
client needs the payments scope. Add refunds if the application will issue
refunds. Create a webhook subscription for transaction.complete with message
type full, then copy its signing secret into server-side configuration.
Ozow currently describes One API webhooks as beta, so also retain the SDK's
server-to-server status check before fulfilling an order.
Configuration¶
{
"PaymentGatewayConfig": {
"DefaultGateway": "Ozow",
"EnabledGateways": [ "Ozow" ],
"Ozow": {
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"SiteCode": "your-site-code",
"WebhookSecret": "whsec_your-webhook-signing-secret",
"IsSandbox": true
}
}
}
Use user secrets, environment variables or a secrets manager for credentials.
Set IsSandbox to false for the production One API environment after the
merchant account and webhook subscription are ready.
Create and verify a payment¶
Set Currency to ZAR and provide a public HTTPS RedirectUrl. The adapter
returns Ozow's redirectUrl in PaymentResponse.CheckoutUrl. The SDK generates
a dated merchant reference and returns it as TransactionReference; use that
same value when verifying the payment and handling the webhook.
var payment = await paymentService.CreatePaymentAsync(new PaymentRequest
{
Amount = 250.00m,
Currency = "ZAR",
Description = "Order 123",
CustomerEmail = "customer@example.com",
RedirectUrl = "https://shop.example.com/payment/return",
IdempotencyKey = "order-123"
}, PaymentGatewayType.Ozow);
if (payment.Success)
{
// Redirect the customer's browser to payment.CheckoutUrl.
// Do not mark the order paid from the browser return alone.
}
var verified = await paymentService.VerifyPaymentAsync(payment.TransactionReference);
The hosted checkout and refund endpoints require separate OAuth scopes. The SDK obtains and caches each token using the lifetime returned by Ozow.
Webhook handling¶
Register the SDK webhook verifier for PaymentGatewayType.Ozow, pass the exact
raw request body and the svix-id, svix-timestamp and svix-signature
headers, and process the event only when signature verification succeeds. The
timestamp tolerance uses WebhookTimestampToleranceSeconds. Select a full
transaction.complete event so the merchant reference is present in
data.TransactionReference. Make webhook processing idempotent because
delivery can be retried.
Provider limits¶
- This adapter currently accepts ZAR only.
- Ozow's
returnUrlis for browser navigation, not payment confirmation. - A refund is asynchronous. The adapter reports
Pendinguntil Ozow reportsComplete, then maps that toRefunded. - Ozow must have sufficient merchant float for a refund.
- Set a different
RefundRequest.IdempotencyKeyfor each refund, and reuse it only when retrying that same refund. Without a key, each call creates a new refund, so a blind retry can refund twice. - The adapter's generated reference contains its UTC creation date so it can search the corresponding transaction dates when verifying or refunding.
See the Ozow One API hosted checkout guide, Request Payment API, List Transactions API, and Request Refunds API for current provider details.