Pay sheet - Payment Not Completed

Hey all,


I am able to successfully create a merchant session and send my session object to the completeMerchantValidation method.

merchantSession =
{
  "epochTimestamp": 1111111,
  "merchantSessionIdentifier": "2b...c24",
  "nonce": "2b...ad",
  "merchantIdentifier": "0f..9f",
  "domainName": "mysite.store.com",
  "displayName": "MyStore",
  "signature": "308...00"
};
session.completeMerchantValidation(merchantSession);


*note* I am using the real merchantSession passed back from the POST to the validationURL, what I have above is mocked.


It seems that after this function (completeMerchantValidation) gets my merchantSession object, the session.oncancel is triggered and my payment sheet shows a message:

"Payment Not Completed". Basically my sheet does the "processing" then almost immediatly displays "Payment Not Completed" and self-closes.

Has anybody encoutered this issue before?

Answered by cmghawk in 158255022

Hey,


I actually only get this error when running locally. When I run the code on a verified domain I do not see that error anymore. I will do some more validation and let you know if it is truely an environmental issue.


I do have a sandbox provisioned card, Ill have to checkout that string issue that you saw - but I did have those methods and that didn't seem to fix anything. very odd


*FOLLOW UP*

I confirmed that I can only run this on a verified domain aka environmental issue (so localhost is out the window).

I'm getting the same error as well and have no clue why. I'm also able to pass in the applePaySession object to the completeMerchantValidation function. I have no idea why this would be happening and would assume it is a bug.

This is the response I received from Apple:


Can you confirm whether you have an Apple Pay test card provisioned to your device and are using it to attempt the transaction? Here is some additional information: https://developer.apple.com/support/apple-pay-sandbox/

Just out of curiosity but do you have functions associated with the onpaymentmethodselected, onshippingcontactselected, and the onshippingmethodselected DOM events with their complete functionality being called within them? I was able to resolve my issue by passing in the merchantSession and having these DOM event properly fleshed out and by calling their completed functionality counterparts.

Also I noticed that my epochtime was coming back as a string which killed safari and displaying a "string to unsigned integer error". Once I was able to parse it as an integer everything seemed to work out fine.

Accepted Answer

Hey,


I actually only get this error when running locally. When I run the code on a verified domain I do not see that error anymore. I will do some more validation and let you know if it is truely an environmental issue.


I do have a sandbox provisioned card, Ill have to checkout that string issue that you saw - but I did have those methods and that didn't seem to fix anything. very odd


*FOLLOW UP*

I confirmed that I can only run this on a verified domain aka environmental issue (so localhost is out the window).

Pay sheet - Payment Not Completed
 
 
Q