承接 craftcms/commerce-paypal-checkout 相关项目开发

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

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

craftcms/commerce-paypal-checkout

Composer 安装命令:

composer require craftcms/commerce-paypal-checkout

包简介

PayPal Checkout integration for Craft Commerce 5.0+

README 文档

README

PayPal Checkout for Craft Commerce icon

PayPal Checkout for Craft Commerce

This plugin provides a PayPal Checkout gateway integration for Craft Commerce.

Requirements

This plugin requires Craft 5.0 and Craft Commerce 5.0 or later.

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 “PayPal Checkout for Craft Commerce”. Then click Install in the plugin’s modal window.

With Composer

Open your terminal and run the following commands:

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

# tell Composer to load the plugin
composer require craftcms/commerce-paypal-checkout

# tell Craft to install the plugin
php craft plugin/install commerce-paypal-checkout

Setup

Creating PayPal REST API Credentials

The following steps are from the PayPal guide on how to create REST API credentials.

REST API credentials include a client ID and secret. Here's how you generate the credentials:

  1. Log in to the PayPal Developer Portal using the same credentials you use for PayPal.
  2. On the My Apps & Credentials page, click Live or Sandbox depending on whether you need an app for testing (Sandbox) or going live (Live).
  3. Click Create App under REST API apps. Any previously created REST API apps will appear in the table above the Create App button.
  4. Enter the name of your REST API app in the App Name field, and select a Sandbox business account to associate with your app. Note: Remember that you can't use a Live credit card in Sandbox, and you can't use a test credit card in your Live account.
  5. Click Create App.
  6. Your credentials, the client ID and secret, are displayed on the app details page that displays after you click Create App.
  7. Request permissions for REST API features that apply to your integration:
    • PayPal payments

You will now be able to see the client ID and secret for your newly created app.

When you are ready to take your code live, make sure you create a Live app to get live credentials.

Use the Live and Sandbox toggle at the top of My Apps & Credentials to switch between app types and view your credentials for each.

Creating PayPal Checkout Gateway in Commerce

To add the PayPal Checkout gateway, go to CommerceSettingsGateways, create a new gateway, and set the gateway type to “PayPal Checkout”.

In the gateway settings, enter the client ID and secret for your REST app in their respective fields.

Cart Info / Cost Breakdown

Turning on the Send Cart Information setting for this gateway will send cart items and cost breakdown through to PayPal.

Note: If you’re using deprecated custom adjuster types, this setting will need be turned off.

Paying with Non-Primary Currency

When using the getPaymentFormHtml() method (e.g. cart.gateway.getPaymentFormHtml({})) and allowing payment in a currency other than the primary currency, you must pass the currency ISO in the method params.

For example, if you’ve already set the alternative payment currency on the cart you could do the following:

{{ cart.gateway.getPaymentFormHtml({
  currency: cart.paymentCurrency
}) }}

This is required when paying with an alternative payment currency due to the integration of the PayPal JavaScript SDK.

SDK Query String Parameters

This gateway allows passing specific query string parameters at runtime, as specified in the PayPal documentation.

The allowed parameters are currency (as detailed above), disable-card, disable-funding, enable-funding, locale and components.

Warning

When using the components parameter, you must ensure you include the buttons component, otherwise the PayPal buttons will not render.

For example, to disable PayPal credit funding you could output the payment form as follows:

{{ cart.gateway.getPaymentFormHtml({
  ...
  'disable-funding': 'credit'
  ...
}) }}

craftcms/commerce-paypal-checkout 适用场景与选型建议

craftcms/commerce-paypal-checkout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32.78k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 10 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「checkout」 「paypal」 「commerce」 「yii2」 「craftcms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 craftcms/commerce-paypal-checkout 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-30