ServiceResponse, together with the transaction reference and response code.
Note: This method accepts custom idempotency key generated by your system. By default, if not specified, it will create one on your behalf.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ServiceResponse, together with the transaction reference and response code.
using OneKhusa.SDK;
using OneKhusa.SDK.Models.Transactions.BillPayments;
//code omitted for brevity
OneKhusaResponse<PayBillPaymentResponse> response = await client
.Transactions
.BillPayments
.PayBillAsync(new PayBillPaymentRequest
{
BillDescription = "ESCOM Bill payment",
CapturedBy = "joe.doe@example.com",
MerchantAccountNumber = 12345678,
ServiceAccountNumber = "10001000",
ServiceCode = "101",
SourceReferenceNumber = "EFTTEST0001",
TransactionAmount = 100.00M
});
if (response is { IsSuccess: true, Data: not null })
{
Console.WriteLine($"""
ServiceResponse: {response.Data.ServiceResponse};
TransactionReferenceNumber: {response.Data.TransactionReferenceNumber};
ResponseCode: {response.Data.ResponseCode}
""");
return;
}
//it means an error has occurred: RFC7807 compliant error object
Console.WriteLine($"""
Type: {response.Error?.Type};
Title: {response.Error?.Title};
Detail: {response.Error?.Detail};
ErrorCode: {response.Error?.ErrorCode};
Status: {response.Error?.Status};
Instance: {response.Error?.Instance};
Errors: {string.Join(";", response.Error?.Errors ?? [])}
""");
Console.ReadLine();