PHPackages                             wontonee/phonepe - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. wontonee/phonepe

ActiveLibrary[Payment Processing](/categories/payments)

wontonee/phonepe
================

PhonePe Payment Gateway for Bagisto - Professional integration with OAuth 2.0 authentication

1.0.2(7mo ago)16proprietaryPHPPHP ^8.1|^8.2

Since Oct 7Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/wontonee/phonepe-bagisto)[ Packagist](https://packagist.org/packages/wontonee/phonepe)[ RSS](/packages/wontonee-phonepe/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

PhonePe Payment Gateway for Bagisto
===================================

[](#phonepe-payment-gateway-for-bagisto)

Professional PhonePe payment gateway integration for Bagisto e-commerce platform with OAuth 2.0 authentication.

---

🚀 Features
----------

[](#-features)

### Payment Processing

[](#payment-processing)

- **OAuth 2.0 Authentication**: Secure token-based API authentication
- **Multiple Payment Methods**: UPI, Cards, Net Banking, and Wallets
- **Environment Support**: Sandbox for testing, Production for live transactions
- **Automatic Amount Conversion**: Handles paisa conversion automatically
- **Order Management**: Seamless integration with Bagisto order system

### Security &amp; Reliability

[](#security--reliability)

- **Secure Token Generation**: OAuth 2.0 access token with automatic expiry handling
- **Payment Verification**: Server-side payment status verification
- **Session Management**: Secure session handling for payment data
- **Comprehensive Logging**: Detailed logs for debugging and monitoring

### Admin Features

[](#admin-features)

- **Easy Configuration**: Simple admin panel setup
- **Environment Toggle**: Switch between Sandbox and Production
- **Customizable**: Configure order expiry time
- **Payment Method Icon**: Upload custom payment method icon

---

📋 Requirements
--------------

[](#-requirements)

- Bagisto 2.x
- PHP 8.1 or higher
- PhonePe Business Account
- Client ID and Client Secret from PhonePe Dashboard

---

📦 Installation
--------------

[](#-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require wontonee/phonepe
```

### Step 2: Publish Assets

[](#step-2-publish-assets)

```
php artisan vendor:publish --tag=phonepe-assets
```

### Step 3: Clear Cache

[](#step-3-clear-cache)

```
php artisan config:cache
php artisan route:cache
php artisan optimize:clear
```

---

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Get PhonePe Credentials

[](#1-get-phonepe-credentials)

1. Login to [PhonePe Business Dashboard](https://business.phonepe.com/)
2. Navigate to **Developer Settings**
3. Copy your **Client ID** and **Client Secret**

### 2. Configure in Bagisto Admin

[](#2-configure-in-bagisto-admin)

1. Go to **Admin Panel → Configuration → Sales → Payment Methods**
2. Find **PhonePe** in the payment methods list
3. Configure the following fields:

FieldDescriptionRequired**Title**Display name for payment methodYes**Description**Description shown to customersNo**Payment Method Icon**Upload custom icon (100x50px recommended)No**Environment**Select Sandbox or ProductionYes**Client ID**Your PhonePe Client IDYes**Client Secret**Your PhonePe Client SecretYes**Client Version**API Client Version (Default: 1)Yes**Checkout Type**Select Standard or Express (Default: Standard)Yes**Status**Enable/Disable payment methodYes4. Click **Save Configuration**

---

🔧 How It Works
--------------

[](#-how-it-works)

### Payment Flow

[](#payment-flow)

1. **Customer Checkout**: Customer selects PhonePe and places order
2. **OAuth Authentication**: System generates OAuth access token
3. **Payment Creation**: Payment order created via PhonePe API
4. **Redirect to PhonePe**: Customer redirected to PhonePe payment page
5. **Payment Processing**: Customer completes payment on PhonePe
6. **Callback**: PhonePe redirects back with payment status
7. **Verification**: System verifies payment status with PhonePe
8. **Order Creation**: Order created if payment successful

### API Endpoints

[](#api-endpoints)

**Sandbox:**

- Auth: `https://api-preprod.phonepe.com/apis/pg-sandbox/v1/oauth/token`
- Payment: `https://api-preprod.phonepe.com/apis/pg-sandbox/checkout/v2/pay`

**Production:**

- Auth: `https://api.phonepe.com/apis/identity-manager/v1/oauth/token`
- Payment: `https://api.phonepe.com/apis/pg/checkout/v2/pay`

---

🧪 Testing
---------

[](#-testing)

### Sandbox Testing

[](#sandbox-testing)

1. Set **Environment** to **Sandbox**
2. Use your PhonePe sandbox credentials
3. Test with PhonePe test payment methods

### Test Credentials

[](#test-credentials)

Contact PhonePe support for sandbox test credentials.

---

📝 Important Notes
-----------------

[](#-important-notes)

### Amount Handling

[](#amount-handling)

- PhonePe requires amounts in **paisa** (₹10 = 1000 paisa)
- Minimum order amount: **₹1 (100 paisa)**
- System automatically converts rupees to paisa

### Order Expiry

[](#order-expiry)

- Minimum: 300 seconds (5 minutes)
- Maximum: 3600 seconds (60 minutes)
- Default: 1800 seconds (30 minutes)
- Fixed at 30 minutes for optimal user experience

### Payment States

[](#payment-states)

- `PENDING`: Payment initiated but not completed
- `COMPLETED`: Payment successful
- `FAILED`: Payment failed

---

🔍 Troubleshooting
-----------------

[](#-troubleshooting)

### Common Issues

[](#common-issues)

**1. "PhonePe credentials not configured"**

- Solution: Check Client ID and Client Secret in admin configuration

**2. "Minimum order amount is ₹1"**

- Solution: Ensure cart total is at least ₹1

**3. "Payment verification failed"**

- Solution: Check PhonePe API credentials and environment setting

**4. OAuth token generation failed**

- Solution: Verify Client ID, Client Secret, and network connectivity

**5. Route not found errors**

- Solution: Run `php artisan route:cache` and `php artisan config:cache`

### Debug Logs

[](#debug-logs)

Check logs in `storage/logs/laravel.log` for detailed error information.

---

🆘 Support
---------

[](#-support)

For support, contact:

- **Email**:
- **Website**:
- **WhatsApp**: +91 9711381236

---

📄 License
---------

[](#-license)

This package is proprietary software by Wontonee.

---

🔮 Upcoming Features (Phase 3)
-----------------------------

[](#-upcoming-features-phase-3)

- ✅ Webhook integration for real-time updates
- ✅ Refund functionality from admin panel
- ✅ Order status API integration
- ✅ Fallback mechanism for missed payments

---

📚 Additional Resources
----------------------

[](#-additional-resources)

- [PhonePe Developer Documentation](https://developer.phonepe.com/)
- [PhonePe Business Dashboard](https://business.phonepe.com/)
- [Bagisto Documentation](https://bagisto.com/en/documentation/)

---

**Developed with ❤️ by Wontonee**

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance64

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/990964f490e33904da3bcc7f878293090d96ce9f244b4251f3b0b84cf8fc2860?d=identicon)[wontone18](/maintainers/wontone18)

---

Top Contributors

[![wontone18](https://avatars.githubusercontent.com/u/10259774?v=4)](https://github.com/wontone18 "wontone18 (12 commits)")

---

Tags

bagistobagisto-packagelaravelphonepe-gateway-v2

### Embed Badge

![Health badge](/badges/wontonee-phonepe/health.svg)

```
[![Health](https://phpackages.com/badges/wontonee-phonepe/health.svg)](https://phpackages.com/packages/wontonee-phonepe)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
