payplug/payplug-magento2

为 Magento 2 定制的 Payplug 支付模块

安装次数: 21,290

依赖项: 0

建议者: 0

安全性: 0

星标: 5

关注者: 8

分支: 3

开放性问题: 7

类型:magento2-module

4.0.0 2024-09-04 07:33 UTC

README

安装

通过 Magento 后台办公室安装

您可以根据https://devdocs.magento.com/guides/v2.3/comp-mgr/extens-man/extensman-main-pg.html中提供的 Magento 指示进行操作

通过 composer 安装

Composer

如何获取 Composer: 请遵循https://getcomposer.org.cn/download/上的说明

如何更新您的 Composer 版本: 请遵循https://getcomposer.org.cn/doc/03-cli.md#self-update-selfupdate-上的说明

安装

在 Magento 根目录中运行以下命令

composer require payplug/payplug-magento2  # (*)
composer install
php bin/magento module:enable Payplug_Payments --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy <languages>  # (**)(***)
php bin/magento cache:clean

(*) 如果您在安装 Magento 2 时没有保存它们,此命令将要求您输入 Magento 身份验证密钥 (https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html)。登录 = 公钥 密码 = 私钥

(**) 使用语言选项,您可以定义您想要为哪种语言生成静态内容。语言应以空格分隔。例如,要为 en_US 和 fr_FR 本地化生成内容,您可以运行以下命令

php bin/magento setup:static-content:deploy en_US fr_FR

(***) 如果您不在生产模式下运行,请使用 --force 选项。否则,命令将失败。例如,要为 locales en_US 和 fr_FR 生成内容,您可以运行以下命令

php bin/magento setup:static-content:deploy --force en_US fr_FR  # --force # if you are not running on production mode

故障排除

如果在安装过程中遇到缺少类错误消息

[ReflectionException] Class Payplug\Authentication does not exist

这可能是由于未与 Magento 模块一起安装 Payplug PHP 库。如果您没有运行 composer 来安装模块,则可能会发生这种情况。要修复它,您应该使用 composer 请求缺失的依赖项

composer require payplug/payplug-php:^3.0

然后您需要安装另一个库,我们使用它来规范化客户的电话号码

composer require giggsey/libphonenumber-for-php:^8.10

更新 Payplug 支付模块

在 Magento 根目录中运行以下命令

composer require --update-with-all-dependencies payplug/payplug-magento2:VERSION_YOU_WANT_TO_UPDATE_TO  # (*)
composer install
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy <languages>  # (**)
php bin/magento cache:clean

(*) 要确定 VERSION_YOU_WANT_TO_UPDATE_TO 的值,您可以查看我们的最新发布。例如,您可以运行

composer require --update-with-all-dependencies payplug/payplug-magento2:^1.5

(**) 使用语言选项,您可以定义您想要为哪种语言生成静态内容。语言应以空格分隔。例如,要为 en_US 和 fr_FR 本地化生成内容,您可以运行以下命令

php bin/magento setup:static-content:deploy en_US fr_FR