GithubHelp home page GithubHelp logo

dipesh79 / laravelphonepe Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 17 KB

Integrate PhonePe Checkout to your Laravel Application

Home Page: https://dipesh79.github.io/LaravelPhonePe/

License: MIT License

PHP 100.00%
laravel laravel-package payment payment-integration phonepe phonepe-api

laravelphonepe's Introduction

Package Image

Laravel PhonePe

Latest Stable Version Total Downloads License

This Laravel package allows you to integrate PhonePe payment on your Laravel Application.

Usage/Examples

Install Using Composer

composer require dipesh79/laravel-phonepe

Add Variables in .env

PHONEPE_MERCHANT_ID="PGTESTPAYUAT"
PHONEPE_MERCHANT_USER_ID="MUID123"
PHONEPE_ENV="staging" //staging or production
PHONEPE_SALT_KEY="099eb0cd-02cf-4e2a-8aca-3e6c6aff0399"
PHONEPE_SALT_INDEX="1"
PHONEPE_CALLBACK_URL="http://localhost:8000"

Publish Vendor File

php artisan vendor:publish

And publish "Dipesh79\LaravelPhonePe\LaravelPhonePeServiceProvider"

Redirect the user to payment page from your controller

use Dipesh79\LaravelPhonePe\LaravelPhonePe;


//Your Controller Method
public function phonePePayment()
{
    $phonepe = new LaravelPhonePe();
    //amount, phone number, callback url, unique merchant transaction id
    $url = $phonepe->makePayment(1000, '9999999999', 'https://locahost:8000/redirct-url','1');
    return redirect()->away($url);
}

Check Payment Status

After Successful Payment PhonePe will redirect to your callback url with transaction id and status. You can check the payment status using transaction id.

use Dipesh79\LaravelPhonePe\LaravelPhonePe;
use Illuminate\Http\Request;


public function callBackAction(Request $request)
{
 $phonepe = new LaravelPhonePe();
 $response = $phonepe->getTransactionStatus($request->all());
 if($response == true){
    //Payment Success
 }
 else
 {
    //Payment Failed           
 }
}

License

MIT

Author

Support

For support, email dipeshkhanal79[at]gmail[dot]com.

laravelphonepe's People

Contributors

dipesh79 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravelphonepe's Issues

getting too many requests error

I have tested this package and everything is working fine but I have two problems on the production side.

  1. Not getting the payment success status on production. on fetching payment status in production on success not getting true in response.
  2. In the request-response getting the amount two zero extra in amount param

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.