1. Go to this page and download the library: Download loovpayment/laravel-sdk 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/ */
loovpayment / laravel-sdk example snippets
bash
namespace App\Htpp\Controllers;
use Loovpayment\LaravelSdk\LoovPay;
class payment extends Controller{
public function payment(){
$data =[
'amount' =>50000,
'currency' => 'XAF',
'payment_mode' => 'CARD',
"return_url" => "https://google.com?state=return_url",
"cancel_url" => "https://google.com?state=cancel",
"callback_url" => "https://webhook.site/9c647add-6b43-4832-bd5d-db529c7c9b79",
"description" => "test payment de service en ligne",
"name" => "Arolle Fona",
"email" =>"[email protected]",
"phoneNumber" => "237699009999"
];
$response = (new LoovPay())->setKeys(AppKey MerchantKey)->payIn($data);
return $response;
}
}
bash
namespace App\Htpp\Controllers;
use Loovpayment\LaravelSdk\LoovPay;
class payment extends Controller{
public function payment(){
$data =[
'amount' =>50000,
'operator' => 'XAF',
"callback_url" => "https://webhook.site/9c647add-6b43-4832-bd5d-db529c7c9b79",
"name" => "Arolle Fona",
"email" =>"[email protected]",
"phoneNumber" => "237699009999"
];
$response = (new LoovPay())->setKeys(AppKey MerchantKey)->mobileSoftPay($data);
return $response;
}
}
bash
namespace App\Htpp\Controllers;
use Loovpayment\LaravelSdk\LoovPay;
class payment extends Controller{
public function payment(){
$data =[
'amount' =>50000,
"operator": "orange-money-cm",
'phoneNumber' => '237699009999',
"currency" => "XAF"
];
$response = (new LoovPay())->setKeys(AppKey MerchantKey)->payOut($data);
return $response;
}
}
bash
namespace App\Htpp\Controllers;L
use Loovpayment\LaravelSdk\LoovPay;
class payment extends Controller{
public function payment(){
$response = (new LoovPay())->setKeys(AppKey MerchantKey)->checkStatus($reference);
return $response;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.