简体   繁体   English

使用activemerchant和ipn的Paypal Express结帐

[英]Paypal express checkout using activemerchant and ipn

I'm stuck with getting activemerchants paypal express ipn notification to work. 我坚持让活跃的商人贝宝表达ipn通知工作。

My workflow looks like this: 我的工作流程如下:

# 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

In the paypal docs it says notify_url is deprecated they use PAYMENTREQUEST_n_NOTIFYURL instead. 在Paypal文档中,它说notify_url已过时,他们改用PAYMENTREQUEST_n_NOTIFYURL。 But I have no clue how to tell this my paypal express gateway. 但是我不知道如何告诉我我的Paypal Express网关。

My ipn callback doesn't get called so I assume the notifyurl param doesn't work anymore. 我的ipn回调没有被调用,所以我假设notifyurl参数不再起作用。 Paypal is in sandbox mode but that should make no difference right? 贝宝(Paypal)处于沙盒模式,但这应该没有区别吧?

Any hints? 有什么提示吗?

I believe that if you are using Paypal Express that means you are doing a deep integration with your system, and you don't need the IPN, you can get the response from 我相信,如果您使用的是Paypal Express,则意味着您正在与系统进行深度集成,并且不需要IPN,则可以从

response = gateway.purchase(total_as_cents, purchase_params)

and get all information from it, and that response is an object 并从中获取所有信息,并且该响应是一个对象

ActiveMerchant::Billing::PaypalExpressResponse

The IPN is used for the basic Paypal integration, with no API calls from your app, only Paypal URL redirect with params. IPN用于基本的Paypal集成,无需从您的应用程序调用API,仅使用参数将Paypal URL重定向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM