Sagepay: Payment Authorised and Then Failed - opayo

I'm using Server/InFrame integration, and according to Sagepay support, there are (rare) occasions when we get a notification about a successful payment (via an OK status), but this is then later failed. This can happen, according to Sagepay support, when they haven't been able to contact the bank properly.
I'm unable to find details about this in the documentation at http://www.sagepay.co.uk/file/1161/download-document/SERVERProtocolandIntegrationGuidelinesV3%200.pdf?token=0eZCcKj0tm33YeZ4gfrk4pHPaLClQnRcq3_vXsISjHI . The closest thing I see is in Step 12,
when SagePay sends batch files to the bank
If transactions are rejected, we correct any errors and resubmit them for you.
What happens, in terms of status codes sent to the notification url, in a case when this batch fails, or there is some other error after the "OK" is sent to the notification url? Is there any official documentation to handle this case, or similar cases when a payment is "OK", but then later fails?
Edit: I'm seeing that the simulator doesn't seem to handle this case either. Is there a way to properly test/simulate this case, when OK is sent, but then later failed?

The only reason you would receive a mixed message, such as Error/Failed on My Sage Pay but OK via Notification URL, is if an error occured during the notiication which returned an error/invalid response.
If the notification response via the Notification URL is interrupted i.e. browser refresh/closed etc Sage Pay may pick this up as error after the authorisation from the bank has been received as OK. We will then send Error via Notification URL to confirm the transaction has failed.
We'll send the notification several times until we receive a successful response/handshake from you in which you confirm the Status, StatusDetail and RedirectURL.
This scenario does not occur often however if you are able to provide a TXID example, our contact details can be found via http://www.sagepay.co.uk/contact, within 72 hours of the transaction being posted, we can investigate the reason for failure against the transaction logs.
Sage Pay Support

Related

Regarding uable to trigger Paypal REST API webhook events from developer sandbox

What is wrong with my Paypal sandbox account process
to receive webhook notifications? We are unable to receive webhook event on
my URL.
URL working with "Webhooks simulator". Please let me know what
should I do for receive webhook event on above URL.
Webhooks simulator sends sample payloads for the events you configured. It does not send a notification on triggering of an actual event.
If you are getting notification via Webhooks Simulator, it means the URL configured by you is able to intercept POST requests.
Now for the "Paypal sandbox account unable to process to receive Webhook notifications" part, please check if the transaction is actually created at https://developer.paypal.com/developer/dashboard/sandbox/ . If the transaction you are looking for is not present there, there won't be any notification generated. In case transaction is present there and still you are not getting any notifications, please share debug id.
Here is a silly thing that I overlooked in the documentation and only found out after contacting support.
After you've followed the approval url and gave your approval, dit you execute the payment with the REST API?
https://developer.paypal.com/docs/api/payments/#payment_execute
Webhooks are only called after you've executed the payment.
The confusing part is; there is no webhook being called, when a user approves or cancels a payment. There is only a redirect back to a return url or cancel url. So you either need to monitor the redirect back to your site and trigger the execute call then, or find another way (like polling the payment) to see the status change before calling the execute call.

AuthorizeNet Omnipay Error

I am using omnipay package for my payment method in authorized.
I have two site on the same server, one is a live site that runs ssl and one that is for testing purposes only and do not run ssl.
Now, i dont have problem on paying in our testing site which it runs within our expectation. But, it seems odd in our live site because after entering my billing information, it returns an error that says:
An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.
Where do u think the problem lies? I really need help on this. Thanks!
This means the relay response URL used by your application is not returning a successful response to Authorize.Net in time (5 seconds). As a result Authorize.Net is assuming the page is not functioning and displaying that message.
You either need to verify the URL is correct, not error-ing out, and responding within a few seconds.

After a successful Magento payment via SagePay, the customer is redirected to the empty basket page. Why?

