Forum: Ruby on Rails Paypal IPN - unable to access breakpoint during POST?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
143d37bc67b04ad4fdc69beddda48651?d=identicon&s=25 Tom Taylor (Guest)
on 2006-01-09 19:35
(Received via mailing list)
Hi all,

I'm trying to debug some code in my paypal instant payment notification
action.

Why can I not access the breakpoint placed inside the action that paypal
POSTs to? It just doesn't find the server, but it works fine when placed
inside other actions.

I've appended the code to the end of this post.

Thanks everyone!

Tom

--

	def paypal_ipn
		notify = Paypal::Notification.new(request.raw_post)
		breakpoint
		split = notify.item_id.split('-')
		@order = Order.new
		@item = Item.find(split[0])
		@user = User.find(split[1])
		@order.user_id = @user.id
		@order.item_id = @item.id

		if notify.acknowledge
			begin
			if notify.complete? and @item.amount == notify.amount
				@order.status = 'success'
#				send email
			else
				logger.error("Erm. Failed to verify Paypal's notification.")
			end
			rescue => e
				@order.status        = 'failed'
				raise
			ensure
				@order.save
			end
		end
		render :nothing
	end
97a7959f0d9e6c90ddae200520e93067?d=identicon&s=25 Damon Clinkscales (Guest)
on 2006-01-09 23:22
(Received via mailing list)
Tom Taylor <tom@...> writes:

> Why can I not access the breakpoint placed inside the action that paypal
> POSTs to? It just doesn't find the server, but it works fine when placed
> inside other actions.

silly question i know...but are you sure IPN is calling you back?  Do
you have
confirmation in the access log of your web server?

-damon
http://damonclinkscales.com/
143d37bc67b04ad4fdc69beddda48651?d=identicon&s=25 Tom Taylor (Guest)
on 2006-01-10 00:29
(Received via mailing list)
Damon Clinkscales wrote:
> silly question i know...but are you sure IPN is calling you back?  Do you have
> confirmation in the access log of your web server?

Hi Damon,

Yes, I can see it in my development.log. I'm having trouble getting the
acknowledgement to work, hence the need for the debug.

Thanks,

Tom
97a7959f0d9e6c90ddae200520e93067?d=identicon&s=25 Damon Clinkscales (Guest)
on 2006-01-10 02:29
Tom Taylor wrote:

> Yes, I can see it in my development.log. I'm having trouble getting the
> acknowledgement to work, hence the need for the debug.

Why not try putting a breakpoint above and below the IPN call to see if
it stops.   If it does then you know it is getting called and stopping
at the breakpoint.

Then you can see what happens when you type 'exit' in irb.

-damon
http://damonclinkscales.com/
143d37bc67b04ad4fdc69beddda48651?d=identicon&s=25 Tom Taylor (Guest)
on 2006-01-10 19:39
(Received via mailing list)
Damon Clinkscales wrote:
> Why not try putting a breakpoint above and below the IPN call to see if
> it stops.   If it does then you know it is getting called and stopping
> at the breakpoint.

It doesn't work above the breakpoint unfortunately.

Thanks again,

Tom
143d37bc67b04ad4fdc69beddda48651?d=identicon&s=25 Tom Taylor (Guest)
on 2006-01-11 01:47
(Received via mailing list)
Tom Taylor wrote:
> It doesn't work above the breakpoint unfortunately.
>
> Thanks again,
>
> Tom

I'm an absolutely monkey. I had paypal_idn instead paypal_ipn in the
form for sending to Paypal. Sorry for wasting your time!

Tom
This topic is locked and can not be replied to.