承接 wontonee/phonepe 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wontonee/phonepe

Composer 安装命令:

composer require wontonee/phonepe

包简介

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

README 文档

README

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

🚀 Features

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 & 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

  • 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

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

📦 Installation

Step 1: Install via Composer

composer require wontonee/phonepe

Step 2: Publish Assets

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

Step 3: Clear Cache

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

⚙️ Configuration

1. Get PhonePe Credentials

  1. Login to PhonePe Business Dashboard
  2. Navigate to Developer Settings
  3. Copy your Client ID and Client Secret

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:
Field Description Required
Title Display name for payment method Yes
Description Description shown to customers No
Payment Method Icon Upload custom icon (100x50px recommended) No
Environment Select Sandbox or Production Yes
Client ID Your PhonePe Client ID Yes
Client Secret Your PhonePe Client Secret Yes
Client Version API Client Version (Default: 1) Yes
Checkout Type Select Standard or Express (Default: Standard) Yes
Status Enable/Disable payment method Yes
  1. Click Save Configuration

🔧 How It Works

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

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

Sandbox Testing

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

Test Credentials

Contact PhonePe support for sandbox test credentials.

📝 Important Notes

Amount Handling

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

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

  • PENDING: Payment initiated but not completed
  • COMPLETED: Payment successful
  • FAILED: Payment failed

🔍 Troubleshooting

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

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

🆘 Support

For support, contact:

📄 License

This package is proprietary software by Wontonee.

🔮 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

Developed with ❤️ by Wontonee

wontonee/phonepe 适用场景与选型建议

wontonee/phonepe 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 wontonee/phonepe 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wontonee/phonepe 我们能提供哪些服务?
定制开发 / 二次开发

基于 wontonee/phonepe 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 24
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-10-06