furbo / craft-commerce-wallee
Wallee 商业支付网关
5.0.5
2024-08-02 09:44 UTC
Requires
- php: ^8.2
- craftcms/cms: ^5.0.0
- craftcms/commerce: ^5.0.0
- wallee/sdk: ^3.1.4
- dev-craft-v5
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 2.3.16
- 2.3.15
- 2.3.14
- 2.3.13
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3
- 2.2.19
- 2.2.18
- 2.2.17
- 2.2.16
- 2.2.15
- 2.2.13
- 2.2.12
- 2.2.11
- 2.2.10
- 2.2.8
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.1
- 2.0.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-craft-v4
- dev-Subscriptions
- dev-simple-tax-handling
- dev-craft-v3
This package is auto-updated.
Last update: 2024-10-02 10:15:24 UTC
README
Wallee & Postfinance
此插件为 Wallee 或 Postfinance Flex 提供了与 Craft Commerce 的集成。
将 Wallee/Postfinance 添加为您的 craft commerce 安装中的支付网关。此插件允许配置许多支付方式,例如
- 信用卡
- Postfinance
- Twint
- Apple Pay
- Google Pay
- PayPal
- Klarna
- Boncard
- Luncheck
- ...
可配置模式
在弹窗、iframe 和全页集成模式之间进行选择。
适用于 Craft 3、4 和 5 的软件包。
Wallee 状态变化可以动态映射到 craft commerce 订单状态。
需求
- Craft CMS 4.0 或更高版本
- Craft Commerce 4.0 或更高版本
安装
您可以从插件商店或使用 Composer 安装此插件。
从插件商店
转到项目控制面板中的插件商店,搜索“Wallee for Craft Commerce”,然后在插件的模态窗口中选择 安装。
使用 Composer
打开您的终端并运行以下命令
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require furbo/craft-commerce-wallee # tell Craft to install the plugin php craft install/plugin craft-commerce-wallee
Wallee 设置
- 在 Wallee 或 Postfinance 创建新账户
- 从左侧菜单转到 Space 并创建新的 Space,然后复制 Space ID。
- 在账户详情中,创建新的应用程序用户并复制 API 密钥和 API 密码到安全的地方。
- 转到新的应用程序用户,并在角色部分添加“Account Admin”角色。
- 转到 Space > 配置 > 处理器并配置处理器以添加您想要使用的支付方式(Paypal、Twint 等)。
- 转到 Webhooks > URL 选项卡并创建 webhook URL。添加您网站的 URL(您可以在创建网关时从 Craft 复制)。
- 转到 Webhooks > 监听器选项卡并创建 webhook 监听器。在实体中选择“Transaction”,在实体状态中选择所有状态。在 URL 中选择您在上一步骤中创建的 webhook URL。
- 转到 craf 后端中的插件设置,并将 Wallee/Postfinance 状态映射到订单状态。
Craft 设置
- 转到 Commerce > 系统设置 > 网关并创建新的网关。
- 选择 Wallee 作为网关类型。
- 输入您在 Wallee 设置中复制的 Space ID、API 密钥和 API 密码。
- 选择您想要使用的集成模式(弹窗、iframe 或页面) 更多详情。
- 创建网关后,您可以在 Wallee 设置中看到您需要使用的 Webhook URL。
<form method="post" accept-charset="UTF-8"> {{ csrfInput() }} {{ actionInput('commerce/payments/pay') }} {{ hiddenInput('gatewayId', cart.gatewayId) }} {% set params = { successUrl: '/checkout/success?number=' ~ cart.number, cancelUrl: '/checkout/cancel?number=' ~ cart.number, paymentButtonSelector: '#wallee-lightbox', } %} {# Commerce 3 #} {{ cart.gateway.getPaymentFormHtml(params)|raw }} {# Commerce 4 and 5 #} {% namespace cart.gateway.handle|commercePaymentFormNamespace %} {{ cart.gateway.getPaymentFormHtml(params)|raw }} {% endnamespace %} </form>
参数 paymentButtonSelector: '#wallee-lightbox' 是可选的,仅在您想点击按钮时打开弹窗时需要。如果您不使用此参数,则在页面加载时弹窗将自动打开。对于 iframe 和页面集成不是必需的。
如何在craft后端订单列表中显示Wallee交易ID?
- 前往 commerce > 订单 > 点击齿轮图标 > 自定义来源。
- 在“默认表列”中添加“交易”列并保存。