定制 payfabric/module-payment 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

payfabric/module-payment

Composer 安装命令:

composer require payfabric/module-payment

包简介

PayFabric Payment Gateway

README 文档

README

Requires Magento version 2.4.3 or higher.

Requires an active PayFabric account. Development can be done on a PayFabric Sandbox account. PayFabric is an EVO Payments processing platform.

Description

PayFabric gateway extension allows you to add PayFabric payment processing capabilities into Magento 2.4.3 or higher without any custom coding.

Display Modes

The plugin offers three modes to present the Hosted Payment Page:

  • Dialog
  • Iframe
  • Redirect

Alternative Payment Methods

Alternative Payment Methods supported by each display mode:

Payment Method Dialog Iframe Redirect
Apple Pay
Google Pay
PayPal/Venmo

Installation

Before installing please take a full backup of your website.

Manual Installation

  1. Download the extension zip file.
  2. Unzip the extension and upload the PayFabric folder to your Magento root directory app/code (create folder if not exists) via FTP/SSH.
  3. Enable the extension and clear the static view files by running the command:
    bin/magento module:enable PayFabric_Payment --clear-static-content
    
  4. Register the extension and initiate the database migrations by running the command:
    bin/magento setup:upgrade
    
  5. Recompile the Magento project by running the command:
    bin/magento setup:di:compile
    
  6. Clear the Magento store’s cache by running the command:
    bin/magento cache:flush
    

Install with Composer

  1. Run from Magento root folder:
    composer require payfabric/module-payment
    
  2. Enable the extension and clear the static view files by running the command:
    bin/magento module:enable PayFabric_Payment --clear-static-content
    
  3. Register the extension and initiate the database migrations by running the command:
    bin/magento setup:upgrade
    
  4. Recompile the Magento project by running the command:
    bin/magento setup:di:compile
    
  5. Clear the Magento store’s cache by running the command:
    bin/magento cache:flush
    

Configuration

In the PayFabric Portal, prepare a device with a default gateway configured.

  1. Go to Settings > Dev Central > Device Management to create a device to obtain the Device ID and Password.
  2. Go to Settings > Gateway Account Configuration, click '+ New Gateway Account' if the payment gateway account is not associated to an existing PayFabric account, and then set the default gateway under Default Gateway Settings. Please refer to the user guide in PayFabric.
  3. If you enable the eCheck Gateway Account, you can customize the eCheck payment UI to default the Entry Class to ‘WEB’ and hide it by adding the following custom JS in the PayFabric theme (please refer to PayFabric Themes):
    $(function(){
        $(".entryClassDiv").hide();
        $("#EntryClass option").each(function(){if(this.value == 'WEB') this.selected = true; else this.selected = false;});
    });

In your Magento account:

  • Go to STORES > Configuration > Sales > Payment Methods to enter your gateway and device data. image
  • Select your Display Mode. When using "Iframe" as your Display Mode, you must create a theme to add the following custom JS and configure this theme as default theme in the PayFabric Portal (please refer to PayFabric Themes). Please don't do that for other display modes which will affect your payment UI.
    $(".BillingContent").hide();
    $("#payButton").hide();
    typeof (receiveMessage) !== "undefined" && window.removeEventListener("message", receiveMessage, false);
    var receiveMessage = function (event) {
        var data = event.data;
        if (data.match("^\\{(.+:.+,*){1,}\\}$"))  data = $.parseJSON(data);
        if (data.action == 'pay') {
            typeof (data.BillCountryCode) !== "undefined" && $("#BillCountryCode").val($("#BillCountryCode").find("option[value^=" + data.BillCountryCode + "]").val()).trigger('change');
            typeof (data.BillAddressLine1) !== "undefined" && $("#BillAddressLine1").val(data.BillAddressLine1);
            typeof (data.BillAddressLine2) !== "undefined" && $("#BillAddressLine2").val(data.BillAddressLine2);
            typeof (data.BillCityCode) !== "undefined" && $("#BillCityCode").val(data.BillCityCode);
            typeof (data.BillStateCode) !== "undefined" && $(".state").val($("#BillStateCode").find("option[value^=" + data.BillStateCode + "]").val() || data.BillStateCode);
            typeof (data.BillZipCode) !== "undefined" && $("#BillZipCode").val(data.BillZipCode);
            $("#payButton").click();
        }
    }
    window.addEventListener("message", receiveMessage, false);
  • Next, select your Payment Action. Select "Sale" for a normal website purchase transaction. This is the default option and automatically executes both the authorization and capture for the transaction. The funds from this transaction will be included in your next batch settlement.
    • If you choose "Authorization", see the Capture instructions below.
  • Click "Save Config".
  • Go to System > Cache Management to flush Magento cache. image
  • When using "Authorization" as your Payment Action, you must “Capture” the transaction when the sale has been completed. If you do not “Capture” the Authorization, no funds will be settled as the transaction is not complete.
    • To capture an authorized transaction: Click on the "Invoice" button at the top right side. image
    • On the Invoice page, scroll down to the bottom, choose "Capture Online" from the dropdown menu, and click on the "Submit Invoice" button. image
    • When using "Authorization" as your Payment Action, you may “Void” a transaction when the order has been cancelled before being captured. Click on the "Void" or "Cancel" button at the top right side. image
  • To refund a sale or captured transaction directly on Magento: Open the invoice of the captured order. image
    • Then click on "Credit Memo" on the top right side menu. image
    • On the credit memo page, click "Refund". image

Support

Have a question or need help? Contact support@payfabric.com

payfabric/module-payment 适用场景与选型建议

payfabric/module-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.08k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 04 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 payfabric/module-payment 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 4
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2022-04-06