PHP code example of simplypaye / laravel

1. Go to this page and download the library: Download simplypaye/laravel 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/ */

    

simplypaye / laravel example snippets


use SimplyPaye\Laravel\Facades\SimplyPaye;

$result = SimplyPaye::initiateMobilePayment([
    'phone' => '243812345678',
    'amount' => '100',
    'currency' => 'CDF',
    'reference' => 'INV-'.now()->timestamp,
    'callbackUrl' => route('simplypaye.callback'),
]);

$orderNumber = $result['orderNumber'];

// Plus tard
$status = SimplyPaye::checkPaymentStatus($orderNumber);
if (SimplyPaye::isPaymentSuccess($status)) {
    // marquer commande payée
}

public function __construct(private SimplyPayeClient $simplyPaye) {}

// .env SIMPLYPAYE_MODE=sandbox
SimplyPaye::setSimulationStatus($orderNumber, 'success');