1. Go to this page and download the library: Download dohone/payment library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$response = DohonePayIn::payWithAPI()
->setAmount(123)
->setClientPhone("the phone of the user")
->setClientEmail("the email of the user")
->setCommandID("your order unique id")
->setOTPCode(123456)
->setMethod(DohonePayIn::quotation()::ORANGE)
->get();
if ($response->isSuccess()) {
//success code goes here
echo $response->getMessage();
} else {
//error code goes here
echo $response->getMessage();
}
$response = DohonePayIn::sms()
->setCode("the code receive by SMS")
->setPhone("the phone which has receive the SMS")
->get();
if ($response->isSuccess()) {
//success code goes here
echo $response->getMessage();
} else {
//error code goes here
echo $response->getMessage();
}
$response = DohonePayIn::verify()
->setAmount(6546545)
->setCommandID("your command unique id")
->setPaymentToken("the ttoken receive after the successful payment")
->get();
if ($response->isSuccess()) {
//success code goes here
echo $response->getMessage();
} else {
//error code goes here
echo $response->getMessage();
}
$response = DohonePayOut::mobile()
->setAmount("amount to send")
->setMethod(6)
->setReceiverAccount('receiver phone number with country country code ex:237XXXXXX')
->setReceiverCity("city")
->setReceiverCountry("country name")
->setReceiverName("receiver name")
->post();
if ($response->isSuccess()) {
//success code goes here
echo $response->getMessage();
} else {
//error code goes here
echo $response->getMessage();
}