Further Market offers an accessible portal for any developer wishing to integrate a payment through its Mobile Money FM Business account.
The developer creates its Mobile Money account if not exist, then he creates a Further Market account (free) and receives a unique identifier. He proceeds to the binding of its Mobile Money account with that of Further Market. If during the course of his services, he requests a payment through his Mobile Money account the only thing to do is to call a link like the one below:
This being done, the customer receives an SMS for confirming the retrieval of the amount stated in the link. If payment is made, this amount is automatically transferred to the Mobile Money Account indicated in Further Market by the FMID stated in the link. Thus a developer “x” can incorporate an electronic payment solution in few time.
As said above, the developer must have:
- Mobile Money account associated with a number
- Further Market Business Account
- Couple your Mobile money number with your Further Market Business Account
- Money in Mobile Money wallet
- Mobile Money cash collect service activated
http://api.furthermarket.com/FM/MTN/MoMo/requestpayment?MyacountID=AccountID&CustomerPhonenumber=CustomerNumber&Amount=Amount
Where AccountID is the identifier on Further Market Business Account generated automatically by the system, CustomerNumber is the customer number making the transaction and Amount is the amount of money handle during the transaction, which is the amount levied on the customer for the associated service.
On this type, once the link is called, the process takes two minutes to have an answer from the customer. During that time nothing can be done until the answer is returned or the time has elapse. Thus we call this one the locked link type.
http://api.furthermarket.com/FM/MTN/MoMo/requestpayment?MyacountID=8&CustomerPhonenumber=237675717538&Amount=10000
In this case, the customer with phone number 675717538 will be prompted to confirm the payment of 10000Fcfa for a transaction initiated with respect of the FMID N°8
http://api.furthermarket.com/FM/MTN/MoMo/placepayment?accountID=AccountID&Phonenumber=CustomerNumber&Amount=Amount
Where AccountID is the identifier on Further Market Business Account generated automatically by the system, CustomerNumber is the customer number making the transaction and Amount is the amount of money handle during the transaction, which is the amount levied on the customer for the associated service.
On this type, once the link is called, the process directly places the transaction as a pending one, the PaymenID is generated. Thus another different task can be initiated. Two minutes after placement, the developer can check if the transaction was successful or not.
http://api.furthermarket.com/FM/MTN/MoMo/ placepayment?AccountID=8&Phonenumber=237675717538&Amount=10000
In this case, the customer with phone number 675717538 will be prompted to confirm the payment of 10000Fcfa for a transaction initiated with respect of the FMID N°8
http://api.furthermarket.com/FM/MTN/MoMo/checkpayment?accountID=AccountID&paymentID=PaymentID
Where AccountID is the identifier on Further Market Business Account generated automatically by the system, PaymentID is the ID number generated automatically by the system for the associated payment.
This action could only be done by the emitter and the receiver. If you are not eligible, you will not be able to access information.
http://api.furthermarket.com/FM/MTN/MoMo/checkpayment?accountID=8&paymentID=10
In this case, the developer (or customer) want to check the status of transaction with PaymentID ‘10’.
1- We proceed on an example by entering the link in the browser
2- Few seconds after, the user is prompted by SMS to dial *126*1# to confirm the transaction.
3- The customer dial *126*1# to proceed
4- Then the confirmation screen appears
5- After approving the payment, user should enter the pin code to secure the transaction
6- Then the result of the transaction is displayed
7- And the SMS is received as confirmation
Status |
Payment ID |
comments |
1 |
PaymentID=88 |
Successful Payment. Successfully processed transaction. |
100 |
|
General error |
1- We proceed on an example by entering the link in the browser
2- Few seconds after, the user is prompted by SMS to dial *126*1# to confirm the transaction.
3- The customer dial *126*1# to proceed
4- Then the confirmation screen appears
5- After approving the payment, user should enter the pin code to secure the transaction
6- Then the result of the transaction is displayed
7- And the SMS is received as confirmation
On success
On failure
On not eligible
At any time, the user can check whether a transaction was successful or not. It thus has a dashboard that allows sales monitoring. This action can be performed in 02 ways:
Through the application interface Further Market.
Through the USSD portal Further Market from her mobile phone.
1. Dial *141#
2. Select option 6
3. Enter PaymentID
4. Get result
1. You will have a notification of cash entrance in your account main window
2. Click on it to have the details of the transaction
And you can start enjoy your brand new Mobile Money cash collector.
After activation of the service, the cost is 1% (one percent) of the collected amount, and the resulting amount is transferred to the associated Mobile Money Account at the end of each business week after financial verifications.
v Sample of execution
a. Pending status
b. Error collect
c. Successful collect
v Client(Ajax) and Server(PHP) code
Ø Client side (Ajax)
When you click on “Collect” button this code is called in Javascript:
var isOK = false;
var cpt = 0;
var isTreat = false;
function CashCollect(){
var phone = $('#Phone-num').val();
var amount = $('#Amount').val();
var receiver = $('#ReceiverId').val();
if(isTreat) return;
isTreat = true;
var cashResult = '';
var checkResult = '';
if($.trim(phone) === ''){
alert('Enter a phone number');
return;
}
if($.trim(amount) === ''){
alert('Enter the value of amount');
return;
}
if($.trim(receiver) === ''){
alert('Enter a receiver');
return;
}
$('#status-img').attr('src','../<?=_FMTESTDIR?>img/loader.gif').trigger('refresh');
$('#waitingId').html('Waiting payment...').trigger('refresh');
$('#status-Payment').show();
cpt = 0;
$.ajax({
type: 'POST',
url: '../inc/accountSocialLoading.php?from=CashCollect',
data:{'from':'CashCollect', phone:phone, amount:amount, receiver:receiver},
async: true,
dataType: "json",
success:function(data1){
cashResult = data1.placepayment;
cashResult = cashResult.split(',');
$('#payment-text').html(cashResult[1]).trigger('refresh');
if(cashResult[0] == 1){
checkResult = cashResult[1];
checkResult = checkResult.split('=');
checkPayment(checkResult[1], receiver);
}
else{
$('#payment-text').html('Error code:'+cashResult[0]+', '+cashResult[1]).trigger('refresh');
$('#status-img').attr('src','../<?=_FMTESTDIR?>img/close2.png').trigger('refresh');
$('#waitingId').html('').trigger('refresh');
}
$('#priority').val(0);
},
error: function(e){console.log('function accountSocialLoading.php?placepayment :'+e.responseText);}
}).always(function(){
});
}
function checkPayment(paymentID,receiver){
var status = '';
var x = setInterval(function(){
$.ajax({
type: 'POST',
url: '../inc/accountSocialLoading.php?from=checkpayment',
data:{'from':'checkpayment', paymentID:paymentID, receiver:receiver},
async: true,
dataType: "json",
success:function(data2){
status = data2.checkpayment;
status = status.split('|');
if(status[0] == 1){
isOK = true;
}
},error: function(e){
console.log('function accountSocialLoading.php?checkpayment :'+e.responseText);
}
}).always(function(){
cpt += 1;
if((cpt == 12) || isOK){ // break the timer after 2 minutes or when successful payment
clearInterval(x);
if(isOK){
$('#payment-text').html('Successuf collect!!!').trigger('refresh');
$('#status-img').attr('src','../<?=_FMTESTDIR?>img/checkbox.png').trigger('refresh');
}
else{
$('#payment-text').html('Error code:'+status[0]+', '+status[1]).trigger('refresh');
$('#status-img').attr('src','../<?=_FMTESTDIR?>img/close2.png').trigger('refresh');
}
$('#waitingId').html('').trigger('refresh');
isOK = false;
cpt = 0;
isTreat = false;
}
});
},10000); // repeat check payment every 10 secondes
}
Ø Server side (PHP)
Note that the placepayment code can be directly embedded in your php development. You can also use other links by the same way.
$AccountID = (isset($_GET['receiver']))? $_GET['receiver'] : ((isset($_POST['receiver']))?$_POST['receiver']:0);
$Phonenumber = (isset($_GET['phone']))? $_GET['phone'] : ((isset($_POST['phone']))?$_POST['phone']:0);
$Amount = (isset($_GET['amount']))? $_GET['amount'] : ((isset($_POST['amount']))?$_POST['amount']:0);
$mes_donnees = array('MyAccountID' => $AccountID, 'CustomerPhonenumber' => $Phonenumber, 'Amount' => $Amount);
$postdata = http_build_query($mes_donnees);
$opts = array('http' =>
array(
'method' => 'GET',
'header' => 'Content-type: text/xml',
'CharSet' => 'utf-8',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$UssdResult = file_get_contents('http://api.furthermarket.com/FM/MTN/MoMo/placepayment?MyAccountID='.$AccountID.'&CustomerPhonenumber='.$Phonenumber.'&Amount='.$Amount, 1, $context);
header('Content-Type:text/javascript');
echo json_encode(
array(
'placepayment' => nl2br($UssdResult)
)
);
exit;
$AccountID = (isset($_GET['receiver']))? $_GET['receiver'] : ((isset($_POST['receiver']))?$_POST['receiver']:0);
$PaymentID = (isset($_GET['paymentID']))? $_GET['paymentID'] : ((isset($_POST['paymentID']))?$_POST['paymentID']:0);
$mes_donnees = array('accountID' => $AccountID, 'paymentID' => $PaymentID);
$postdata = http_build_query($mes_donnees);
$opts = array('http' =>
array(
'method' => 'GET',
'header' => 'Content-type: text/xml',
'CharSet' => 'utf-8',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$UssdResult = file_get_contents('http://api.furthermarket.com/FM/MTN/MoMo/checkpayment?accountID='.$AccountID.'&paymentID='.$PaymentID);
header('Content-Type:text/javascript');
echo json_encode(
array(
'checkpayment' => nl2br($UssdResult)
)
);
exit;
Here you can download our sample button client/server (Ajax/PHP) code package to use it inside your web site. Take care of your own data where they needed.