Payment not completed error with Apple Pay on Sand box

Hi, i was integrating apple pay on my application for which I have setup all the required certificated and domain mapping.
Also I hv added tester account [sandbox] user whose login I can use to test this functionality on mobile device. Now, all things are ready but when I try to click on apple pay button it opens cards page with my demo card added in it and after 5sec processing it shows Payment not completed with error symbol and pop up appears with "this website was not able to complete payment. Please try Again."
I'm not able to understand where these things are failing.
Can somebody guid me through it?

Payment not completed with error symbol and pop up appears with "this website was not able to complete payment.

I would double check in the Developer Portal that you have setup Domain Verification properly. If that is not it, I would double check on your server side if there were any errors when you tried to request a payment session.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Hey Matt, did u get any flaw in our settings? I also double check all the setup but it is as per the documentation given by apple team. Now, it became critical for me to move forward without this step. Let me know if you need additional details or we can connect over the call to solve this or to identify the mistake.


Akshay Bora
HolidayME
akshay.bora@holidayme.com

did u get any flaw in our settings?

I do not know anything about your settings to check them, that is why I mentioned that you should double check this in the Developer portal or on the server side as this is the most common area where issues like this crop up. I would do that first and if you are still unable to resolve then please provide any server side errors or any configuration logs/issues that you uncover and I can try to point you in the right direction.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

Hi Matt, I have checked and confirmed the merchant settings , they are as expected. For the server logs, there is an exception on SSL handshake while attempting to call validation url, please check logs below,

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure --- End of inner exception stack trace --- at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount) at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, ArraySegment1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions) --- End of inner exception stack trace --- at System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) at System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslStream.ThrowIfExceptional() at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__65_1(IAsyncResult iar) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at TZY.Web.UI.Service.ApplePayClient.GetMerchantSessionAsync(Uri requestUri, MerchantSessionRequest request, CancellationToken cancellationToken) in C:\Git\TZY.Logger.VerifyExtensions\TZY.Logger.VerifyExtensions\TZY.Web.UI\Service\ApplePayClient.cs:line 40 at TZY.Web.UI.Controllers.HomeController.Validate(ValidateMerchantSessionModel model, CancellationToken cancellationToken) in C:\Git\TZY.Logger.VerifyExtensions\TZY.Logger.VerifyExtensions\TZY.Web.UI\Controllers\HomeController.cs:line 94 at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Due to this , we are not able to move ahead in integration.Please help.

Regards, Akshay HolidayME

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure -

I think it's safe to say that I am not a .NET expert, so take this advice grain of salt. Having said that, no matter what language you have on the server side, when you see a SSL / TLS handshake issue indicating an authentication failure while communicating with the Apple Pay servers then it's safe to assume that the first place you need to look is your 2-way TLS on the server to get your Payment Session. This would include the usage of your Merchant Identity (Certificate and Key), so I would take a look at this formatting and usage as a next step.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

Hi @meaton, I am getting payment token session from apple server while doing merchant validation but it's also not working for me. here is the response that i am getting while calling apple server for payment session.

{ "epochTimestamp":1626243934332, "expiresAt":1626247534332, "merchantSessionIdentifier":"SSHAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx24", "nonce":"axxxxxx9e", "merchantIdentifier":"F788084xxxxxxxxxxxxxxxxxxxxxxx7BD9", "domainName":"example.com", "displayName":"Example", "signature":"30800606092a864xxxxxxxxxxxxx6e746", "operationalAnalyticsIdentifier":"Example:F788xxxxxxxxxxxxx7BD9", "retries":0 }

However, on passing this to session.completeMerchantValidation, I keeping getting Payment Not Completed Error and the payment sheet keeps processing for 5 secs and it's throws error "Payment not completed"

Any solution?

Hi All, Did anyone got solution for this issue?

Any Solution for this?

I am getting a valid session and after authorization of payment sheet from device, Apple server send empty object to my paymentGateway. Any suggestions?

I do not understand why Apple optionally does not provide way to users (or to developers in console) to see some error details? You can google https://www.google.com/search?q=apple+pay+%22payment+not+completed%22 that there are thousands topics about it over the internet. And solution easy - add some way to show more error details what is the problem. The status how it is now with just simple "payment not completed" it is just lottery. Apple developers works like ... someone on the street ask you what time is it and you answer find out! So dear users/developers guess why apple pay is not working and we do not know if it is developer error or user error - answer is the same "just error".

Payment not completed error with Apple Pay on Sand box
 
 
Q