Author Topic: Unable to post transaction results  (Read 1807 times)

Offline djbdjb

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Unable to post transaction results
« on: 13/April/2011, 11:09:23 PM »
Hi

First off I appreciate I ??m only on a free trial at the moment, but I ??ve presented the website to the client today and they seemed quite happy (it only broke once while I showed them too!). I just need to get it working perfectly before I unleash them on it to fully try out all the features... and then part with their money!

That said, I am having a little trouble in that when I place an order it goes through to Barclaycards ePDQ perfectly, completes there but when it comes back to the website I just get dumped on the home page (no thank you message) and receive an error message from ePDQ:

Quote
ePDQ CPI Error ::
Unable to post transaction details for order id 2011-04-13-22:52:13_GBP_65 to URL http://www.mywebsite.co.uk/index.php?option=com_nbill&action=gateway&task=status&gateway=barkalys

You have received this mail as we have been unable to post transaction results to your nominated POST URL. Please do not reply to this automatically generated email. For assistance please contact the eCommerce Support team at ecomm.support@barclaycard.co.uk.

Remote server returned:

HTTP/1.1 302 Moved Temporarily
Date: Wed, 13 Apr 2011 21:52:55 GMT
Server: Apache
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Set-Cookie: 5e361ad434f60ac133d55276ff59b8dd=c5355d0c9788bf94e189a4939d81dde7; path=/
Location: http://www.mywebsite.co.uk/index.php?option=com_nbill&action=orders&task=complete&id=1&message=&g_tx_id=65&amount=24.00&currency=GBP&order_id=111&order_no=000012
Content-Length: 0
Connection: close
Content-Type: text/html

Now I ??ve showed this to the OSDCS technical support and they suggested I approached Barclaycard, which I did, and received this:

Quote
The email you are receiving is because the postback is failing. This is the response your server is returning when we attempt to postback:

Apr 13 2011 09:45:41 - Order=2011-04-13-09:44:07_GBP_54 Message=Second POST to http://www.mywebsite.co.uk/index.php?option=com_nbill&action=gateway&task=status&gateway=barkalys failed - trying for a third and final time

Apr 13 2011 09:45:41 - Order=2011-04-13-09:44:07_GBP_54 Message=Unable to POST to merchant's site

Apr 13 2011 09:45:41 - Order=2011-04-13-09:44:07_GBP_54 Message=HTTP/1.1 302 Moved Temporarily

Additional output follows (final post response as pure HTML source)

Date: Wed, 13 Apr 2011 08:45:39 GMT Server: Apache P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM" Set-Cookie: 5e361ad434f60ac133d55276ff59b8dd=187ba7426a5109cc009900c1694e6dd0; path=/ Location: http://www.mywebsite.co.uk/index.php?option=com_nbill&action=orders&task=complete&id=1&message=&g_tx_id=54&amount=24.00 ?cy=GBP&order_id=104&order_no=000005 Content-Length: 0 Connection: close Content-Type: text/html

Does this make any sense at all? Should I be harassing OSDCS a bit more?

Many thanks

David

PS: I know Barclays is spelled wrong in the links, but that ??s how the gateway spells it!
« Last Edit: 13/April/2011, 11:11:09 PM by djbdjb »

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Unable to post transaction results
« Reply #1 on: 14/April/2011, 09:13:44 AM »
I am not entirely sure what is going wrong, but it would seem to be caused by ePDQ not liking the fact that nBill is attempting to redirect to a thank you message after payment. Please try replacing your /administrator/components/com_nbill/framework/classes/nbill.payment.class.php file with the attached, to see if returning a 200 status code resolves the issue.

Edited to update the file attachment.
« Last Edit: 15/April/2011, 03:09:55 PM by netshine »

