ActiveMerchant 定期付款 - 周期参数没有影响?

ActiveMerchant recurring payment - cycles parameters has no effects?

我正在使用 ActiveMerchant 处理定期付款。我希望付款的发生次数有限,但即使我传递了 'cycles' 参数,当我去沙盒网站查看我的交易结果时,我的付款也没有结束或任何发生次数有限的痕迹??

这是我的网关定义:

  config.after_initialize do
    ActiveMerchant::Billing::Base.mode = :test
    paypal_options = {
        login: "my_api.ca",
        password: "QNBW72G3Q999999",
        signature: "AFcWxV21C7fd0v3bYYYRCpSSRl31AmVtuyteuytuetwuytwtwEyY5cTGMA"
    }
    ::MY_PAYMENT_GATEWAY = ActiveMerchant::Billing::PaypalCaGateway.new(paypal_options)
  end

这是我处理定期付款的代码:

response = MY_PAYMENT_GATEWAY.recurring(amount,
                                         @publisher.credit_card.active_merchant_credit_card,
                                         {:ip => request.remote_ip,
                                          :email => current_publisher.user.email,
                                          :period => 'Month',
                                          :frequency => 1,
                                          :cycles => @chosen_package.duration.to_i,
                                          :start_date => Time.now.to_date,
                                          :description => "Try to pay only @chosen_package.duration times !? "})

我的理解是 'cycles' 参数应该反映为沙盒测试站点中的最大收费数量,但我被卡住了...就像它不起作用一样!?

感谢任何帮助!非常感谢!

塞尔吉

我通过深入研究 ActiveMerchant 源找到了它...好的参数名称是 :total_billing_cycles,而不是我所拥有的文档中所述的 :cycles ...

现在像魅力一样工作:-)