IPN listener didn't provide 'verified' status for successful recurring payment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are using IPN for receiving customer details for recurring payments. In testing, using sandbox account for recurring payment is working well and its IPN listener provides 'verified' status. so my requirement is fulfill in that case, But in live site, my IPN listener didn't provide 'verified' status for successful recurring payment. I attached part of my code(implementing IPN) for references
def ipn_paypal response = validate_IPN_notification(request.raw_post) case response when "VERIFIED" if params[:payment_status] == "Completed" && params[:receiver_email] == "#{ENV['PAYPAL_MERCHANT_EMAIL']}" contributor = build_contributor(params) #trigger mail for successful payment end when "INVALID" #need require actions else end head :ok end def validate_IPN_notification(raw) uri = URI.parse("#{ENV['PAYPAL_IPN_URL']}") http = Net::HTTP.new(uri.host, uri.port) http.open_timeout = 60 http.read_timeout = 60 http.verify_mode = OpenSSL::SSL::VERIFY_PEER http.use_ssl = true response = http.post(uri.request_uri, raw, 'Content-Length' => "#{raw.size}", 'User-Agent' => "My custom user agent" ).body end
. I don't know why? I followed https://github.com/paypal/ipn-code-samples/blob/master/ruby/paypal_ipn_rails.rb these documentation to implement IPN my site
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the solution. I missed to attach the variable `cmd=_notify-validate`to Verify that response to an IPN in live site. The correct IPN URL is https://ipnpb.paypal.com/cgi-bin/webscr?cmd=_notify-validate
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- paypal recurring payments and ipn management in REST APIs
- Payment not automatically being captured, funds not transferred in Sandbox Environment
- IPN SHOWS NO HTTP RESPONSE - LISTENER WORKS WITH LOCAL FORM POST in Sandbox Environment
- Why am I not seeing HTTP responses for IPN? in Sandbox Environment
- Why Refund is Always in PENDING Status for Sandbox mode? in Sandbox Environment