Download the PHP package mrdulal/laravel-vipps without Composer
On this page you can find all versions of the php package mrdulal/laravel-vipps. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrdulal/laravel-vipps
More information about mrdulal/laravel-vipps
Files in mrdulal/laravel-vipps
Package laravel-vipps
Short Description Laravel package for MobilePay Vipps payment integration with ePayment, Checkout, Express, and recurring payments support
License MIT
Homepage https://github.com/mrdulal/Vipps-MobilePay
Informations about the package laravel-vipps
Laravel MobilePay Vipps Package
A comprehensive Laravel package for MobilePay Vipps payment integration with support for all major Vipps payment methods. This package provides a clean, modern API for integrating with the Vipps MobilePay payment platform used across Norway, Denmark, and Finland.
โ ๏ธ Important Notice: This is an unofficial package and is not affiliated with, endorsed by, or officially supported by MobilePay or Vipps. This package is developed independently by a solo developer for Laravel developers. For official MobilePay Vipps integration documentation, please visit the Vipps Developer Portal.
๐ฏ Features
Payment Methods
- ๐ช MobilePay Vipps ePayment - Standard payment method integration
- ๐ MobilePay Vipps Checkout - Complete checkout solution with card payments
- โก MobilePay Vipps Express - Quick checkout from product pages with QR codes
- ๐ Recurring Payments - Subscription and recurring payment support
Management & Operations
- ๐ Order Management API - Capture, refund, cancel, and order management
- ๐ Webhook Support - Handle payment status updates automatically with signature verification
- ๐ก Event-Driven Architecture - Laravel events for all payment actions
- ๐ก๏ธ Security - Built-in signature verification and request validation
Developer Experience
- โ Comprehensive Testing - Full test suite with PHPUnit and Orchestra Testbench
- ๐ Type Safety - Full type hints and PHPDoc annotations
- ๐ง Configurable - Extensive configuration options
- ๐ Debugging - Built-in logging and error handling
- ๐ฆ Laravel Integration - Service providers, facades, and Artisan commands
๐ Countries Supported
| Country | Service | Market Penetration | Users |
|---|---|---|---|
| ๐ณ๐ด Norway | Vipps | 77% population | 4.2M users |
| ๐ฉ๐ฐ Denmark | MobilePay | 75% population | 4.4M users |
| ๐ซ๐ฎ Finland | MobilePay | 50% population | 2.8M users |
Total Market Reach: 11+ million active users across Nordic countries
๐ Requirements
| Requirement | Version | Notes |
|---|---|---|
| PHP | 8.1+ | Uses modern PHP features like enums, readonly properties |
| Laravel | 9.0+ | Compatible with Laravel 9, 10, 11, and 12 |
| Guzzle HTTP | 7.0+ | For API communication |
| ext-json | * | JSON processing |
| ext-openssl | * | SSL/TLS support for API calls |
Development Requirements
- PHPUnit 9.0+ or 10.0+
- Orchestra Testbench 7.0+, 8.0+, or 9.0+
- Mockery 1.4+ (for testing)
๐ Installation
1. Install via Composer
From Packagist (Recommended)
From GitHub Packages (Alternative)
See GitHub Packages Installation Guide for detailed instructions on installing from GitHub Packages.
2. Publish Configuration
3. Run Migrations
This will create the following tables:
vipps_payments- Store payment recordsvipps_recurring_agreements- Store recurring payment agreementsvipps_recurring_charges- Store individual recurring charges
4. Laravel Auto-Discovery
The package uses Laravel's auto-discovery feature. The service provider and facade will be registered automatically.
Manual Registration (if needed):
โ๏ธ Configuration
Environment Variables
Add your Vipps credentials to your .env file:
Configuration File
The package configuration is located at config/vipps.php. Key sections include:
๐ Getting Started
1. Get Vipps MobilePay Account Keys
Step-by-Step Account Setup:
- Sign up at Vipps MobilePay Portal
- Wait for approval (1-2 days) - you'll receive login details via email
- Access Developer Portal:
- Login to Vipps MobilePay Business Portal
- Navigate to "Developer" tab
- Select "Test Keys" for development or "Production Keys" for live environment
- Retrieve Credentials:
- Merchant Serial Number (MSN) - 6-digit number displayed prominently
- Client ID - Click "Show keys" to reveal
- Client Secret - Click "Show keys" to reveal
- Subscription Key - Listed as "Ocp-Apim-Subscription-Key"
Test vs Production
| Environment | Purpose | API Endpoint | Features |
|---|---|---|---|
| Test | Development & Testing | https://apitest.vipps.no |
Full API access, test cards |
| Production | Live transactions | https://api.vipps.no |
Real payments, KYC required |
2. Webhook Setup
Vipps requires a webhook endpoint for payment status updates:
Register your webhook URL in the Vipps portal:
- Format:
https://yourdomain.com/vipps/webhook - Must be HTTPS in production
- Must respond with HTTP 200 for successful processing
3. Basic Usage
ePayment (Standard Payment)
Express Checkout
Recurring Payments
๐ API Reference
Services Overview
| Service | Purpose | Key Methods |
|---|---|---|
| ePayment | Standard payments | create(), capture(), refund(), cancel() |
| Express | Quick checkout | create(), generateQrCode(), createShareableLink() |
| Checkout | Full checkout flow | create(), updateSession(), getPaymentDetails() |
| Recurring | Subscriptions | createAgreement(), createCharge(), stopAgreement() |
| OrderManagement | Payment operations | capture(), refund(), cancel(), getPaymentHistory() |
| Webhook | Event handling | handleWebhook(), verifySignature() |
ePayment Service
Create Payment
Capture Payment
Refund Payment
Express Service
Generate QR Code
Create Shareable Link
Recurring Service
Create Agreement
Order Management Service
Get Payment History
Send Receipt
๐ Webhook Handling
Setup Webhook Route
Event Listeners
Event Listener Example
Webhook Security
The package automatically verifies webhook signatures using HMAC-SHA256:
๐ญ Events
The package fires Laravel events for all major payment actions:
| Event | Trigger | Payload |
|---|---|---|
PaymentCreated |
Payment initiated | orderId, webhook payload |
PaymentCompleted |
Payment authorized/completed | orderId, webhook payload |
PaymentCancelled |
Payment cancelled | orderId, webhook payload |
PaymentCaptured |
Payment captured | orderId, webhook payload |
PaymentRefunded |
Payment refunded | orderId, webhook payload |
RecurringAgreementCreated |
Recurring agreement created | agreementId, webhook payload |
RecurringChargeCreated |
Recurring charge created | chargeId, webhook payload |
Custom Event Handling
๐งช Testing
Running Tests
Writing Tests
The package provides a comprehensive test suite. Here's how to test your Vipps integration:
Mock Vipps Responses
Test Webhook Handling
Test Environment Configuration
๐ ๏ธ Advanced Configuration
Complete Configuration Options
๐ฏ Order Management & Payment Lifecycle
Payment States & Transitions
Comprehensive Order Management
Payment Reservations & Timeouts
| Payment Method | Reservation Period | Auto-Cancel |
|---|---|---|
| Vipps | 180 days | Yes |
| MobilePay | 14 days | Yes |
| Credit Card (via Checkout) | 7 days | Yes |
โ ๏ธ Important: Capture payments before the reservation expires to avoid automatic cancellation.
โ ๏ธ Error Handling & Troubleshooting
Exception Hierarchy
Comprehensive Error Handling
Common Error Scenarios
1. Authentication Errors
2. Validation Errors
3. Order ID Conflicts
Debugging Tools
Enable Logging
View Logs
Test API Connectivity
Production Checklist
- [ ] Environment: Set
VIPPS_ENVIRONMENT=production - [ ] Credentials: Use production API keys
- [ ] HTTPS: Ensure webhook URL uses HTTPS
- [ ] Webhook: Test webhook endpoint responds with HTTP 200
- [ ] Signature: Verify webhook signature validation is enabled
- [ ] Logging: Disable detailed logging in production
- [ ] Error Handling: Implement proper error handling for all payment flows
- [ ] Monitoring: Set up alerts for payment failures
Common Issues & Solutions
| Issue | Cause | Solution |
|---|---|---|
| "Access denied" | Wrong credentials | Verify API keys in Vipps portal |
| "Invalid amount" | Amount < 100 รธre | Ensure minimum 1.00 NOK (100 รธre) |
| "Order ID exists" | Duplicate order ID | Use unique order identifiers |
| "Webhook failed" | Invalid signature | Check webhook secret configuration |
| "Payment expired" | Not captured in time | Capture within reservation period |
| "Merchant not found" | Wrong MSN | Verify Merchant Serial Number |
๐จ Frontend Integration
Express Checkout Button
The package includes a pre-built Blade component for express checkout:
Custom Frontend Implementation
React/Vue.js Integration
๐ Deployment Guide
Environment Setup
Production Environment Variables
Server Requirements
- PHP 8.1+ with extensions:
json,openssl,curl - HTTPS required for production webhooks
- Firewall: Allow outbound HTTPS (443) to
api.vipps.no - Memory: Minimum 128MB PHP memory limit
Docker Deployment
Load Balancer Configuration
Monitoring & Alerting
๐ Performance Optimization
Caching Strategy
Queue Configuration
Database Optimization
๐ Resources & References
Official Documentation
- Vipps MobilePay Developer Portal - Official API documentation
- Vipps MobilePay Business Portal - Get API credentials
- API Reference - Complete API specification
Laravel Resources
- Laravel Package Development - Official Laravel documentation
- Service Providers - Understanding Laravel service providers
- Events & Listeners - Laravel event system
Community & Support
- GitHub Issues - Bug reports and feature requests
- Discussions - Community discussions
- Stack Overflow - Q&A with the community
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Development setup
- Coding standards (PSR-12)
- Testing requirements
- Pull request process
- Code review guidelines
Quick Contribution Guide
๐ Security
Reporting Security Vulnerabilities
Please DO NOT report security vulnerabilities through public GitHub issues. Instead:
- Email security issues to: [email protected]
- Include detailed information about the vulnerability
- Allow reasonable time for response before public disclosure
Security Best Practices
- Always use HTTPS in production
- Keep webhook secrets secure and rotate regularly
- Validate all webhook signatures
- Log security events for monitoring
- Keep the package updated to latest version
๐ License
The MIT License (MIT). Please see License File for more information.
๐ Credits
Core Contributors
- Mr Dulal - Package author and maintainer
Acknowledgments
- Vipps MobilePay - For providing the payment platform and API
- Laravel Framework - For the excellent framework and ecosystem
- Solo Development - This package is built and maintained by a single developer
All versions of laravel-vipps with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/config Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
illuminate/validation Version ^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0