Rails 4 activemerchant> 1.5 for Paypal Pro订阅卡选项

时间:2016-01-17 19:41:51

标签: ruby-on-rails paypal paypal-subscriptions activemerchant

作为activemerchant这样一个受欢迎的宝石,我敢打赌,在tutorial之后我发现的弃用有多个解决方案。最终目标是使用pp帐户和卡片与Paypal建立订阅。

问题始于GATEWAY在development.rb上调用PaypalGateway

config.after_initialize do
    ActiveMerchant::Billing::Base.mode = :test
    ::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
       login: "my_login_name.my_company",
       password: "MYPASSWORD",
       signature: "The-Long--Special_signature_from_paypal"
    )
  end

订阅控制器然后触发模型卡中的购买方法。

def purchase
    response = GATEWAY.recurring(price_in_cents, credit_card, purchase_options)
    create_card_transaction(action: "purchase", amount: price_in_cents, response: response)
    suscription.update_attribute(:purchased_at, Time.now) if response.success?
    response.success?
  end

GATEWAY行会在最新的activemerchant gem中触发自动错误。包含在lib / active_merchant / billing / gateways / paypal / paypal_recurring_api.rb中。这是错误日志消息:

in `purchase': Recurring functionality in ActiveMerchant is deprecated and will be removed in a future version. Please contact the ActiveMerchant maintainers if you have an interest in taking ownership of a separate gem that continues support for it.

我试图为paypal订阅找到一个分支但没有成功。几个月前就做出了弃权决定。

其他人尝试使用分支activemerchant使其与Paypal订阅一起使用?任何一个例子?

我找到了另一个宝石paypal-express,它专用于Paypal,但不接受卡片。

此处same question没有回答。从2008年到2011年,有很多旧的教程试图实现今天在activemerchant上弃用的重复通信。

使用ruby 2.1.2,rails 4.1.6,activemerchant 1.56.0

0 个答案:

没有答案