ApplePay payment not completed (event.payment is empty)

After biometric authentication , there is no callback from applePaySession , event.payment is empty/undefined in applepay JS implementation.

what is the solution for this ?

Answered by Systems Engineer in 703468022

After biometric authentication , there is no callback from applePaySession , event.payment is empty/undefined in applepay JS implementation.

Did biometric authentication fail silently? Try reproducing this on a device, or macOS, while capturing logs from the Console.app. Is there any information or logs in there about a failure during this step?

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Accepted Answer

After biometric authentication , there is no callback from applePaySession , event.payment is empty/undefined in applepay JS implementation.

Did biometric authentication fail silently? Try reproducing this on a device, or macOS, while capturing logs from the Console.app. Is there any information or logs in there about a failure during this step?

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

@meaton

I am trying on macOs devices only, There were no logs After Biometric authentication 20-30 seconds of processing text and then payment not completed can you tell me how to proceed further on this ?

@meaton , sending logs in 2 parts from console app

`default	12:21:48.931725+0530	PassbookUIService	State change: PKPaymentAuthorizationStateAuthorize
default	12:21:48.930535+0530	PassbookUIService	Task Completed: <private>
default	12:21:48.930972+0530	PassbookUIService	Response:
<private> 200 <private>
<private>
<private>
default	12:21:48.931617+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateNonce to PKPaymentAuthorizationStateAuthorize with param: <private>
default	12:21:48.931895+0530	PassbookUIService	State change: PKPaymentAuthorizationStateAuthorize
default	12:21:48.934679+0530	PassbookUIService	PKPaymentSession: starting in-app session...
default	12:21:48.935411+0530	PassbookUIService	PKPaymentSession: starting in-app session...
default	12:21:48.959901+0530	passd	PDNFSecureXPCEventStreamManager: ignoring event <private>.
default	12:21:48.959937+0530	passd	PDNFSecureXPCEventStreamManager: ignoring event <private>.
default	12:21:49.038465+0530	PassbookUIService	Time profile: In-App Payment Session Start: 0.107656 seconds
default	12:21:49.038707+0530	PassbookUIService	PKInAppPaymentSession (0x28379d140): started in-app session 0x28142f2f0.
default	12:21:49.039325+0530	PassbookUIService	Authorizing Payment Request: <private> for Payment Application <private> (Applet: <private>) with nonce: <private>
default	12:21:49.038556+0530	PassbookUIService	Time profile: In-App Payment Session Start: 0.107656 seconds
default	12:21:49.038826+0530	PassbookUIService	PKInAppPaymentSession (0x28379d140): started in-app session 0x28142f2f0.
default	12:21:49.039746+0530	PassbookUIService	Authorizing Payment Request: <private> for Payment Application <private> (Applet: <private>) with nonce: <private>
default	12:21:49.138046+0530	PassbookUIService	PKInAppPaymentSession (0x28379d140): invalidating...
default	12:21:49.138418+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateAuthorize to PKPaymentAuthorizationStateRewrap with param: <private>
default	12:21:49.138561+0530	PassbookUIService	State change: PKPaymentAuthorizationStateRewrap
error	12:21:49.140957+0530	PassbookUIService	State change not implemented: PKPaymentAuthorizationStateRewrap
default	12:21:49.141251+0530	PassbookUIService	PKInAppPaymentSession (0x28379d140): invalidated.
default	12:21:49.138247+0530	PassbookUIService	PKInAppPaymentSession (0x28379d140): invalidating...
default	12:21:49.138504+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateAuthorize to PKPaymentAuthorizationStateRewrap with param: <private>
default	12:21:49.138709+0530	PassbookUIService	State change: PKPaymentAuthorizationStateRewrap
error	12:21:49.141200+0530	PassbookUIService	State change not implemented: PKPaymentAuthorizationStateRewrap
default	12:21:49.141320+0530	PassbookUIService	PKInAppPaymentSession (0x28379d140): invalidated.
default	12:21:49.163700+0530	PassbookUIService	Performing request:
POST <private>
<private>
<private>
default	12:21:49.163747+0530	PassbookUIService	Performing request:
POST <private>
<private>
<private>
default	12:21:49.317986+0530	passd	PDNFSecureXPCEventStreamManager: ignoring event <private>.
default	12:21:49.318030+0530	passd	PDNFSecureXPCEventStreamManager: ignoring event <private>.
default	12:21:50.080077+0530	PassbookUIService	Task Completed: <private>
default	12:21:50.080735+0530	PassbookUIService	Response:
<private> 200 <private>
<private>
<private>
default	12:21:50.081001+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateRewrap to PKPaymentAuthorizationStateAuthorized with param: <private>
default	12:21:50.081326+0530	PassbookUIService	State change: PKPaymentAuthorizationStateAuthorized
default	12:21:50.082364+0530	PassbookUIService	State machine enqueueing callback kind: PKPaymentAuthorizationCallbackKindDidAuthorizePayment object: <private>
default	12:21:50.082622+0530	PassbookUIService	State machine dispatching callback kind: PKPaymentAuthorizationCallbackKindDidAuthorizePayment
default	12:21:50.082747+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateAuthorized to PKPaymentAuthorizationStateClientCallback with param: <private>
default	12:21:50.082878+0530	PassbookUIService	State change: PKPaymentAuthorizationStateClientCallback
default	12:21:50.080007+0530	PassbookUIService	Task Completed: <private>
default	12:21:50.080671+0530	PassbookUIService	Response:
<private> 200 <private>
<private>
<private>
default	12:21:50.080940+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateRewrap to PKPaymentAuthorizationStateAuthorized with param: <private>
default	12:21:50.081260+0530	PassbookUIService	State change: PKPaymentAuthorizationStateAuthorized
default	12:21:50.082303+0530	PassbookUIService	State machine enqueueing callback kind: PKPaymentAuthorizationCallbackKindDidAuthorizePayment object: <private>
default	12:21:50.082557+0530	PassbookUIService	State machine dispatching callback kind: PKPaymentAuthorizationCallbackKindDidAuthorizePayment
default	12:21:50.082688+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateAuthorized to PKPaymentAuthorizationStateClientCallback with param: <private>
default	12:21:50.082815+0530	PassbookUIService	State change: PKPaymentAuthorizationStateClientCallback
default	12:22:16.608107+0530	passd	Connection 43: cleaning up
default	12:22:16.609060+0530	passd	"The connection to ACDAccountStore was invalidated."
default	12:22:16.609648+0530	passd	[C43 2D173E8C-B89E-4ECE-8D70-BACE3A667ADA Hostname#85328357:443 tcp, url hash: 667f8bec, tls, definite, attribution: developer] cancel
default	12:22:16.608436+0530	passd	Connection 43: cleaning up
default	12:22:16.611082+0530	passd	[C43 2D173E8C-B89E-4ECE-8D70-BACE3A667ADA Hostname#85328357:443 tcp, url hash: 667f8bec, tls, definite, attribution: developer] cancelled
	[C43.1 DD7664CD-AFCF-4F86-AE26-0E4693038802 192.168.0.100:52426<->IPv4#130d15d6:443]
	Connected Path: satisfied (Path is satisfied), viable, interface: en0, ipv4, dns
	Privacy Stance: Not Eligible
	Duration: 33.245s, DNS @0.005s took 0.046s, TCP @0.060s took 0.322s, TLS 1.2 took 0.984s
	bytes in/out: 12279/3197, packets in/out: 8/14, rtt: 0.345s, retransmitted bytes: 0, out-of-order bytes: 0
default	12:22:16.609514+0530	passd	"The connection to ACDAccountStore was invalidated."`

