magenxcommerce/module-instant-purchase

N/A

安装: 105

依赖: 3

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:magento2-module


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 社区工程团队 开发。