Skip to content

Commit

Permalink
Merge pull request #1 from Dipesh79/Dipesh79-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
Dipesh79 authored Jul 8, 2024
2 parents 7c60004 + eee4a77 commit c526013
Showing 1 changed file with 3 additions and 66 deletions.
69 changes: 3 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,15 @@

This Laravel package allows you to create payment using Payeer.

## Quick Start



## Usage/Examples
### Install Using Composer
```javascript
composer require dipesh79/laravel-payeer-checkout
```
## Official Documentation

### Add Two Variables in .env
You can get shop id and merchant id Payeer Dashboard
```
PAYEER_SHOP_ID="Your Shop Id"
PAYEER_MERCHANT_KEY="Your Merchant Id"
```
### Publish Vendor File
```
php artisan vendor:publish --provider="Dipesh79\LaravelPayeerCheckout\PayeerServiceProvider"
```
or
```
php artisan vendor:publish
```
And publish "Dipesh79\LaravelPayeerCheckout\PayeerServiceProvider"


Redirect the user to payment page from your controller

```
use Dipesh79\LaravelPayeerCheckout\LaravelPayeerCheckout;
//Your Controller Method
public function payeerPayment()
{
//Store payment details in DB with pending status
$payment = new LaravelPayeerCheckout();
$amount = 123;
$order_id = 251264889; //Your Unique Order Id
$description = "Order Description"; //Your Order Description which will be shown in payeer dashboard
$currency = 'USD' //This is optional. Default is USD
return redirect($payment->payeerCheckout($amount,$order_id,$description,$currency))
}
```

After Successfull Payment payeer will redirect the use to your success url and you can change the payment status to Success else you can change the status to Fail when payeer redirect user to fail url.

Success Payment Case
```
public function payeerSuccess(Request $request)
{
$order_id = $request->m_orderid;
$payment = Payment::where('order_id', $order_id)->first();
$payment->status = "Success";
$payment->save();
//Other Tasks
}
```
Fail Payment Case

```
public function payeerFail(Request $request)
{
$payment = Payment::where('order_id', $request->m_orderid)->first();
$payment->status = "Fail";
$payment->save();
//Other Tasks
}
```

Documentation can be found on my [website](https://khanaldipesh.com.np/package/laravel-payeer-checkout).


## License
Expand Down

0 comments on commit c526013

Please sign in to comment.