default	12:22:16.609771+0530	passd	[C43 2D173E8C-B89E-4ECE-8D70-BACE3A667ADA Hostname#85328357:443 tcp, url hash: 667f8bec, tls, definite, attribution: developer] cancel
default	12:22:16.611498+0530	passd	[C43 2D173E8C-B89E-4ECE-8D70-BACE3A667ADA Hostname#85328357:443 tcp, url hash: 667f8bec, tls, definite, attribution: developer] cancelled
	[C43.1 DD7664CD-AFCF-4F86-AE26-0E4693038802 192.168.0.100:52426<->IPv4#130d15d6:443]
	Connected Path: satisfied (Path is satisfied), viable, interface: en0, ipv4, dns
	Privacy Stance: Not Eligible
	Duration: 33.245s, DNS @0.005s took 0.046s, TCP @0.060s took 0.322s, TLS 1.2 took 0.984s
	bytes in/out: 12279/3197, packets in/out: 8/14, rtt: 0.345s, retransmitted bytes: 0, out-of-order bytes: 0
default	12:22:16.614758+0530	passd	nw_protocol_tcp_log_summary [C43.1:3] 
	[3019FD49-9A3F-4823-A1EF-4A03CF29658E <private>:52426<-><private>:443]
	Init: 1, Conn_Time: 321.293ms, SYNs: 1, WR_T: 0/0, RD_T: 0/0, TFO: 0/0/0, ECN: 0/1/1, TS: 0
	rtt_cache: kernel, rtt_upd: 5, rtt: 345.000ms, rtt_var: 36.750ms rtt_nc: 321.125ms, rtt_var_nc: 54.250ms base rtt: 100ms
	ACKs-compressed: 0, ACKs delayed: 0 delayed ACKs sent: 0
default	12:22:16.615097+0530	passd	nw_flow_disconnected [C43.1 IPv4#130d15d6:443 cancelled channel-flow ((null))] Output protocol disconnected
default	12:22:16.615466+0530	passd	nw_connection_report_state_with_handler_on_nw_queue [C43] reporting state cancelled
default	12:22:16.615756+0530	passd	Connection 43: done
default	12:22:16.615994+0530	passd	tcp_output [C43.1:3] flags=[F.] seq=562048650, ack=3460767855, win=8192 state=FIN_WAIT_1 rcv_nxt=3460767855, snd_una=562048619
default	12:22:16.614860+0530	passd	nw_protocol_tcp_log_summary [C43.1:3] 
	[3019FD49-9A3F-4823-A1EF-4A03CF29658E <private>:52426<-><private>:443]
	Init: 1, Conn_Time: 321.293ms, SYNs: 1, WR_T: 0/0, RD_T: 0/0, TFO: 0/0/0, ECN: 0/1/1, TS: 0
	rtt_cache: kernel, rtt_upd: 5, rtt: 345.000ms, rtt_var: 36.750ms rtt_nc: 321.125ms, rtt_var_nc: 54.250ms base rtt: 100ms
	ACKs-compressed: 0, ACKs delayed: 0 delayed ACKs sent: 0
default	12:22:16.615175+0530	passd	nw_flow_disconnected [C43.1 IPv4#130d15d6:443 cancelled channel-flow ((null))] Output protocol disconnected
default	12:22:16.615541+0530	passd	nw_connection_report_state_with_handler_on_nw_queue [C43] reporting state cancelled
default	12:22:16.615828+0530	passd	Connection 43: done
default	12:22:16.616108+0530	passd	tcp_output [C43.1:3] flags=[F.] seq=562048650, ack=3460767855, win=8192 state=FIN_WAIT_1 rcv_nxt=3460767855, snd_una=562048619
default	12:22:16.932769+0530	passd	tcp_input [C43.1:3] flags=[F.] seq=3460767855, ack=562048650, win=2229 state=FIN_WAIT_1 rcv_nxt=3460767855, snd_una=562048650
default	12:22:16.932962+0530	passd	tcp_input [C43.1:3] flags=[F.] seq=3460767855, ack=562048650, win=2229 state=FIN_WAIT_1 rcv_nxt=3460767855, snd_una=562048650
default	12:22:20.083333+0530	PassbookUIService	Timed out waiting for client callback: <private>
default	12:22:20.083925+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateClientCallback to PKPaymentAuthorizationStateFatalError with param: <private>
default	12:22:20.084073+0530	PassbookUIService	State change: PKPaymentAuthorizationStateFatalError
error	12:22:20.084240+0530	PassbookUIService	Payment failed with fatal error <private>
default	12:22:20.085100+0530	PassbookUIService	subject: inApp event: <private>
default	12:22:20.083483+0530	PassbookUIService	Timed out waiting for client callback: <private>
default	12:22:20.083986+0530	PassbookUIService	State machine change state from PKPaymentAuthorizationStateClientCallback to PKPaymentAuthorizationStateFatalError with param: <private>
default	12:22:20.084166+0530	PassbookUIService	State change: PKPaymentAuthorizationStateFatalError
error	12:22:20.084309+0530	PassbookUIService	Payment failed with fatal error <private>
default	12:22:20.085186+0530	PassbookUIService	subject: inApp event: <private>
default	12:22:20.096075+0530	PassbookUIService	glyphView - revealedErrorAction()
default	12:22:20.096617+0530	PassbookUIService	glyphView - revealedErrorAction()
default	12:22:21.876801+0530	com.apple.WebKit.Networking	PKPaymentAuthorizationCoordinator - dismissWithCompletion
default	12:22:21.877620+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController - handleDismissWithCompletion
default	12:22:21.877981+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController - not dismissed, requesting dismissal
default	12:22:21.877386+0530	com.apple.WebKit.Networking	PKPaymentAuthorizationCoordinator - dismissWithCompletion
default	12:22:21.877871+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController - handleDismissWithCompletion
default	12:22:21.879215+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController - not dismissed, requesting dismissal
default	12:22:21.881340+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController (0x283960900): Dismissing due to host view controller dismissing
default	12:22:21.882179+0530	PassbookUIService	PaymentAuthorizationServiceDelegate - handleHostApplicationDidCancel
default	12:22:21.882508+0530	PassbookUIService	Received cancel
default	12:22:21.880846+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController (0x283960900): Dismissing due to host view controller dismissing
default	12:22:21.881865+0530	PassbookUIService	PaymentAuthorizationServiceDelegate - handleHostApplicationDidCancel
default	12:22:21.882297+0530	PassbookUIService	Received cancel
default	12:22:21.896609+0530	PassbookUIService	Received didReceivePaymentAuthorizationStatus: PKPaymentAuthorizationStatusFailure
default	12:22:21.897979+0530	PassbookUIService	Client errors: <private>
default	12:22:21.898293+0530	PassbookUIService	subject: inApp event: <private>
default	12:22:21.896749+0530	PassbookUIService	Received didReceivePaymentAuthorizationStatus: PKPaymentAuthorizationStatusFailure
default	12:22:21.898166+0530	PassbookUIService	Client errors: <private>
default	12:22:21.898399+0530	PassbookUIService	subject: inApp event: <private>
default	12:22:22.214221+0530	PassbookUIService	PaymentAuthorizationServiceDelegate - handleDismiss
default	12:22:22.214848+0530	PassbookUIService	PaymentAuthorizationServiceDelegate - handleDismiss
default	12:22:22.218986+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController connection invalidated
default	12:22:22.219332+0530	PassbookUIService	PKPaymentAuthorizationRemoteAlertViewController connection invalidated
default	12:22:22.223470+0530	PassbookUIService	Terminating RTC reporting for subject: inApp
default	12:22:22.224899+0530	PassbookUIService	AuthenticatorWrapper - didTransitionToEvaluationState 0
default	12:22:22.226506+0530	com.apple.WebKit.Networking	PKPaymentAuthorizationCoordinator - invalidate connection
default	12:22:22.227658+0530	PassbookUIService	PKAuthenticator (0x28227b800): Invalidating context.
default	12:22:22.223613+0530	PassbookUIService	Terminating RTC reporting for subject: inApp
default	12:22:22.225533+0530	PassbookUIService	AuthenticatorWrapper - didTransitionToEvaluationState 0
default	12:22:22.226893+0530	com.apple.WebKit.Networking	PKPaymentAuthorizationCoordinator - invalidate connection
default	12:22:22.227847+0530	PassbookUIService	PKAuthenticator (0x28227b800): Invalidating context.
default	12:22:22.238715+0530	PassbookUIService	Terminating RTC reporting for subject: inApp
default	12:22:22.238686+0530	PassbookUIService	Terminating RTC reporting for subject: inApp
default	12:22:22.280798+0530	PassbookUIService	PKPaymentAuthorizationremoteAlertViewController (0x12c008800): Dismissing because the remote alert controller will disappear
default	12:22:22.282798+0530	passd	Assertion Invalidated: <private>
default	12:22:22.283809+0530	passd	[com.apple.Passbook] Getting delivered notifications
default	12:22:22.280858+0530	PassbookUIService	PKPaymentAuthorizationremoteAlertViewController (0x12c008800): Dismissing because the remote alert controller will disappear
default	12:22:22.294816+0530	passd	[com.apple.Passbook] Got 0 delivered notifications [ hasCompletionHandler: 1 ]
default	12:22:22.295192+0530	passd	Updating Suppressed User Notifications: <private> in Notification Center: <private>
default	12:22:22.282860+0530	passd	Assertion Invalidated: <private>
default	12:22:22.283974+0530	passd	[com.apple.Passbook] Getting delivered notifications
default	12:22:22.294864+0530	passd	[com.apple.Passbook] Got 0 delivered notifications [ hasCompletionHandler: 1 ]
default	12:22:22.295238+0530	passd	Updating Suppressed User Notifications: <private> in Notification Center: <private>
default	12:22:22.341947+0530	passd	PDRemoteAlertHandle (0x110f06210): PDRemoteInterfaceTypeInAppPayment deactivated.
default	12:22:22.342411+0530	passd	PDRemoteAlertHandle (0x110f06210): invalidated.
default	12:22:22.341986+0530	passd	PDRemoteAlertHandle (0x110f06210): PDRemoteInterfaceTypeInAppPayment deactivated.
default	12:22:22.342463+0530	passd	PDRemoteAlertHandle (0x110f06210): invalidated.
default	12:22:22.535655+0530	passd	Received state update for 336
default	12:22:22.535693+0530	passd	Received state update for 336

Yeah, the authorization of the transaction is failing but there isn't any great information to go on in the logs:

default	12:22:20.083333+0530	PassbookUIService	Timed out waiting for client callback: <private>
default	12:22:20.083925+0530	PassbookUIService	State machine change state from 

default	12:22:21.896609+0530	PassbookUIService	Received didReceivePaymentAuthorizationStatus: PKPaymentAuthorizationStatusFailure
default	12:22:21.897979+0530	PassbookUIService	Client errors: <private>
default	12:22:21.898293+0530	PassbookUIService	subject: inApp event: <private>
default	12:22:21.896749+0530	PassbookUIService	Received didReceivePaymentAuthorizationStatus: PKPaymentAuthorizationStatusFailure

Just to confirm, you have implemented the callback for session.onpaymentauthorized ? Also, there is on the following Biometric methods outlined here being performed, correct?

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

@meaton , I have implemented session.onpaymentauthorized and after that I received a Biometric authentication Post giving auth we expects event.payment , but in my case event.payment is not coming from session after authentication I am not getting value for payment , final response i am getting isTrusted : true this value comes when you don't receive expected value from JS

Can you help giving any errors I would look for , or someone might have encountered the same issue I have seen many people got this issue but solutions were not listed

If you are actually authentication the transaction via biometric mean and you have implemented onpaymentauthorized and you are receiving these errors, then it must be something environmental either with your testing account or Merchant Assets.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

@meaton One doubt, when do we not get token from event after biometric , what are the possible reasons apple doesn't give me token back , if it was any environmental or account issue it could have failed a step earlier on completemerchantvalidation but in my case after biometric event.token is undefined or empty

what are the possible reasons apple doesn't give me token back

One that I can think of off the top of my head is the account that is being used on an external device (watchOS or iOS) for biometric authentication does not match the account being used on the Mac. However, I am not exactly sure that describes your situation.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
ApplePay payment not completed (event.payment is empty)
 
 
Q