Magento 多个 Authorize.net 网关

发布于 2024-10-19 03:02:17 字数 302 浏览 3 评论 0原文

我见过这个关于货币类型的问题,但我要问的是如何在同一商店为不同的信用卡类型配置第二个 Authorize.net 帐户。因此,我们希望一些信用卡使用第一个主 Authorize.net 网关,而其他信用卡使用辅助 Authorize.net 帐户,以便付款可以路由到两个不同的银行帐户。这是为了和解的目的,也是一种约束;无法修改。

我认为我需要做的就是弄清楚订单提交后(但在通过 API 发送到 Authorize.net 之前)它是什么卡类型,以了解要传递给 API 的凭据,但是我不确定在哪里添加此代码,或者添加它的最佳方式。

任何见解或建议将不胜感激。

I've seen this question asked with regard to currency type, but what I am asking is how to configure a second Authorize.net account on the same store for a different credit card type. So, we want some credit cards to use the first main Authorize.net gateway, but the others to use the secondary Authorize.net account so that the payments can be routed into two different bank accounts. This is for purposes of reconciliation and is a constraint; can't be modified.

I'm figuring that all I need to do is figure out once the order has been submitted (but before it has been sent via API to Authorize.net) which card type it is, to know which credentials to pass to the API, but I'm unsure as to where to add this code, or the best way in which to add it.

Any insight or advice would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╄→承喏 2024-10-26 03:02:17

默认情况下,无法完成此操作,因此您需要使用一些自定义代码。具体来说,重写 Authnet 支付类 Mage_Paygate_Model_Authorizenet

class MyNamespace_MyModule_Model_Authorizenet extends Mage_Paygate_Model_Authorizenet {

  /**
   * Prepare request to gateway
   *
   * @link http://www.authorize.net/support/AIM_guide.pdf
   * @param Mage_Sales_Model_Document $order
   * @return unknown
   */
  protected function _buildRequest(Varien_Object $payment) 
     //see below
  }
}

在该函数中,在第 277 行,执行以下代码来设置 Authnet 帐户:

    $request->setXLogin($this->getConfigData('login'))
        ->setXTranKey($this->getConfigData('trans_key'))
        ->setXType($payment->getAnetTransType())
        ->setXMethod($payment->getAnetTransMethod());   

相反,您需要按照以下方式进行操作:

if(whatever cc type) {
     // set alternate gateway
} else {
     // set default gateway
}

要完成此操作,您还需要在后端创建新选项以加密形式保存凭据。希望有帮助!

谢谢,

By default, there is no way to accomplish this, so you'll need to use some custom code. Specifically, override the Authnet payment class Mage_Paygate_Model_Authorizenet:

class MyNamespace_MyModule_Model_Authorizenet extends Mage_Paygate_Model_Authorizenet {

  /**
   * Prepare request to gateway
   *
   * @link http://www.authorize.net/support/AIM_guide.pdf
   * @param Mage_Sales_Model_Document $order
   * @return unknown
   */
  protected function _buildRequest(Varien_Object $payment) 
     //see below
  }
}

In that function, on line 277 for me, the following code is executed to set the Authnet account:

    $request->setXLogin($this->getConfigData('login'))
        ->setXTranKey($this->getConfigData('trans_key'))
        ->setXType($payment->getAnetTransType())
        ->setXMethod($payment->getAnetTransMethod());   

Instead, you want something along these lines:

if(whatever cc type) {
     // set alternate gateway
} else {
     // set default gateway
}

To accomplish this, you'll also want to create new options in the backend to hold the credentials in an encrypted form. Hope that helps!

Thanks,
Joe

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文