peachpayments/magento2-plugin
Composer 安装命令:
composer require peachpayments/magento2-plugin
包简介
PeachPayments Hosted Magento 2 module, all-in-one payment solution for emerging African markets.
README 文档
README
All-in-One payment solution for emerging African markets.
Installation (composer)
-
Install Composer - Composer Download Instructions
-
Install PeachPayments Hosted module
-
Install Payment Module
$ composer require peachpayments/magento2-plugin
-
Enable Payment Module
$ php bin/magento module:enable PeachPayments_Hosted
$ php bin/magento setup:upgrade
-
Deploy Magento Static Content (Execute If needed)
$ php bin/magento setup:static-content:deploy
-
Configuration
- Login to the Admin Panel and go to
Stores->Configuration->Sales->Payment Methods - If the Payment Module Panel
Peach Paymentsis not visible in the list of available Payment Methods, go toSystem->Cache Managementand clear Magento Cache by clicking onFlush Magento Cache - Go back to
Payment Methodsand click the buttonConfigureunder the payment methodPeach Paymentsto expand the available settings - Set
EnabledtoYes, set the correct credentials, select your preferred settings and clickSave config
PHP Compatibility
Module only support these PHP versions: 7.3 and 7.4 (PHP 7.1 and 7.2 has been depreciated, please use version 1.0.7, this excludes GraphQL)
Events
There are two events available for usage to supplement your 3rd party tracking. On order success you can use peachpayments_order_succeed, on order failure use peachpayments_order_failed. Both events will have a data object as: result. Please take special care to prevent duplicates in your observer. These events will be dispatched on both the customer facing and webhook controllers.
GraphQL
To allow for a graphql flow, please use the core magento setPaymentMethodOnCart and placeOrder methods.
After a successful order id has been returned use the method getPeachHostedRedirectUrl to redirect the customer to
the checkout page (at this stage the order should be on the pending state). Deconstruct the json object from form_data
and submit as _POST parameters to the specified form_link url.
After the customer has returned to the return_url you specified, do a call to the method getPeachHostedOrderStatus
to get a success (1) or declined (2) status, retry on an interval if the status code is 3.
Examples:
# set peach as payment method mutation setPaymentMethodOnCart($cartId: String!){ setPaymentMethodOnCart(input: { cart_id: $cartId payment_method: { code: "peachpayments_hosted_card" } }) { cart { selected_payment_method { code } } } } # place order mutation placeOrder($cartId: String!) { placeOrder(input: {cart_id: $cartId}) { order { order_number } } } # Get redirect url and data query getPeachHostedRedirectUrl($cartId: String!){ getPeachHostedRedirectUrl(input: { cart_id: $cartId, return_url: "https://my.app.pwa/payment/welcome-back.html" }) { form_data form_link } } # Get staus query getPeachHostedOrderStatus($orderId: String!){ getPeachHostedOrderStatus(input: { order_id: $orderId }) { status } }
peachpayments/magento2-plugin 适用场景与选型建议
peachpayments/magento2-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 42.87k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 02 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 peachpayments/magento2-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 peachpayments/magento2-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 42.87k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-02-10