As a team we're currently investigating a strange occurrence. It doesn't seem to apply to all orders by any means, but it is affecting a large number of customers based on the logging we've added to the noItems.phtml page.
Please note: I'm not really expecting an answer as I assume this is a problem we have to solve ourselves based on addons, and our server configuration (three servers for loading balancing). However, I am looking for possible ideas and/or whether this is something somebody has come across previously.
What we've done so far, and what we know:
User enters their card details in the SagePay iFrame;
User purchases an item via SagePay -- order is successful;
Some users are sent back to the success page;
Some users don't see the success page (phoned to confirm a handful) but instead return back to the empty basket;
We're still investigating, but we find it ever so strange how a user would return to the empty basket page. We've added logging to the noItems.phtml and we can see that some users are getting assigned another session ID after a successful transaction. This seems to be the problem, but why the user is being assigned another session ID after a SagePay payment isn't easy to comprehend.
Has anybody else experienced a similar issue with SagePay/Magento? And if so, what steps did you take to solve?
Our Sage Pay Support team would be happy to look at the transaction logs (within 72 hours of the transation being submitted) and help you determine the reason for the failed transactions on 0845 111 4455 24/7.
You reply to the Notification URL when you acknowledge receipt of our response. You have 20 seconds to response. You need to send the Status (OK, Error or Invalid), Status Detail and Redirect URL. We then send the shopper back to your Redirect URL.
A few suggestions would be:
If we can't reach your Notification URL, check you have ports 443 and 80 open. Check you don't have a DNS issue.
If you are receiving the notification from Sage Pay to confirm the status of the transaction via the Notification URL. Check the information you are sending is in the correct casing, that it is not empty data and that your website is not spooling and check whether the success/failure URL is a valid landing page.
All our system needs is the Status Deatil, 'Status = ' and 'RedirectURL =' fields with the appropriate values assigned, separated with Carriage-Return and Line-Feeds (as specified in the protocol) . Nothing else is required. The response you send should also be text/plain message, not text/html or any other MIME type.
If the customer is being sent back to an empty basket, check whether your website is doing a job in the background such as writing to a databse, preparing confirmation emails to the back office before sending the customer to the payment page. Test whether your server can handle the amount of transactions coming through from Sage Pay. Or are you truncating the NEXT URL?
Regarding a session ID, each transaction is assigned a unique Sage Pay ID called a VPSTxID which is used to identify the transaction. We can take a look at the transactions you are referring to if you are getting several session IDs to discuss further if you would like.
Sage Pay Support.
Check the action that pushes the user to the success page on successful purchase. Maybe its something like target _parent. Maybe its something where its trying to load the success page in the iframe. Or maybe its timing out on sagepay when trying to redirect.

How is dead device identification done in windows phone

How is dead device identification done in windows phone when we make use of micosoft push notification service? Does mspn store information about such devices? Is it possible for an application to retrieve the list?
Uri Channels can expire. This is why you should regularly check and refresh them from the client.
If the channel is no longer valid (as will happen when the app isn't used for a long time and the URI expires) you'll get an error in the repsonse when you try and send the message.
You shoudl use this method to detect URIs that are no longer valid.
There is no way to get a list of URIs that are no longer valid or to test validity without sending a message.
There is no way to ask the server for any expired notification channels however if you look t the response codes coming back from the MS services when you're attempting to send a notification (from your server) you'll be able to determine if the channel has expired. If you look at Push Notification Service Response Codes for Windows Phone you'll note that basically if you get a 404 Not Found back from the service then the channel has been expired and you should stop sending to it. It's worthwhile handling the other cases as well. Eg. Handling 200 OK / QueueFull messages correctly allows you to lighten the workload on your server by pausing notifications for that subscription for a period of time.

Sagepay API - Simulate rejected payments?

I'm testing an app which accepts payments through Sagepay.
It all seems to be working OK but I would like to test various types of non-successful responses in the Sagepay sandbox.
For example, each test I have done so far has returned a status of OK. It is also possible to receive statuses like REJECTED, NOTAUTHED, INVALID etc
Is it possible to simulate these responses in some way?
Entering incorrect details repeatedly just returns me to the failure URL I specify in the API settings.
If you login to your simulator account on Sagepay via https://test.sagepay.com/simulator/ you can tell it which responses to return. You can instruct it to return random responses, or MALFORMED, INVALID, ERROR, NOTAUTHED, REJECTED, 3DAUTH.
Unfortunately you have to change these through the admin panel and then they apply for each transaction rather than using different details to trigger different responses.
In addition to Steve's answer, if you use the SERVER integration you can click different buttons to SIMUALATE (on the SIMULATOR server) a reply from SagePay gateway.

Resources