telegram : @iamdarkcomedy i am hacker

path :/home/bisorgosof24/public_html/Backup23122024

upload file:

List of files:

name file size edit permission action
.env2733 KBDecember 22 2024 06:20:070644
404.html58370 KBNovember 20 2024 15:32:220644
502.html58368 KBNovember 20 2024 15:32:220644
Modules-December 11 2024 21:02:560755
README.md4158 KBFebruary 14 2023 12:31:560644
app-December 11 2024 17:57:480755
artisan1686 KBFebruary 14 2023 12:31:560644
bootstrap-December 11 2024 20:23:360755
composer.json3761 KBDecember 11 2024 22:15:000644
composer.lock512048 KBDecember 11 2024 22:13:280644
config-June 15 2025 02:09:360755
database-December 05 2024 20:18:120755
dfsdf dfds fd fds findex.html1420 KBNovember 20 2024 15:32:240644
error_log16133129 KBJuly 18 2025 17:39:090644
firoz-December 23 2024 13:24:460755
index.php1667 KBDecember 14 2024 05:20:360644
lang-December 11 2024 21:02:480755
modules_statuses.json472 KBNovember 20 2024 15:32:240644
mpos-March 31 2025 02:36:310755
package.json226 KBFebruary 14 2023 12:31:560644
phpunit.xml1146 KBFebruary 14 2023 12:31:560644
public-March 31 2025 02:36:310755
resources-December 11 2024 21:10:220755
routes-June 15 2025 02:09:310755
storage-December 11 2024 21:12:440755
tests-December 05 2024 20:18:120755
vendor-December 11 2024 22:13:300755
vite.config.js263 KBFebruary 14 2023 12:31:560644

Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 227

Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 228

Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 230
# Pesapal Laravel 5,6,7,8,9,10 API Laravel 5,6,7,8,9,10 Package for the Pesapal API ## Installation ### Add this package using Composer From the command line inside your project directory, simply type: `composer require knox/pesapal` ### Update your config (for Laravel 5.4 and below) Add the service provider to the providers array in config/app.php: `Knox\Pesapal\PesapalServiceProvider::class,` Add the facade to the aliases array in config/app.php: `'Pesapal' => Knox\Pesapal\Facades\Pesapal::class,` ### Publish the package configuration (for Laravel 5.4 and below) Publish the configuration file and migrations by running the provided console command: `php artisan vendor:publish --provider="Knox\Pesapal\PesapalServiceProvider"` ## Setup ### Pesapal IPN For the url of the route use /pesapal-ipn eg mysite.com/pesapal-ipn as the IPN on the Pesapal Merchant settings dashboard ### Environmental Variables PESAPAL\_CONSUMER\_KEY `pesapal consumer key`
PESAPAL\_CONSUMER\_SECRET `pesapal consumer secret`
PESAPAL\_CURRENCY `ISO code for the currency`
PESAPAL\_IPN `controller method to call for instant notifications IPN as relative path from App\Http\Controllers\ eg "TransactionController@confirmation"`
PESAPAL\_CALLBACK_ROUTE `route name to handle the callback eg Route::get('donepayment', ['as' => 'paymentsuccess', 'uses'=>'PaymentsController@paymentsuccess']); The route name is "paymentsuccess"`
NB: The controller method accepts 4 function parameters, Example: ```php public function confirmation($trackingid,$status,$payment_method,$merchant_reference) { $payments = Payments::where('tracking',$trackingid)->first(); $payments -> payment_status = $status; $payments -> payment_method = $payment_method; $payments -> save(); } ``` ### Config live - Live or Demo environment
The ENV Variables can also be set from here. ## Usage At the top of your controller include the facade
`use Pesapal;` ### Example Code...Better Example..Haha Assuming you have a Payment Model
```php use Pesapal; use Illuminate\Http\Request; use App\Http\Requests; use Illuminate\Support\Facades\Auth; use App\Payment; class PaymentsController extends Controller { public function payment(){//initiates payment $payments = new Payment; $payments -> businessid = Auth::guard('business')->id(); //Business ID $payments -> transactionid = Pesapal::random_reference(); $payments -> status = 'NEW'; //if user gets to iframe then exits, i prefer to have that as a new/lost transaction, not pending $payments -> amount = 10; $payments -> save(); $details = array( 'amount' => $payments -> amount, 'description' => 'Test Transaction', 'type' => 'MERCHANT', 'first_name' => 'Fname', 'last_name' => 'Lname', 'email' => '[email protected]', 'phonenumber' => '254-723232323', 'reference' => $payments -> transactionid, 'height'=>'400px', //'currency' => 'USD' ); $iframe=Pesapal::makePayment($details); return view('payments.business.pesapal', compact('iframe')); } public function paymentsuccess(Request $request)//just tells u payment has gone thru..but not confirmed { $trackingid = $request->input('tracking_id'); $ref = $request->input('merchant_reference'); $payments = Payment::where('transactionid',$ref)->first(); $payments -> trackingid = $trackingid; $payments -> status = 'PENDING'; $payments -> save(); //go back home $payments=Payment::all(); return view('payments.business.home', compact('payments')); } //This method just tells u that there is a change in pesapal for your transaction.. //u need to now query status..retrieve the change...CANCELLED? CONFIRMED? public function paymentconfirmation(Request $request) { $trackingid = $request->input('pesapal_transaction_tracking_id'); $merchant_reference = $request->input('pesapal_merchant_reference'); $pesapal_notification_type= $request->input('pesapal_notification_type'); //use the above to retrieve payment status now.. $this->checkpaymentstatus($trackingid,$merchant_reference,$pesapal_notification_type); } //Confirm status of transaction and update the DB public function checkpaymentstatus($trackingid,$merchant_reference,$pesapal_notification_type){ $status=Pesapal::getMerchantStatus($merchant_reference); $payments = Payment::where('trackingid',$trackingid)->first(); $payments -> status = $status; $payments -> payment_method = "PESAPAL";//use the actual method though... $payments -> save(); return "success"; } } ``` #### Example ENV ``` PESAPAL_IPN=PaymentsController@paymentconfirmation PESAPAL_LIVE=true PESAPAL_CALLBACK_ROUTE=paymentsuccess ``` #### Example View ``` {!! $iframe !!} ``` #### Example Routes Relevant routes example, to help exclude entire webhooks route group in Csrf check in VerifyCsrfToken Middleware
```php Route::group(['prefix' => '/webhooks'], function () { //PESAPAL Route::get('donepayment', ['as' => 'paymentsuccess', 'uses'=>'PaymentsController@paymentsuccess']); Route::get('paymentconfirmation', 'PaymentsController@paymentconfirmation'); }); ``` #### All Done Feel free to report any issues