Magento 1 如何即时设置定期付款初始费用?



我需要在结账时设置定期付款的初始费用。这样我就可以向客户收取下订单的时间。

有谁知道如何或指出我一个方向?谢谢

首先,我需要明确表示,定期付款是针对默认Magento附带PayPal网关进行的。我的解决方案是扭曲一些方法提交RecurringProfile驻留在Mage_PayPal_Model_Pro.php中。所以我用MyCompany_ModuleName_Model_PayPal_Pro覆盖它.php这样我就可以对submitRecurringProfile进行更改而不会弄乱核心文件。

public function submitRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile,
Mage_Payment_Model_Info $paymentInfo
) {
$profile->setData('init_amount', 100);
parent::submitRecurringProfile($profile, $paymentInfo);
}

使用关于功能后,初始费用将设置为 100。

最新更新