OSOFTPAY Wallet Payment Method

This interface allows OSOFTPAY merchant to receive payment on the web for their goods and services. This integration targets merchants wallet and deposits the goods and service amount into the target wallet. The popular method of consuming this API is via form get method (not post).


OSOFTPAY required/mandatory fields to initiate payments

Note: These are the required/mandatory fields to initiate payment to OSOFTPAY Merchant Wallet


MerchantNumber This is a mandatory field that is provided by OSOFTPAY. It is used to identify the merchant receiving the payment. Note that this interface do not have a demo. It is straight to live once the merchantnumber is provided to you. string
ServiceAmount This is a mandatory field that you need to provide OSOFTPAY in your GET request as the amount you are paying. Please note that charges such as VAT and Osoftpay Charges applies to amount. string
RetURL This is a mandatory field that you need to provide OSOFTPAY in your GET request to receive notification of your transaction. A successful transaction always returns a Paycode. You need to further save the Paycode on your database and use it to confirm or verify payment status before goods and services be issued to clients. url

Initiate Payment
HTTP GET Sample Form
<form id="form1" action="https://osoftpay.net/OwalPay/Payface" method="get"> <input type="hidden" name="MerchantNumber" value="your_Merchant_Number(Please ask your handler for your number)" /> <input type="hidden" name="RetURL" value="The_URL_Where_You_want_Your_Response" /> <div class="form-group"> <label for="">Amount:</label> <input name="ServiceAmount" class="form-control" type="text" required> </div> <div class="form-group"> <button class="btn btn-success btn-lg float-right" type="submit"> Make Payment </button> </div> </form>

Note: The fields provided in the form above are required for wallet payment interface to be initiated. You can customize the form to receive values as inputs depending on your development platform but make sure the name property is same as used on the sample form.

Payment Return Parameters
Once you have posted a payment to OSOFTPAY, whether the payment is successful or not, you should be expecting the following on the return url you specified in your GET form as above (
<input type="hidden" name="RetURL" value="The_URL_Where_You_want_Your_Response" />
).
1) Paycode (This is a payment code generated for successful transactions only. If the payment is successful, a Paycode must be returned to your RetURL)

2)Message (This is a message showing the status description of your transaction. Be mindful of what is returned.)


GET Payment Status

Getting payment status requires that you send your Paycode received to an API endpoint to get the status of your transaction before goods and services are issued to your clients.

Here is a typical ASP.NET C# sample using HttpClient:

using (HttpClient client = new HttpClient()) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); using (HttpResponseMessage response = client.GetAsync(url).Result) { using (HttpContent content = response.Content) { var json = content.ReadAsStringAsync().Result; PayCodeResponse result = JsonConvert.DeserializeObject<PayCodeResponse> (json); if (result != null) { } } } }
Where
1) url = "https://osoftpay.net/api/SoftPayCodes/?Paycode=" + Paycode

2) PayCodeResponse is a response object with the following properties:
public string MerchantNumber { get; set; } public decimal Amount { get; set; } public decimal UsageStatus { get; set; } public decimal MerchantName { get; set; } public decimal Paycode { get; set; } public decimal UsedBy { get; set; } public decimal Charge { get; set; } public decimal VAT { get; set; } public decimal TotalAmount { get; set; }
Note: The request must return your MerchantName, MerchantNumber, Paycode, Amount and Payer details. If these values comparism does not suite your initial payment request, do not honour the payment. A successful payment has Amount, Charge, VAT and TotalAmount returned.