【问题标题】:Rails Spree OffsitePayments Integrations work flowRails Spree 异地支付集成工作流程
【发布时间】:2018-02-19 04:01:39
【问题描述】:

我是 Spree、ActiveMerchant 和支付流程的新手...

也就是说,我正在尝试将 OffsitePayment 集成到 spree,我创建了一个自定义网关,将其添加到 spree.rb 配置文件中 spree 的支付方式中,并在管理界面上进行设置,使其显示为买方的选项,purchase 方法被调用。但是在购买方法中实际上要做什么呢?我想(并且期望)集成助手有一些我需要填写的属性(as I see in the docs for it),但是一旦填写完毕,我如何实际“提交”付款?我什至不知道我是否应该寻找与狂欢相关或 OffsitePayments 或 ActiveMerchant 相关的东西......有点失落。

class Spree::Gateway::PagSeguro < Spree::Gateway
    def provider_class
        OffsitePayments::Integrations::PagSeguro
    end

    def provider
        provider_class::Helper
    end

    def auto_capture?
        true
    end

    def purchase(amount, paym_source, gateway_options={})
        # What to do here?            
        ActiveMerchant::Billing::Response.new(true, 'success', {}, {})
    end

end

【问题讨论】:

    标签: ruby-on-rails spree activemerchant


    【解决方案1】:

    你的购买方式需要做网关取钱所需的一切,然后根据状态返回相应的ActiveMerchant::Billing::Response,以便Spree知道如何处理。

    【讨论】:

      猜你喜欢
      • 2014-07-28
      • 2017-06-25
      • 2012-10-24
      • 2013-07-09
      • 2014-07-08
      • 2010-11-14
      • 2016-10-01
      • 2013-01-11
      • 2017-01-07
      相关资源
      最近更新 更多