【发布时间】: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