On Jun 19, 2007, at 2:44 PM, Paul Lynch wrote:

On 19 Jun 2007, at 22:27, Paul Lynch wrote:

On 19 Jun 2007, at 21:23, Chuck Hill wrote:

On Jun 19, 2007, at 1:02 PM, Paul Lynch wrote:

Dear list,

Thanks to Maestro and 3-D Secure, I need to implement a call back URL to one of my WO apps. I submit a form to some random URL that the merchant services provider gives me, including as one of the parameters a URL to which they will return after some time spent on their web site.

I would ideally like to give a URL that will call an action in the dispatching component, but I'm having some problems getting that to work (using componentActionURL, I get backtracking exceeded errors).

What is the URL? Does it include the WOSID? As long as the call back comes relatively soon, you should not be getting that error if it can find the session. If you are using cookies for the session and instance #, you will need to add those values to the URL.

It's a standard WO URL with a sessionid in it; no tricks hiding the sid. I'll just do a run to get an example:

http://Resolution.local:61827/cgi-bin/WebObjects/SecPayTest.woa/wo/ 5vEn4Wwq6N6hAnTxgdr8Kg/1.1.2

Running in direct connect mode with _generateCompleteURLs. The session id is correct, and it hits the backtracked too far error. The url is generated with context().componentActionURL() in the caller.

I think I can see why I have a problem - explanation follows.

The code that calls the service is:

        public WOComponent reload() {
                context()._generateCompleteURLs();
                secPay.makePayment(this, context().componentActionURL());

You will need to override invokeAction to handle this when it comes back.

                context()._generateRelativeURLs();
WOComponent secPayAction = (WOComponent)secPay.results ().valueForKey("redirect");
                if (secPayAction != null) {
                        NSLog.debug.appendln("Main: redirect");
                        return secPayAction;
                }
                NSLog.debug.appendln("Main: reload");
                return null;
        }

Which calls:

public NSDictionary makePayment(WOComponent sender, String returnUrl) {
                ...
AuthRequest nextPage = (AuthRequest)sender.pageWithName ("AuthRequest");

You are kind of playing fast and loose with stuff here. I think that at the minimum, you will want

nextPage.ensureAwakeInContext(sender.context());

                        //nextPage.setAcsUrl(url.toString());
                        nextPage.setAcsUrl(returnUrl);
                        nextPage.setTermUrl(returnUrl);
                        nextPage.setPaReq(paReq);
                        results.takeValueForKey(nextPage, "redirect");
                        return results;
                ...
        }

The AuthRequest page is just a set of accessors, with a form with the URL supplied as acsUrl from the service provider, and an onload javascript to submit the form. For testing (behind a firewall), I am plugging my own return url into the form href... which is now apparently why it fails (see the commented out line and following testing addition). I have no idea why it gets an backtracking error, though.

My next step will be to run the proper test with the return url passed to the service provider, from the other side of a my firewall so that I can get a return!

Paul




--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to