Offline djbdjb

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Unable to post transaction results
« Reply #2 on: 14/April/2011, 10:09:52 AM »
Thanks for the quick reply, I still got the same error message sent to me when I replaced the file. :(

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Unable to post transaction results
« Reply #3 on: 14/April/2011, 03:53:19 PM »
If you submit a support ticket giving me access to the Joomla administrator, I will see if I can spot what's wrong, but naturally I won't have access to the gateway source code, so it might still need to be referred back to OSDCS.

Offline djbdjb

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Unable to post transaction results
« Reply #4 on: 15/April/2011, 09:08:01 AM »
I ??ve sent an email with the details to your support email address as I don ??t have access to the helpdesk at the moment.

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Unable to post transaction results
« Reply #5 on: 15/April/2011, 09:46:09 AM »
You can submit a pre-sales support ticket here: https://www.nbill.co.uk/index.php?option=com_nbill&Itemid=60&action=nb_helpdesk

In any case, I logged in to your site and saw that the nbill.payment.class.php file on your site is not the one I attached to my earlier message. I replaced the file for you, so please try again now.

Offline djbdjb

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Unable to post transaction results
« Reply #6 on: 15/April/2011, 10:13:41 AM »
Sorry, I replaced the original file after testing it with your updated one, so I ??ve just tried a transaction again but it still just returns me to the homepage.

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Unable to post transaction results
« Reply #7 on: 15/April/2011, 10:45:48 AM »
Do you still get the error from ePDQ?

Offline djbdjb

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Unable to post transaction results
« Reply #8 on: 15/April/2011, 10:58:58 AM »
Yes, still getting the error email sent to me for every transaction.

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Unable to post transaction results
« Reply #9 on: 15/April/2011, 03:07:34 PM »
Ok, there is good news and bad news, but hopefully more good than bad...

Good: The fix I was trying to implement did work, I just mis-counted the output buffer nesting level - after adding an extra flush, it stopped the postback error in ePDQ.
Bad: The ePDQ postback is done separately from the client redirect, so although the postback shows the thank you message, the client never sees it.
Bad: The atrociously spelt 'barkalys' gateway does not provide a setting for the return URL used to redirect the client after successful payment, and defaults to your website home page.
Good: The gateway's source code is now open source, so I can see that a setting can be added to the database for a custom return URL. If you create an article in Joomla containing your thank you message (instead of using the setting on the order form), and make a note of the URL, you could manually add a record to the database using an SQL query like this:

INSERT INTO `jos_nbill_payment_gateway` (`gateway_id`, `g_key`, `g_value`, `label`, `help_text`, `required`, `admin_can_edit`, `ordering`) VALUES ('barkalys', 'return_url', 'http://www.example.com/your_success_article_here.html', 'Return URL', '', '0', '1', '99');

Bad: I have not tested the above, and I don't know whether the success message would also be displayed in the case of failure. If the above is not a satisfactory solution, I would have to refer you back to OSDCS or alternatively advise you to employ the services of a PHP developer to further develop the gateway script.

Offline djbdjb

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Unable to post transaction results
« Reply #10 on: 15/April/2011, 06:43:11 PM »
You may have guessed already but I ??m a designer not a developer, so I ??m just trying to get my head round what ??s happening.

At the moment the website takes the transaction details, goes to Barclaycard who accept the transaction and then goes to:

http://www.mywebsite.co.uk/index.php?option=com_nbill&action=gateway&task=status&gateway=barkalys

This is set in the configuration screen of ePDQ as instructed by OSDCS. This URL handles the completion of the order and in an ideal world should then take me on to the thank you page but, due to the payment gateway, just spits me back out on my homepage. To get it to go to the nBill thank you page would require some additional coding. Have I understood this?

It ??s not really the end of the world if it doesn ??t go to the thank you page I suppose, as I can add a thank you to the order confirmation (and more importantly I need to tell the customer that they can now login to a specific members area). But I guess it would be worth following up with OSDCS.

Thanks for your help, it ??s much appreciated.
« Last Edit: 15/April/2011, 06:45:26 PM by djbdjb »

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Unable to post transaction results
« Reply #11 on: 15/April/2011, 07:32:22 PM »
To get it to go to the nBill thank you page would require some additional coding. Have I understood this?
The thank you message in nBill is not accessible - you would have to create your own thank you page as a normal Joomla content item. You shouldn't need any custom code, just to add a record to your database, eg. using phpMyAdmin. Or go back to OSDCS and ask them to support a redirect to a thank you page for the customer.

 

anything