我无法让 activemerchants paypal express ipn 通知正常工作。
我的工作流程是这样的:
# authorize the payment user gets redirected..
def auth
...
gateway.setup_authorization(total_as_cents, setup_authorization_params)
...
end
# purchase the authorized sum
def purchase
...
purchase_params = {
token: @order.payment_params[:token],
payer_id: @order.payment_params[:payer_id],
currency: current_tenant.currency.unit,
notify_url: paypal_ipn_callback_url
}
response = gateway.purchase(total_as_cents, purchase_params)
...
end
在 paypal 文档中它说 notify_url 已被弃用,他们使用 PAYMENTREQUEST_n_NOTIFYURL 代替。但我不知道如何告诉我的 Paypal express 网关。
我的 ipn 回调没有被调用,所以我假设 notifyurl 参数不再起作用。 Paypal 处于沙盒模式,但这应该没什么区别吧?
有什么提示吗?
最佳答案
我相信,如果您使用的是 Paypal Express,这意味着您正在与您的系统进行深度集成,并且您不需要 IPN,您可以从
response = gateway.purchase(total_as_cents, purchase_params)
并从中获取所有信息,响应是一个对象
ActiveMerchant::Billing::PaypalExpressResponse
IPN 用于基本的 Paypal 集成,您的应用没有 API 调用,只有带有参数的 Paypal URL 重定向。
关于ruby-on-rails - 使用 activemerchant 和 ipn 的 Paypal 快速结帐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19230498/