Do you have a direct connection between your server and the SagePay system? The notification will happen server to server so you need to poke a hole in your firewall on port 80/443 depending on the protocol used on the page on which RequestPayment or CreatePayment is called.
Just to update in the situation. We notice that there is nothing wrong with the uCommerce PaymentProcessor HttpHandler that awaits for the callback from Sage. You can try to feed the query string from the Sumulator and that completes the payment.
In our case we managed to make it work by adding an entry in the IIS ip restrictions (may be is a good idea to check the iis log) for sagepay. This only works in our public staging site, it does not work in our local development machines. But it is fine as long we know it works.
sorry for not replying sooner. I haven't resolved the issue yet, but I spoke to SagePay support to see if they could shed some light on the problem. They said that it was simply that the RedirectUrl parameter had not been supplied.
Is it the PaymentProcessor HttpHandler that supplies the RedirectUrl?
I think what you can do is ask SagePay to set up a Simulator account, where you can see all the variables arriving over there. Then you can see that it gets the notificationUrl then it will show a query string, you can use it manually to the notificationUrl and that will complete the payment. So the problem must be in the communication. In our case it worked in a public server, and using an IIS IP entry to the sage test server.
I installed the IP Restrictions feature and set the 195.170.169.8 IP as allowed but this diddn't change the error.
I have now spotted the following errors in umbracoLog:
407496 0 -1 23/09/2011 14:31:34 Error At /10/49/PaymentProcessor.axd (Referred by: ): System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadData(Uri address) at System.Net.WebClient.DownloadData(String address) at UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, IDictionary`2 templateParameters) at UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, String orderNumber) at UCommerce.Pipelines.Common.SendEmailTask.Execute(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
407495 0 -1 23/09/2011 14:31:34 Error The remote server returned an error: (404) Not Found. Byte[] DownloadDataInternal(System.Uri, System.Net.WebRequest ByRef) at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadData(Uri address) at System.Net.WebClient.DownloadData(String address) at UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, IDictionary`2 templateParameters) at UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, String orderNumber) at UCommerce.Pipelines.Common.SendEmailTask.Execute(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
407494 0 -1 23/09/2011 14:31:34 Error Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details. UCommerce.Pipelines.PipelineExecutionResult Execute(T) at UCommerce.Pipelines.Pipeline`1.Execute(T subject) at UCommerce.Transactions.Payments.AbstractPaymentMethodService.ExecutePostProcessingPipeline(Payment payment) at UCommerce.Transactions.Payments.ExternalPaymentMethodService.ProcessPaymentRequest(PaymentRequest request) at UCommerce.Transactions.Payments.SagePay.SagePayPaymentMethodService.ProcessCallback(Payment payment) at UCommerce.Transactions.Payments.PaymentProcessor.ProcessRequest(HttpContext context)
407492 0 -1 23/09/2011 14:31:34 Error The remote server returned an error: (404) Not Found. Byte[] DownloadDataInternal(System.Uri, System.Net.WebRequest ByRef) at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadData(Uri address) at System.Net.WebClient.DownloadData(String address) at UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, IDictionary`2 templateParameters) at UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, String orderNumber) at UCommerce.Pipelines.Common.SendEmailTask.Execute(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
Does the "The remote server returned an error: (404) Not Found" relate to a missing email template or a failure to respond to SagePay?
The error you're seeing is not related to SagePay, but rather the e-mail service, which tries to send out the order confirmation once the order is completed. uCommerce will request the configured Umbraco page and use that for the contents of the e-mail. Basically you should be able to to view the order confirmation e-mail template from the server itself.
I've seen load balancers cause an issue similar to this. Basically the machines behind the load balancer were accessed by IP and the domain was only available going through the load balancer. What you can do is set up a hostname in the the "hosts" file so you can access the content site from the server itself.
it was a 404 on the email Template causing the PaymentProcesor to fall over. The 404 seems to be because the shop had a sub domain allocated to it under the Manage Hostnames feature and it was in turn a sub node of the site homepage which had the of the parent domain allocated to it in the same way. The shop worked fine but all other pages such as email templates generated a 404. Have now move the shop out from under the homepage re-published and the 404 is gone and SagePay redirect correctly. Soren and Byron thanks for your help :)
Hi guys i'm getting the same error on the redirect after payment of
5006
Error Description :
Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.
I'm getting a error log of, these are all of type Error:
1. Could not find the Payment with PaymentId: 65, PaymentMethodName: 7 Void ProcessRequest(System.Web.HttpContext) at UCommerce.Transactions.Payments.PaymentProcessor.ProcessRequest(HttpContext context)
2. PaymentMethodName: 7, PaymentId: 65
3. At /7/65/PaymentProcessor.axd (Referred by: ):
4. Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details.
5. Duplicate User name! A member with the user name [email protected] already exists umbraco.cms.businesslogic.member.Member MakeNew(System.String, System.String, System.String, umbraco.cms.businesslogic.member.MemberType, umbraco.BusinessLogic.User) at umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String LoginName, String Email, MemberType mbt, User u) at umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String Email, MemberType mbt, User u) at UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.CreateOrGetUmbracoMember(String username, String emailAddress, Int32 memberGroupId, Nullable`1 umbracoMemberTypeId) at UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.CreateUmbracoMemberForOrder(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.Execute(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
When I look in CMSMember table there is no user with my [email protected] - I'm guessing that table from umbraco.cms.businesslogic.member.Member. Also no user of that username in uCommerce.Customer
anything that falls over in the pipeline causes the RedirectUrl not to be supplied back to SagePay. The following looks like there is a duplicate user:
Duplicate User name! A member with the user name [email protected] already exists
There is no user of that email address/ username in any of the membership, customer tables.
What I think I need is on the addresses page is for the page to create the user if it doesn't exist on email address? Can this be done in XSL? or am I having to edit business logic?
I'm really having a problem with this. Locally on my web server it works fine, but on the live server I get the following message from sage pay
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 80.71.16.12:80]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +699
[WebException: Unable to connect to the remote server]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +3291792
System.Net.WebClient.DownloadData(Uri address) +223
UCommerce.Transactions.EmailService.Send(EmailProfile profile, String emailTypeName, MailAddress to, IDictionary`2 templateParameters) +738
UCommerce.Pipelines.Common.SendEmailTask.Execute(PurchaseOrder purchaseOrder) +588
UCommerce.Pipelines.Pipeline`1.Execute(T subject) +275
When uCommerce tries to send an e-mail it will do a local request back to Umbraco to get it to render the body of the e-mail using the standard templating system. Typically this issue arises when the domain name of the store is not resolvable locally, i.e. accessing www.mystore.com from the server itself is not possible.
The simplest way to diagnose this issue it to log onto the server via Remote Desktop, open a browser, and try accessing the store using the public domain name.
If that's not possible the fix is to add a hostname to the hosts file on the server for the public domain name pointing to 127.0.0.1
Could you post the relevant part of the log, please?
Also, when you say that the order status is still "new", are you sure you do not mean the payment status? The order status should be "basket" at this point.
I'm running the code against SagePay's test environment, which was set up with a real customer account.
I spoke to someone at SagePay and they said that this error happens when the store doesn't respond to the response they send to us. So it could be be something to do with what uCommerce does after the payment step happens?
SagePay - The Vendor failed to provide a RedirectionURL
Hi,
I am using the SagePay as the payment gateway. In Test mode when I submit the Payment on SagePay I get the following:
My SagePay notificationURL in the SagePay.config is set to (auto).
Any ideas what is wrong?
I really need an answer on this, if anyone can help.
Why does the (auto) facility not generate a redirectionUrl???
Which version of uCommerce are you on?
Do you have a direct connection between your server and the SagePay system? The notification will happen server to server so you need to poke a hole in your firewall on port 80/443 depending on the protocol used on the page on which RequestPayment or CreatePayment is called.
Did you get a fix for this Simon? Thanks
Just to update in the situation. We notice that there is nothing wrong with the uCommerce PaymentProcessor HttpHandler that awaits for the callback from Sage. You can try to feed the query string from the Sumulator and that completes the payment.
In our case we managed to make it work by adding an entry in the IIS ip restrictions (may be is a good idea to check the iis log) for sagepay. This only works in our public staging site, it does not work in our local development machines. But it is fine as long we know it works.
Hope this helps.
Hi Byron,
Thanks for adding the info. I'm sure it will be useful for others.
Hi
sorry for not replying sooner. I haven't resolved the issue yet, but I spoke to SagePay support to see if they could shed some light on the problem. They said that it was simply that the RedirectUrl parameter had not been supplied.
Is it the PaymentProcessor HttpHandler that supplies the RedirectUrl?
Hi Simon, yes it does. It gets it from the SagePay.config once the call back comes back to the notificationUrl.
The noticiation Url look like this:
http://stage.somewhere.com/8/818/PaymentProcessor.axd
I think what you can do is ask SagePay to set up a Simulator account, where you can see all the variables arriving over there. Then you can see that it gets the notificationUrl then it will show a query string, you can use it manually to the notificationUrl and that will complete the payment. So the problem must be in the communication. In our case it worked in a public server, and using an IIS IP entry to the sage test server.
The query string looks like this
I hope this helps
I don't presently have the IP Restriction Feature installed, so I will have to install it first. What IP did you use for the SagePay test server?
195.170.169.8 is what I get after ping to test.sagepay.com
doh
I installed the IP Restrictions feature and set the 195.170.169.8 IP as allowed but this diddn't change the error.
I have now spotted the following errors in umbracoLog:
Does the "The remote server returned an error: (404) Not Found" relate to a missing email template or a failure to respond to SagePay?
Thanks,
Simon
The error you're seeing is not related to SagePay, but rather the e-mail service, which tries to send out the order confirmation once the order is completed. uCommerce will request the configured Umbraco page and use that for the contents of the e-mail. Basically you should be able to to view the order confirmation e-mail template from the server itself.
I've seen load balancers cause an issue similar to this. Basically the machines behind the load balancer were accessed by IP and the domain was only available going through the load balancer. What you can do is set up a hostname in the the "hosts" file so you can access the content site from the server itself.
HI Soren,
it was a 404 on the email Template causing the PaymentProcesor to fall over. The 404 seems to be because the shop had a sub domain allocated to it under the Manage Hostnames feature and it was in turn a sub node of the site homepage which had the of the parent domain allocated to it in the same way. The shop worked fine but all other pages such as email templates generated a 404. Have now move the shop out from under the homepage re-published and the 404 is gone and SagePay redirect correctly. Soren and Byron thanks for your help :)
Glad to hear that you got it going :)
Great!!
Hi guys i'm getting the same error on the redirect after payment of
5006 Error Description : Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.
I'm getting a error log of, these are all of type Error:
1. Could not find the Payment with PaymentId: 65, PaymentMethodName: 7 Void ProcessRequest(System.Web.HttpContext) at UCommerce.Transactions.Payments.PaymentProcessor.ProcessRequest(HttpContext context)
2. PaymentMethodName: 7, PaymentId: 65
3. At /7/65/PaymentProcessor.axd (Referred by: ):
4. Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details.
5. Duplicate User name! A member with the user name [email protected] already exists umbraco.cms.businesslogic.member.Member MakeNew(System.String, System.String, System.String, umbraco.cms.businesslogic.member.MemberType, umbraco.BusinessLogic.User) at umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String LoginName, String Email, MemberType mbt, User u) at umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String Email, MemberType mbt, User u) at UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.CreateOrGetUmbracoMember(String username, String emailAddress, Int32 memberGroupId, Nullable`1 umbracoMemberTypeId) at UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.CreateUmbracoMemberForOrder(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Checkout.CreateMemberForCustomerTask.Execute(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
When I look in CMSMember table there is no user with my [email protected] - I'm guessing that table from umbraco.cms.businesslogic.member.Member. Also no user of that username in uCommerce.Customer
Any help would be great.
Hi Robert,
anything that falls over in the pipeline causes the RedirectUrl not to be supplied back to SagePay. The following looks like there is a duplicate user:
Could that be the case?
Hi Simon,
Silly question, which database table?
There is no user of that email address/ username in any of the membership, customer tables.
What I think I need is on the addresses page is for the page to create the user if it doesn't exist on email address? Can this be done in XSL? or am I having to edit business logic?
I was looking at
<xsl:variable name="CreateUser" select="CommerceLibrary:SetOrderProperty('signup', 'true')" />
But wasn't sure how to submit it to create a user?
I think it was this http://our.umbraco.org/forum/developers/api-questions/12757-Duplicate-User-name-when-trying-to-add-new-member
Basically I had users in the members table with nothing for username and email, this appeared to mess everything up. will have a good test now.
HI All,
I'm really having a problem with this. Locally on my web server it works fine, but on the live server I get the following message from sage pay
When uCommerce tries to send an e-mail it will do a local request back to Umbraco to get it to render the body of the e-mail using the standard templating system. Typically this issue arises when the domain name of the store is not resolvable locally, i.e. accessing www.mystore.com from the server itself is not possible.
The simplest way to diagnose this issue it to log onto the server via Remote Desktop, open a browser, and try accessing the store using the public domain name.
If that's not possible the fix is to add a hostname to the hosts file on the server for the public domain name pointing to 127.0.0.1
Hi,
I'm getting the same problem 'Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.'
I've tried the process using the SagePay SIMULATOR mode, got the returnUrl with the long querystring ok.
I'm running the code on a public web server with a public DNS server entry, and can TELNET onto ports 80 and 443, so no issues there.
I can browse to the store url locally from the server, so there's no local DNS issues either.
My email template shows fine in the browser so there's no problems with that.
I added the IP Restriction record in IIS as advised earlier on this thread, but still no joy!
My SagePay.config file looks like this (sensitive info removed):
<?xml version="1.0"?>
<sagePayPaymentMethodService
vendor="myvendorname"
txType="PAYMENT"
debug="false"
testMode="TEST"
successUrl="http://mywebsite/cart/Confirmation.aspx"
abortUrl="http://mywebsite"
failureUrl="http://mywebsite"
notificationURL="(auto)"
/>
Any ideas?
Thanks,
Maff
A couple more bits of info that might help:
- the transaction ID for my orders looks like this: VPSTxId=,TxAuthNo=,SecurityKey=Q18NWAYIQW - should the VPSTcId and TxAuthNo be populated?
- the order status is still at 'new' in the database also
Thanks,
Maff
Hello Maff,
Could you post the relevant part of the log, please?
Also, when you say that the order status is still "new", are you sure you do not mean the payment status? The order status should be "basket" at this point.
Kind regards,
Jesper
Hi Jesper,
Where can I find the logs? I don't see anything in the umbracoLog database table.
You're correct - the status in the uCommerce_PurchaseOrder table is 1 (basket) and it's the same in the uCommerce_Payment table.
Thanks,
Maff
Hi Maff,
What versions are you running of Umbraco and uCommerce?
In some versions you can find the logs in "App_Data/Logs".
Kind regards,
Jesper
Umbraco version is 4.9.1, uCommerce version is 4.0.6.13304
I can't see a Logs folder in App_Data
Thanks,
Maff
Hi Maff,
Are you running against a simulator account, or a real customer account?
We have checked the code, and the "RedirectURL" parameter should be set up ok.
Could it be a problem with the TEST environment?
Kind regards,
Jesper
Hi,
I'm running the code against SagePay's test environment, which was set up with a real customer account.
I spoke to someone at SagePay and they said that this error happens when the store doesn't respond to the response they send to us. So it could be be something to do with what uCommerce does after the payment step happens?
Thanks,
Maff
Hi,
Could you please check if you have the "PaymentProcessor.axd" registered as an HttpHandler in the web.config file?
Kind regards,
Jesper
Hi,
Yes - we have this in the httpHandlers section:
<add verb="*" path="PaymentProcessor.axd" type="UCommerce.Transactions.Payments.PaymentProcessor, UCommerce" />
and this in the handlers section:
<add verb="*" path="PaymentProcessor.axd" preCondition="integratedMode" name="PaymentProcessor" type="UCommerce.Transactions.Payments.PaymentProcessor, UCommerce" />
Thanks,
Maff
Hi Maff,
Can you please check if the url is available from outside your own network? Can you access the urls from a phone, for example?
The problem is most likely one of availability.
Kind regards,
Jesper
Hi Jesper,
Thanks for your response but we ended up ditching uCommerce and now we're using Tea Commerce instead.
Thanks,
Maff
is working on a reply...