Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Chris Knowles 141 posts 222 karma points
    Aug 23, 2011 @ 18:26
    Chris Knowles
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    Aug 27, 2011 @ 08:05
    Søren Spelling Lund
    0

    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:

    public override void ProcessCallback(Payment payment)
    {
    base.ProcessCallback(payment);
    HttpContext.Current.Response.Write("<html>Your redirect code here</html>");

    We will include auto redirect to a local page as an option in the uCommerce WorldPay provider in a future release of uCommerce.

  • Rich Green 2246 posts 4008 karma points
    Feb 10, 2012 @ 12:16
    Rich Green
    0

    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

     
  • Rich Green 2246 posts 4008 karma points
    Feb 10, 2012 @ 12:58
    Rich Green
    0

    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

     

  • Rich Green 2246 posts 4008 karma points
    Feb 10, 2012 @ 13:36
    Rich Green
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 10, 2012 @ 13:52
    Søren Spelling Lund
    0

    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.

  • Rich Green 2246 posts 4008 karma points
    Feb 10, 2012 @ 16:04
    Rich Green
    1

    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

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 13, 2012 @ 14:36
    Søren Spelling Lund
    0

    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.

  • Kenny Burns 173 posts 305 karma points
    Mar 26, 2012 @ 12:47
    Kenny Burns
    0

    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

  • Kenny Burns 173 posts 305 karma points
    Mar 28, 2012 @ 19:10
    Kenny Burns
    1

    Cancel what i said above! It is all running fine now (Worldpay) using the approach outlined above! :)

    Great work guys!!

    Kenny

  • Søren Spelling Lund 1797 posts 2786 karma points
    Mar 29, 2012 @ 15:03
    Søren Spelling Lund
    0

    Awesome. Thanks for the update! :)

  • Bill Smith 52 posts 222 karma points
    Mar 04, 2013 @ 12:36
    Bill Smith
    0

    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

     

  • Rick 92 posts 278 karma points
    May 30, 2013 @ 13:10
    Rick
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 30, 2013 @ 14:31
    Søren Spelling Lund
    1
    Hi Rick,
    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.
    Hope this helps.
  • Rick 92 posts 278 karma points
    May 30, 2013 @ 17:16
    Rick
    0

    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

  • Bill Smith 52 posts 222 karma points
    May 30, 2013 @ 22:25
    Bill Smith
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft