承接 99x/craft-vipps-suite 相关项目开发

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

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

99x/craft-vipps-suite

Composer 安装命令:

composer require 99x/craft-vipps-suite

包简介

A Vipps Suite plugin for CraftCMS

README 文档

README

A Vipps Suite plugin for CraftCMS. Supports recurring subscription agreements and one-time payments without requiring Craft Commerce.

Installation

Install via Composer:

composer require 99x/craft-vipps-suite

Then install the plugin in Craft:

./craft plugin/install vipps-suite

Configuration

  1. Navigate to Settings > Plugins > Vipps Suite in the Craft CMS Control Panel
  2. Configure the following credentials (preferably using environment variables):
    • Client ID: $VIPPS_CLIENT_ID
    • Client Secret: $VIPPS_CLIENT_SECRET
    • Merchant Serial Number (MSN): $VIPPS_MERCHANT_SERIAL_NUMBER
    • Subscription Key (Primary): $VIPPS_SUBSCRIPTION_KEY_PRIMARY
    • Subscription Key (Secondary): $VIPPS_SUBSCRIPTION_KEY_SECONDARY

Environment Variables

Add these to your .env file:

# Required - OAuth credentials
VIPPS_CLIENT_ID=your_client_id_here
VIPPS_CLIENT_SECRET=your_client_secret_here

# Required - Merchant Serial Number
VIPPS_MERCHANT_SERIAL_NUMBER=your_msn_here

# Required - Subscription API keys
VIPPS_SUBSCRIPTION_KEY_PRIMARY=your_primary_key_here
VIPPS_SUBSCRIPTION_KEY_SECONDARY=your_secondary_key_here

# Optional - Vipps API base URL (defaults to production)
VIPPS_BASE_URL=https://api.vipps.no

# Optional - System information for Vipps API headers
VIPPS_SYSTEM_NAME=Craft CMS
VIPPS_SYSTEM_VERSION=4.14.15
VIPPS_SYSTEM_PLUGIN_NAME=Vipps Suite
VIPPS_SYSTEM_PLUGIN_VERSION=1.0.0

Docker / DDEV Development Setup

# Run code quality checks
ddev composer test

# Fix code style issues
ddev composer fix-cs

# Run PHPStan only
ddev composer phpstan

# Run ECS only
ddev composer check-cs

Requirements

Current Environment:

  • Craft CMS 4.14.0 or later
  • PHP 8.0.2 or later
  • MySQL 8.0.32 or later

Target Compatibility:

  • Craft CMS 5.x (code is written to be forward-compatible)
  • PHP 8.2+ (code is written to be forward-compatible)
  • MySQL 8.x (already compatible)

Additional Requirements:

  • Vipps merchant account
  • Vipps API credentials (Client ID, Client Secret, Subscription Keys, MSN)

Note: While the plugin is developed on Craft CMS 4 and PHP 8.0.2, all code is written to be compatible with Craft CMS 5 and PHP 8.2 to ensure smooth future upgrades. See Forward Compatibility Guidelines for details.

Getting Vipps Credentials

  1. Sign up for a Vipps merchant account
  2. Access the Vipps Developer Portal
  3. Create an application to get OAuth credentials (Client ID and Client Secret)
  4. Obtain Subscription API keys (Primary and Secondary)
  5. Get your Merchant Serial Number (MSN) from the Vipps MobilePay business portal

Vipps Login Setup

The plugin includes a complete Vipps Login integration that allows users to authenticate using their Vipps account.

Using Vipps Suite in Templates

The plugin provides a global Twig variable vippsSuite that you can use in any template:

Vipps Login:

{# Simple login link with default redirects #}
<a href="{{ vippsSuite.loginUrl() }}">Login with Vipps</a>

{# Login link with custom redirect URLs #}
<a href="{{ vippsSuite.loginUrl('/', '/?login=failed') }}">
    Login with Vipps
</a>

{# Conditional display based on login status #}
{% if currentUser is null %}
    <a href="{{ vippsSuite.loginUrl('/', '/?login=failed') }}">
        Login with Vipps
    </a>
{% else %}
    <a href="{{ url('/logout') }}">Logout</a>
{% endif %}

Agreement Templates:

{# Link to agreement templates page #}
<a href="{{ vippsSuite.agreementTemplatesUrl() }}">View Agreement Templates</a>

{# With custom redirect URLs #}
<a href="{{ vippsSuite.agreementTemplatesUrl('/', '/?agreement=failed') }}">
    View Agreement Templates
</a>

Check Active Agreement:

{# Check if current user has an active agreement #}
{% if vippsSuite.hasActiveAgreement() %}
    <p>You have an active agreement!</p>
    {# Show agreement content #}
{% else %}
    <p>You don't have an active agreement.</p>
    <a href="{{ vippsSuite.agreementTemplatesUrl() }}">View Templates</a>
{% endif %}

{# Combine with user check #}
{% if currentUser and vippsSuite.hasActiveAgreement() %}
    {# Show premium content #}
{% endif %}

Donations:

{# Link to donations page #}
<a href="{{ vippsSuite.donationsUrl() }}">Make a Donation</a>

Unified Form:

{# Link to unified form page (supports both agreements and payments) #}
<a href="{{ vippsSuite.unifiedFormPageUrl() }}">Become a Donor</a>

{# Form submission URL #}
<form action="{{ vippsSuite.unifiedFormUrl() }}" method="post">
    {{ csrfInput() }}
    <input type="hidden" name="type" value="agreement">
    <input type="hidden" name="amount" value="10000">
    <button type="submit">Subscribe</button>
</form>

Vipps Login Flow

  1. User clicks the login link generated by vippsSuite.loginUrl()
  2. User is redirected to Vipps authorization page
  3. User authenticates with Vipps
  4. Vipps redirects back to your site
  5. Plugin automatically creates or links the user account
  6. User is logged into Craft CMS
  7. User is redirected to the success URL (or error URL if login failed)

Next Steps

After installation and configuration:

  1. Configure Vipps Login callback URI in your Vipps portal
  2. Add Vipps Login button to your templates using vippsSuite.loginUrl()
  3. Create agreement templates in Vipps Suite > Agreement Templates
  4. Set up agreement template selection pages
  5. Configure webhook endpoints for agreement callbacks
  6. Set up charge scheduling for recurring payments

For detailed information, see the Product Context and Technical Context documentation.

99x/craft-vipps-suite 适用场景与选型建议

99x/craft-vipps-suite 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 99x/craft-vipps-suite 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-04-01