2016-02-27 33 views
0

我在PayPal中使用自适应付款。 我正在关注https://github.com/paypal/adaptivepayments-sdk-ruby。 所有工作正常,但我无法在本地接收IPN通知。如何在本地主机上的PayPal中获得IPN通知

@api = PayPal::SDK::AdaptivePayments.new 
    @pay = @api.build_pay({ 
           :actionType => "PAY", 
           :cancelUrl => "http://"+Rails.application.config.app_name+"/admin/dashboard", 
           :currencyCode => "USD", 
           :feesPayer => "SENDER", 
           :ipnNotificationUrl => "http://"+Rails.application.config.app_name+"/admin/receive_notification", 
           :receiverList => { 
            :receiver => [{ 
                :amount => amount, 
                :email => @paypal_id }] }, 
           :returnUrl => "http://"+Rails.application.config.app_name+"/admin/dashboard" }) 

那么,如何获得在本地主机上

通知

回答

1

支付宝将无法路由到本地主机发送IPN。您需要设置一个公开可用的域名和适当的DNS。

Localhost始终专用于您的计算机,您可能可以使用dynamicdns,但它需要在您的计算机和网络上更改网络。

+0

好吧,让我试试看。 –