1. Go to this page and download the library: Download feexpay/feexpay-php 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/ */
feexpay / feexpay-php example snippets
on = new Feexpay\FeexpayPhp\FeexpayClass("shop's id", "token key API", "callback_url", "mode (LIVE, SANDBOX)");
// Using the mobile network payment method (MTN, MOOV)
$response = $skeleton->paiementLocal("amount", "phone_number", "network (MTN, MOOV)", "Jon Doe", "[email protected]");
$status = $skeleton->getPaiementStatus($response);
var_dump($status);
// Using the card payment method (VISA, MASTERCARD)
$responseCard = $skeleton->paiementCard("amount", "phoneNumber(66000000)", "typeCard (VISA, MASTERCARD)", "Jon", "Doe", "[email protected]", "country(Benin)", "address(Cotonou)", "district(Littoral)", "currency(XOF, USD, EUR)");
$redirectUrl = $responseCard["url"];
header("Location: $redirectUrl");
exit();
namespace App\Http\Controllers;
use Feexpay\FeexpayPhp\FeexpayClass;
use Illuminate\Http\Request;
class YourController extends Controller
{
public function feexpay()
{
// Using the card payment method (VISA, MASTERCARD)
$skeleton = new FeexpayClass("shop's id", "token key API", "callback_url", "mode (LIVE, SANDBOX)");
$responseCard = $skeleton->paiementCard("amount", "phoneNumber(66000000)", "typeCard (VISA, MASTERCARD)", "Jon", "Doe", "[email protected]", "country(Benin)", "address(Cotonou)", "district(Littoral)", "currency(XOF, USD, EUR)");
// Display response structure for debugging purposes
var_dump($responseCard);
// Check for the presence of the "url" key
if (isset($responseCard["url"])) {
$redirectUrl = $responseCard["url"];
return redirect()->away($redirectUrl);
} else {
// Handle the case where "url" is not present in the response
return response("Erreur de réponse de paiement")->setStatusCode(500);
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.