kwhorne/wirement-vipps
Composer 安装命令:
composer require kwhorne/wirement-vipps
包简介
Laravel package for Vipps/MobilePay payment integration
README 文档
README
A Laravel package for Vipps/MobilePay payment integration designed for Laravel applications using Flux UI, Livewire, TailwindCSS, and Filament. This package provides a seamless integration with Vipps and MobilePay payment services.
Features
- 🚀 Easy Setup: Simple configuration and installation
- 💳 Payment Creation: Create Vipps payments with ease
- 🔐 Token Management: Automatic token refresh and caching
- 📡 Webhook Support: Easy webhook setup with Artisan command
- 🏗️ Laravel Integration: Full Laravel ecosystem support
- ⚡ Flux UI Compatible: Designed for Laravel Flux projects
- 🔴 Livewire Ready: Includes Livewire component examples
- 📊 Filament Integration: Ready-to-use Filament resources
- 🏛️ Modern Architecture: Clean, service-oriented design
- ⚙️ Comprehensive Config: All options in one config file
Requirements
- PHP ^8.1
- Laravel ^10.0||^11.0||^12.0
- GuzzleHttp ^7.0
- Carbon ^2.0||^3.0
Configuration
Add the following variables to your .env file:
VIPPS_CLIENT_ID=your_client_id VIPPS_CLIENT_SECRET=your_client_secret VIPPS_MERCHANT_SERIAL_NUMBER=your_merchant_serial_number VIPPS_SUBSCRIPTION_KEY=your_subscription_key VIPPS_CURRENCY=NOK VIPPS_API_URL=https://apitest.vipps.no # For testing # VIPPS_API_URL=https://api.vipps.no # For production VIPPS_RETURN_URL=https://your-site.com/payment/callback VIPPS_WEBHOOK_ID=your_webhook_id VIPPS_WEBHOOK_SECRET=your_webhook_secret
Create Webhook
To create a webhook, use the Artisan command:
php artisan vipps:webhook
This will guide you through the webhook creation process and provide you with the webhook ID and secret to add to your .env file.
Installation
You can install the package via composer:
composer require kwhorne/wirement-vipps
You can publish and run the migrations with:
php artisan vendor:publish --tag="wirement-vipps-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="wirement-vipps-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="wirement-vipps-views"
Usage
Basic Payment Creation
use Wirement\Vipps\Services\PaymentService; // Create a payment using the service $paymentService = new PaymentService(); $paymentUrl = $paymentService->generatePaymentLink( 10000, // Amount in øre (100 NOK) 'order-123' // Invoice/Order number ); // Redirect user to payment URL return redirect()->to($paymentUrl);
Payment with Order Lines
use Wirement\Vipps\Services\PaymentService; $orderlines = [ [ 'id' => '1', 'name' => 'Product name', 'quantity' => 1, 'price' => 100, // Price in NOK 'vat' => 0.25, // 25% VAT ], ]; $paymentService = new PaymentService(); $paymentUrl = $paymentService->generatePaymentLink( 10000, // Amount in øre 'order-123', // Invoice number $orderlines // Optional order lines );
Using with Livewire
use Livewire\Component; use Wirement\Vipps\Services\PaymentService; class PaymentComponent extends Component { public function createPayment() { $paymentService = new PaymentService(); $paymentUrl = $paymentService->generatePaymentLink( 5000, // 50 NOK in øre 'order-' . time() // Invoice number ); return redirect()->to($paymentUrl); } }
Using with Filament
use Filament\Resources\Resource; use Wirement\Vipps\Services\PaymentService; // In your Filament resource Tables\Actions\Action::make('create_payment') ->label('Create Vipps Payment') ->action(function ($record) { $paymentService = new PaymentService(); $paymentUrl = $paymentService->generatePaymentLink( $record->total * 100, // Convert to øre (string) $record->id // Invoice number ); $record->update(['vipps_url' => $paymentUrl]); })
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
kwhorne/wirement-vipps 适用场景与选型建议
kwhorne/wirement-vipps 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 54 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「laravel」 「integration」 「vipps」 「mobilepay」 「wirement」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kwhorne/wirement-vipps 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kwhorne/wirement-vipps 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kwhorne/wirement-vipps 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
Laravel integration for blade-to-react
The missing social authentication for thephpleague/oauth2-server, adapted from schedula/league-oauth2-social
Magento 2 Integration Suite
This library is an integration of `codekandis/authentication` into `codekandis/tiphy`.
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-06