Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Nov 11, 2020
2 parents 816f647 + 1b70e7a commit c97c76d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Example NagadApi Payment Request
Setting and attaching in your project you should run
<pre>
composer require arif98741/nagad-api
</pre>
For using nagad-api in your application just follow below code.
1. Copy all your data from .env.example to .env and change necessary details.
NAGAD_APP_ENV = development // dev: development, live: production
NAGAD_APP_LOG = 1 //it will generate error log
NAGAD_APP_ACCOUNT = //get from nagad. it is usually mobile no
NAGAD_APP_MERCHANTID = //get from nagad
NAGAD_APP_MERCHANT_PRIVATE_KEY = //get from nagad
NAGAD_APP_MERCHANT_PG_PUBLIC_KEY = //get from nagad
NAGAD_APP_TIMEZONE = Asia/Dhaka

<pre>

<?php
use NagadApi\Base;
use NagadApi\Helper;
use NagadApi\RequestHandler;
Expand All @@ -16,14 +17,15 @@ require 'vendor/autoload.php';

$nagad = new Base([
'amount' => 100,
'invoice' => Helper::generateFakeInvoice('', 15, true),
'invoice' => Helper::generateFakeInvoice(15, true),
'merchantCallback' => 'https://phpdark.com/payment/success/id=4',
]);

$request = new RequestHandler($nagad);
$respnose = $request->fire();

$response = $request->fire();
echo '<pre>';
print_r($respnose);
print_r($response);
echo '</pre>';
exit;
</pre>

0 comments on commit c97c76d

Please sign in to comment.