test-magenx/module-instant-purchase

不适用

安装: 0

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:magento2-module

100.4.2 2021-10-10 22:16 UTC

README

即时购买功能允许客户在几秒钟内下订单,而无需经过完整的结账流程。一旦点击,系统就会使用默认的收货和账单地址以及存储的支付方式来下订单。订单一旦生成,客户就会在通知区域收到确认消息。

显示即时购买按钮的先决条件

  1. 商店 / 配置 / 销售 / 销售 / 即时购买 为商店启用即时购买
  2. 客户已登录
  3. 客户已定义默认的收货和账单地址
  4. 客户有支持即时购买的有效的存储支付方式

结构

除了 典型的 Magento 2 模块文件结构 之外,PaymentMethodsIntegration 目录包含集成到即时购买的基本实现接口和接口。

可扩展性

即时购买定制

几乎可以定制即时购买的所有方面。请参阅带有 @api 标记的类和接口的注释。

为即时购买创建的所有支付也包含 'instant-purchase' => true 的附加信息。只有在所有其他定制点都不适用的情况下才使用此功能。

支付方式集成

可以为任何具有 安全存储支持 的支付方式实现即时购买支持。在大多数情况下,提供的 Magento\InstantPurchase\PaymentMethodIntegration 的基本实现应该足够。默认情况下未启用,以避免生产站点上的问题,并且安全支付方式的所有者应手动验证即时购买的正确工作。要启用基本实现,只需在 config.xml 中添加一个选项即可。

<instant_purchase>
    <supported>1</supported>
</instant_purchase>

基本实现是一个良好的起点,但建议提供自己的实现以提高用户体验。如果即时购买集成有定制,则不需要 supported 选项。

<instant_purchase>
    <available>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\AvailabilityCheckerInterface</available>
    <tokenFormat>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\PaymentTokenFormatterInterface</tokenFormat>
    <additionalInformation>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\PaymentAdditionalInformationProviderInterface</additionalInformation>
</instant_purchase>
  • Magento\InstantPurchase\PaymentMethodIntegration\AvailabilityCheckerInterface - 允许程序定义是否支持即时购买(例如,如果某些支付方式选项被打开/关闭,则可能不支持)。基本实现始终返回 true
  • Magento\InstantPurchase\PaymentMethodIntegration\PaymentTokenFormatterInterface - 创建描述存储支付方式的字符串。基本实现返回支付方式名称。强烈建议实现自己的格式化程序。
  • Magento\InstantPurchase\PaymentMethodIntegration\PaymentAdditionalInformationProviderInterface - 允许向支付附加信息数组添加一些额外值。默认实现返回空数组。

附加信息

向后不兼容的更改

Magento_InstantPurchase 模块没有引入向后不兼容的更改。

您可以在修补程序版本中跟踪 向后不兼容的更改

此模块最初由 Creatuity Corp.Magento 社区工程团队 开发。