We solved this via e-mail, but for completeness sake I'm posting the answer here as well.
To display a custom receipt page RBS WorldPay requires the callback to output javascript, which redirects the customer to a local page otherwise the default WorldPay receipt page will be displayed. Unfortunately the default page does not contain any return links.
This can be accomplished byoverriding the default WorldPay provider. You'll want to inherit the UCommerce.Transactions.Payments.WorldPayPaymentMethodService class and override the ProcessCallback method.
In the overridden version of ProcessCallback you'll have code like this:
To get this to work "Enable the Shopper Response" must be checked in the Worldpay control panel.
However this code above does not really redirect as such, just loads the page under the worldpay URL, plus it's HTTPS and my page doesn't show correctly.
Unfortunately some gateways are a little strange when it comes to displaying confirmation pages. Authorize.Net does exactly the same thing, which can be confusing to customers, i.e. seeing store content under a WorldPay/Authorize.Net URL.
Actually I misread the post. Originally uCommerce didn't show anything to the customer so a redirect was required. An subsequent update add the ability to have a custom page displayed as you're seeing. So basically the approach you outline is the way to go.
If we set the acceptUrl to a page on our site this page is displayed but isnt styled correctly or anything like that. It seems the acceptUrl is displayed underneath the WorldPay url - is this correct?
If so I think you can do a redirect in the payment pages back to our site - (sure we have done this before)
Info servlet password - ****** Payment Response password - ****** MD5 secret for transactions - ****** SignatureFields - instId:amount:currency:cartId:MC_callback
When I simulate a payment through Worldpay, I am sent to a confirmation page that is essentially my confirmation page (where I defined the acceptUrl in WorldPay.config) - but as someone in the thread has already stated, it is sitting underneath https://secure-test.worldpay.com/wcc/card
The problem I have is that I'm using relative links (as I'm sure most people do) on my confirmation page, so the styling is lost and the navigation is not functional.
I need to have my confirmation page dynamic as I'd like to display the order ID etc. to the specific customer who has just completed a transaction through WorldPay.
I've read a few things about turning validateRequest to false to obtain values from the query string parameters to display to the customer (surely this makes the site or page vulnerable to XSS though!).
I've also read something about inserting a re-direct in the Worldpay custom thank you page to re-direct the customer to the confirmation page on my site - I've also read that this is in breach of WorldPay's TOS.
Because WorldPay insists on displaying the accept/decline pages under their own URL you have to use absolute paths to include JS, image resources, and other external resources. As you mention you will breach their TOS if you use JS to redirect to a local page on your site (we initially wanted to do it this way but found we had to go down the other route to avoid breaching).
The good news is that the HTML rendered is a full Umbraco page though so once you've gotten your resource links in order you can display any order info you want. uCommerce will provide your receipt page template with a query string parameter called "orderGuid" with which you can load up the relevant order and display a full order confirmation.
Thanks for the information and the very quick response Soren!
In order to get this working, I had to upload my stylesheet and logo to my payment page hosted with Worldpay. On my template that I created in Umbraco, I had to reference my stylesheet like this...
Rick, this is exactly what I had to do too. All image, javascript, css, etc references needed absolute URLs (being hosted on our own servers. Not an ideal solution but it worked. I have set up other e-commerce packages in which I had no trouble with callback, but at least with this solution, it's not a show stopper.
WorldPay callback
Hi,
Using the latest version of the ship and when i go off to worldpay it never goes back to the site to complete the order and say thank you?
Have followed the instructions at : http://www.publicvoid.dk/SetupUCommerceToIncludeRBSWorldPayAsAPaymentMethod.aspx but still doesn't work? what could i be missing?
Thanks
Chris
We solved this via e-mail, but for completeness sake I'm posting the answer here as well.
To display a custom receipt page RBS WorldPay requires the callback to output javascript, which redirects the customer to a local page otherwise the default WorldPay receipt page will be displayed. Unfortunately the default page does not contain any return links.
This can be accomplished byoverriding the default WorldPay provider. You'll want to inherit the UCommerce.Transactions.Payments.WorldPayPaymentMethodService class and override the ProcessCallback method.
In the overridden version of ProcessCallback you'll have code like this:
We will include auto redirect to a local page as an option in the uCommerce WorldPay provider in a future release of uCommerce.
Hey Soren,
I've tried to implement the above but get nothing but the standard worldpay thank you page.
Is there anything else I need to configure, the payment is set to test and nothing related is being sent to Worldpay via the test form?
My code is:
class WordPayProcessCallback : WorldPayPaymentMethodService { public override void ProcessCallback(Payment payment) { base.ProcessCallback(payment); HttpContext.Current.Response.Write("<html><head><body onLoad=\"window.location = 'http://ourWebsite.co.uk'\"></body></html>"); } }Seems strange to have to inject javascript but guessing this is down to World Pay.
Any ideas?
Rich
Hi,
To get this to work "Enable the Shopper Response" must be checked in the Worldpay control panel.
However this code above does not really redirect as such, just loads the page under the worldpay URL, plus it's HTTPS and my page doesn't show correctly.
Rich
Ok,
So the above code works (I chose to use Meta Refresh instead) however the page gets displayed but under a Worldpay URL so no relative links work.
I plan to redirect again from this page back to my server.
HTH
Rich
Unfortunately some gateways are a little strange when it comes to displaying confirmation pages. Authorize.Net does exactly the same thing, which can be confusing to customers, i.e. seeing store content under a WorldPay/Authorize.Net URL.
Actually we couldn't get this javascript to work and not sure why it's needed, unless I'm missing something.
If the "Enable the shopper response" box is ticked as my post above above and the following set in the WorldPay.Config file:
acceptUrl="http://yourSite.com/CustomConfirmPage/"
declineUrl=" http://yourSite.com/CustomFailedPage" />
Then the shopper gets returned to the page and you can grab the order details by
<xsl:variable name="postedOrder" select="CommerceLibrary:GetPurchaseOrderByGuid(umbraco.library:Request('orderGuid'))"></xsl:variable>
postedOrder: <textarea><xsl:copy-of select="$postedOrder"/></textarea>
Hope this helps someone
Rich
Actually I misread the post. Originally uCommerce didn't show anything to the customer so a redirect was required. An subsequent update add the ability to have a custom page displayed as you're seeing. So basically the approach you outline is the way to go.
Hi Soren,
If we set the acceptUrl to a page on our site this page is displayed but isnt styled correctly or anything like that. It seems the acceptUrl is displayed underneath the WorldPay url - is this correct?
If so I think you can do a redirect in the payment pages back to our site - (sure we have done this before)
Cheers -
Kenny
Cancel what i said above! It is all running fine now (Worldpay) using the approach outlined above! :)
Great work guys!!
Kenny
Awesome. Thanks for the update! :)
We are also having callback failure with Worldpay, we get the following error:
Error reported: Callback to 7/76/PaymentProcessor.axd: NOT OK, recevied HTTP status: 500
Any ideas what could be causing this, We have enabled Payment Response enabled to <wpdisplay item=MC_callback>
Bill
Hi,
Apologies to latch onto this thread - however, I'm having a similar issue with WorldPay callback.
I have set the necessary details in the Test installation of my Worldpay account:
Payment Response URL - <wpdisplay item=MC_callback>
Payment Response enabled? - Yes
Enable Recurring Payment Response - Yes
Enable the Shopper Response - Yes
Suspension of Payment Response - Yes
Info servlet password - ******
Payment Response password - ******
MD5 secret for transactions - ******
SignatureFields - instId:amount:currency:cartId:MC_callback
When I simulate a payment through Worldpay, I am sent to a confirmation page that is essentially my confirmation page (where I defined the acceptUrl in WorldPay.config) - but as someone in the thread has already stated, it is sitting underneath https://secure-test.worldpay.com/wcc/card
The problem I have is that I'm using relative links (as I'm sure most people do) on my confirmation page, so the styling is lost and the navigation is not functional.
I need to have my confirmation page dynamic as I'd like to display the order ID etc. to the specific customer who has just completed a transaction through WorldPay.
I've read a few things about turning validateRequest to false to obtain values from the query string parameters to display to the customer (surely this makes the site or page vulnerable to XSS though!).
I've also read something about inserting a re-direct in the Worldpay custom thank you page to re-direct the customer to the confirmation page on my site - I've also read that this is in breach of WorldPay's TOS.
Help?!
Many thanks,
Rick Lynch
Thanks for the information and the very quick response Soren!
In order to get this working, I had to upload my stylesheet and logo to my payment page hosted with Worldpay. On my template that I created in Umbraco, I had to reference my stylesheet like this...
<link media="all" rel="stylesheet" type="text/css" href="/i/xxxxxx/wp_main.css" />
... where "xxxxxx" is my installation ID with WorldPay.
Then in the WorldPay.config for "acceptUrl", I added the template name like this:
acceptUrl="http://mysite.com/WPConfirmation"
... where WPConfirmation is the name of my template in Umbraco.
I left all settings in WorldPay as I originally posted above ...
Hope this helps someone out there!
Rick
Rick, this is exactly what I had to do too. All image, javascript, css, etc references needed absolute URLs (being hosted on our own servers. Not an ideal solution but it worked. I have set up other e-commerce packages in which I had no trouble with callback, but at least with this solution, it's not a show stopper.
Bill
is working on a reply...