首页 > 解决方案 > Magento 1 如何即时设置定期付款初始费用?

问题描述

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

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

标签: magento-1.9recurring-billing

解决方案


首先,我需要明确指出,定期付款是针对默认 Magento 附带的贝宝网关进行的。我的解决方案是扭曲一些方法submitRecurringProfile驻留在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);
}

启用about功能后,初始费用将设置为100。


推荐阅读