diff --git a/README.md b/README.md index 0fd1288..390cb40 100644 --- a/README.md +++ b/README.md @@ -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