承接 webdna/commerce-affirm 相关项目开发

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

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

webdna/commerce-affirm

最新稳定版本:1.0.5

Composer 安装命令:

composer require webdna/commerce-affirm

包简介

Affirm integration for Craft Commerce 4+

README 文档

README

icon

Affirm for Craft Commerce

Requirements

This plugin requests Craft 4.x and Craft Commerce 4.x

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Affirm”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project

# tell Composer to load the plugin
composer require webdna/commerce-affirm

# tell Craft to install the plugin
./craft install/plugin commerce-affirm

Setup

To add an Affirm payment gateway, go to Commerce → Settings → Gateways, create a new gateway.

Enter the Public & Private API keys (environmental variable are recommended) and a product key if you have one.

Usage

On the payment page, use the getPaymentFormHtml method passing in a few parameters.

{% set params = {
  cancelUrl: siteUrl('/shop/checkout/payment'),
  confirmationUrl: siteUrl('/shop/checkout/order', {number: cart.number, success:'true'}),
  mode: 'modal',
} %}
{% namespace cart.gateway.handle|commercePaymentFormNamespace %}
	{{ cart.gateway.getPaymentFormHtml(params)|raw }}
{% endnamespace %}

Parameters

automatic : automatically launches the payment modal otherwise show a button to launch it. (default: 'true')

cancelUrl : the url to return to if the process is cancelled. (only used in 'redirect' mode)

confirmationUrl : the url to return to on a successful application. (only used in 'redirect' mode)

mode : 'modal' or 'redirect' (default: 'modal')

showStatus : show the status updates, processing etc. (default: false)

Modal callbacks:

onFail, onSuccess, onOpen, onValidationError

if you pass in the onSuccess callback, you will need to handle setting the token input with the received e.checkout_token and submitting the form.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2022-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固