HandleSpecialURL from PayPal

Hi:

I am trying to get HandleSpecialURL to work to handle responses from PayPal. I have at least two questions, but I want to deal with just the first one for now.

My ‘Cancel’ URL at PayPal is:

http://www.WebApp.com/cancel

My code under the HandleSpecialURL Event Handler is:

if Request.Path = “cancel” then

webpage6.show

end if

When I return from PayPal, I get this message:

Not Found
The requested URL cancel was not found on this server.

Also, when I remove the HandleSpecialURL Event Handler, I get the same message.

Any ideas?

You need to use HandleUrl. HandleSpecialUrl requires that the url be prefixed with /api or /special.

Greg:

I deleted the HandleSpecialURL Event Handler and then created a HandleURL Event Handler and pasted the following code into it:

if Request.Path = “cancel” then

webpage6.show

end if

I received the same error message as before.

Ah, right… Xojo Cloud.

You need to include more of the url:

http://www.webapp.com/appName/index.cgi/cancel

Greg:

I tried:

http://www.WebApp.com/WebApp-Dev/index.html/cancel

I received the same error message as before.

“index.cgi”, not “index.html”.

I have tried:

http://www.WebApp.com/WebApp-Dev/index.cgi/cancel
http://www.WebApp.com/WebApp-Dev/index.html/cancel

I received the same error message as before.

Oh geez. I just went back and looked at your initial code and found two problems.

First, you MUST return True to tell the framework that you handled the call. Without it you’ll get the 404 error you are seeing.

More importantly… There’s no session in place when this callback occurs, so you can’t call WebPage6.Show from there.

send paypal to this url:

http://www.WebApp.com/WebApp-Dev/index.cgi/?page=cancel

In your session.open

put this code:

if me.UrlparameterExists("page") then

if me.URLParameter("page") = "cancel" then

webpage6.show()

end if

end if

edit: because it’s only redirecting for showing a page to the user, this is not handled by API/ or /Special.

The above suggestions look promising, but I can’t try them. I am getting the usual message, “An error occurred during Xojo Cloud deployment. Please wait a few minutes and try again.” for yet another weekend.

I am probably shut down until Monday afternoon when customer service get through the stack of emails to mine. I really wish Xojo had somebody working weekends to take care of this. It seems that it happens about every other weekend.

@Stuart Travis – Do me a favor and get me your public IP address using a service like whatsmyip.org.

So I’m looking at the URL of your Toolbar app. Lemme guess. You’ve implemented HandleURL and you return True in all circumstances?

HandleURL will actually let you intercept any request that comes into the app. By returning True, you’re telling it not to create a new Session. Try adding this at the very top of HandleURL:

If Request.Path = "" then Return False

Greg:

At this time I am at 38.97.228.22

I am at a meeting and this is not my usual one.

Stu

Greg:

I just tried to upload from that URL and it failed.

Stu

Look at my second note about HandleUrl.

Greg:

By fail at this point, I mean I am not able to upload to Xojo’s Cloud. It has been this way since yesterday evening. When I deploy, it appears to go to completion, but then I get the following message:

“An error occurred during Xojo Cloud deployment.
Please wait a few minutes and try again.”

I sent support an email several hours ago, but unfortunately when this happens on a weekend, it is usually Monday afternoon before they work through their emails and get to my problem and restore my server.

I am the Xojo guy who’s trying to help you this weekend…

[quote=223652:@Stuart Travis]By fail at this point, I mean I am not able to upload to Xojo’s Cloud. It has been this way since yesterday evening. When I deploy, it appears to go to completion, but then I get the following message:

“An error occurred during Xojo Cloud deployment.
Please wait a few minutes and try again.”[/quote]
Right, And I’m asking you to check your App.HandleUrl event.

Sorry… It is as you suggested in your second post.

Ok. So the error you are getting from the ide is that it can’t verify that your app is responding. Please comment out all of the code in the HandleUrl event and deploy again.

Greg:

Actually, I changed it to your second post, and now it uploads. I have the same URL as my “cancel” at PayPal. I am returned to a

webapp.i.com.com

address.