1. Go to this page and download the library: Download alex-nguetcha/intouch 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/ */
alex-nguetcha / intouch example snippets
$intouch = Intouch::credentials(
username: 'username',
password: 'password',
loginAgent: 'loginAgent',
passwordAgent: 'passwordAgent',
intouchId: 'passwordAgent'
)->callback('https://app.test/confirm-payment')
->amount(100)
->phone(6xxxxxx)
->operator('ORANGE')
->makeMerchantPayment(
[
"recipientEmail" => "[email protected]",
"recipientFirstName" => "John",
"recipientLastName" => "Doe",
]
);
if ($intouch->isInitiated()) {
// Your transaction has been initiated by intouch API
// echo (string)($intouch->getResult()->getBody());
} else {
// something went wrong
// echo $intouch->getError()['request'];
// echo $intouch->getError()['response'];
}
$intouch->amount(100); // Set the amount to be paid
$intouch->phone('1234567890'); // Set the mobile money account to be debited
$intouch->operator('MTN'); // Set the mobile money operator for the transaction
$intouch->callback('https://example.com/payment/callback');
if ($intouch->isInitiated()) {
// Your transaction has been initiated by intouch API
echo (string)($intouch->getResult()->getBody());
} else {
// something went wrong
// echo $intouch->getError()['request'];
echo $intouch->getError()['response'];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.