简体   繁体   中英

How to get IPN notification in PayPal on localhost

I am using Adaptive Payment in PayPal. I am following the https://github.com/paypal/adaptivepayments-sdk-ruby . All is working fine except I am not able to receive IPN notofications locally.

 @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" })

So , how to receive notifications on localhost

Paypal will not be able to route to localhost to send the IPN. You would need to setup a publicly available domain name and the appropriate dns.

Localhost is always specific to your machine, you might be able to use dynamicdns but it would require network changes on your machine and network.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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