PHP Sample:
$hash=hash('sha512', $token.$email.$username.$ref );
$Token is your Api Token
$Ref is an ID/Message generated by you for record tracking purposes (recommended).
Note: if you use a reference, ensure you also pass "ref" as a post parameter for every request
OK => Successful FAIL => Not Successful PENDING => Transaction not processed B001 => Authentication Failed B002 => Operation not allowed on account B003 => API not enabled for this account B004 => Invalid request B005 => Product has no plan in this category B006 => Validation failed B007 => Insufficient Balance B008 => Invalid Amount B009 => Operation Failed
username: user123, hash: 6a7ba624db21e84c6cb58e9e7f0055c8316bc2c2e3ac1d35e8c3fe, category: tv
username: user123, ref: myRef, hash: 21e84c6cb58e9e7f0055c8316bc2c2e4ac1d35e8c3fe6a7ba624db, category: tv
{
"response": "OK",
"result": [
{
"product_id": "BPD-NGCA-AQA",
"name": "DSTV",
"hasProductList": true,
"hasValidation": true,
"openRange": false
},
{
"product_id": "BPD-NGCA-AQC",
"name": "GOTV",
"hasProductList": true,
"hasValidation": true,
"openRange": false
},
{
"product_id": "BPD-NGCA-AWA",
"name": "StarTimes",
"hasProductList": false,
"hasValidation": true,
"openRange": true,
"min_denomination": 1000,
"max_denomination": 50000,
"step": 1
}
]
}
openRange: Indicates the available product list has no fixed amount and price, hence you can supply any amount within the minimum and maximum limit, step is the allowed interval
username: user123,
hash: 6a7ba624db21e84c6cb58e9e7f0055c8316bc2c2e3ac1d35e8c3fe,
category: tv,
product: BPD-NGCA-AQA
SAMPLE RESPONSE 1
{
"response": "OK",
"result": [
{
"plan_id": "ACSSE36",
"name": "DStv Access",
"price": 2000
},
{
"plan_id": "COFAME36",
"name": "DStv Family",
"price": 4000
},
{
"plan_id": "COMPE36",
"name": "DStv Compact",
"price": 6800
},
{
"plan_id": "COMPLE36",
"name": "DStv Compact Plus",
"price": 10650
}
]
}
SAMPLE RESPONSE 2
{
"response": "B005",
"message": "Product has no plan in this category"
}
username: user123,
hash: 6a7ba624db21e84c6cb58e9e7f0055c8316bc2c2e3ac1d35e8c3fe,
category: tv,
product: BPD-NGCA-AQA,
validate: 41320018196
{
"response": "OK",
"result": {
"name": "ARON A VICTOR",
"number": "41320018196"
}
}
username: user123, hash: 21e84c6cb58e9e7f0055c8316bc2c2e4ac1d35e8c3fe6a7ba624db, ref: myRef, category: tv, product: BPD-NGCA-AQA, plan: ACSSE36, number: 41320018196
username: user123, hash: 21e84c6cb58e9e7f0055c8316bc2c2e4ac1d35e8c3fe6a7ba624db, ref: myRef, category: tv, product: BPD-NGCA-AWA, amount: 1000, number: 20020018196
username: user123, hash: 21e84c6cb58e9e7f0055c8316bc2c2e4ac1d35e8c3fe6a7ba624db, ref: myRef, category: electricity, product: BPE-NGCABIA-OR, amount: 1000, number: 0100040261, prepaid: 1
username: user123, hash: 21e84c6cb58e9e7f0055c8316bc2c2e4ac1d35e8c3fe6a7ba624db, ref: myRef, category: waec, product: BPM-NGCA-ASA, plan: 700
{
"response": "OK",
"transaction_id": "5a3388ac22a",
"discounted_amount": "1980",
"message": "Payment was successful"
}
{
"response": "OK",
"transaction_id": "5a3388ac22a",
"discounted_amount": "980",
"message": "Payment was successful",
"pin_code": "3022399443",
"pin_message": "Operator Message : 2.2KWh at N21.65 per KWh; Account : 0100040261; Receipt No : 4952724; Transaction ID :20171208120600~1013417"
}
{
"response": "OK",
"transaction_id": "5a3388ac22b",
"discounted_amount": "700",
"message": "Payment was successful",
"pins":[
{
"serialNumber":"WRN192775404",
"pin":"740525808961",
"expiresOn":null
}
]
}
{
"response": "B007",
"message": "Insufficient Balance"
}