【问题标题】:How does a Magento Payment Method Module integrate with the site's back-endMagento 支付方式模块如何与网站的后端集成
【发布时间】:2010-11-28 07:23:21
【问题描述】:
我找到了this related question,这证实了我的很多想法,但还有一个问题;自定义支付模块如何与商店的数据库集成?
我正在开发一种自定义付款方式,可将用户转移到一个安全站点,该站点由澳大利亚的一家银行托管,负责处理信用卡交易。对于这个模块,我需要将信息传递到银行网站,并在交易完成后取回信息。
当然,我不希望在事务完成之前发生任何数据库更新,那么我该如何配置我的方法来
- 停止数据库更新
- 从银行传回交易确认信息后更新数据库
【问题讨论】:
标签:
php
sql
magento
module
payment-gateway
【解决方案1】:
我不知道它是如何处理的,但我会看看 Magento 自己的类似支付网关(如 Google Checkout 或 Paypal)的实现。它们的工作方式与您为付款处理器描述的方式相似。
【解决方案2】:
您需要根据您从支付网站获得的响应更新订单历史记录/cmets。
$order = Mage::getModel('sales/order');
if ($response['SUCCESS'] == 'Y') {
$order->addStatusToHistory($order->getStatus(), Customer successfully returned from payment website');
}
希望它会有所帮助。