PHP code example of epmnzava / beempayments
1. Go to this page and download the library: Download epmnzava/beempayments 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/ */
epmnzava / beempayments example snippets
//
namespace App\Http\Controllers;
use App\Models\User;
use Epmnzava\Annoucement\Annoucement;
use Epmnzava\LaravelCms\LaravelCms;
use Epmnzava\MpesaTanzania\MpesaTanzania;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Log;
use Epmnzava\Beempayments\Beempayments;
class CheckoutController extends Controller
{
public function beemCheckout(){
//create a beempayment instance
$bpay=new Beempayments;
//use the checkout method to request a payment.
//remember the arguments should be created from your system.
$res=$bpay->checkout("50000","255701000000","SAMPLE-12345","96f9cc09-afa0-40cf-928a-d7e2b27b2411");
//convert your reponse to an array to access src
$response=json_decode($res);
// go to the link provided
return redirect($response->src);
//reponse doc coming soon
}
//whitelisting service
public function whitelistmywebsite(){
$website="https://storewid.com";
$bpay=new Beempayments;
$response=$bpay->whitelist($website);
//$reponse={
"status": 200,
"message": "succesful"
//};
}