Posts

Post not yet marked as solved
4 Replies
3.8k Views
Hi,I have integrated the Applepay JS into my Website following the guide from: https://github.com/norfolkmustard/ApplePayJSMy merchantValidation object looks like :{ "epochTimestamp":1499863886166, "merchantSessionIdentifier":"44xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx24", "nonce":"7xxxxxx7f", "merchantIdentifier":"91xxxxxxxxxxxxxxxxxxxxxxx0B", "domainName":"abc.com", "displayName":"demoName", "signature":"308006092a864xxxxxxxxxxxxx000000" }However, on passing this to session.completeMerchantValidation, I keeping getting Payment Not Completed Error and the payment sheet keeps closing immediately.Note: I am executing my code in my local enviroment which is different from the one being passed in the domainName in the merchantValidation object.Please help me out. Thanks in advance.
Posted
by aritrag.
Last updated
.
Post not yet marked as solved
0 Replies
803 Views
Hi, I am looking to optimize the Merchant Validation process as it is talking some time due to validations from the Apple Server. I am using this code snippet for the merchant validation call: session.onvalidatemerchant = function(event) { var promise = performValidation(event.validationURL); promise.then(function(merchantSession) { session.completeMerchantValidation(merchantSession); }); };And my Ajax Call being :function performValidation(validateURL) { return new Promise(function(resolve) { var domain = window.location.hostname; $.ajax({ url: urlPrefix + "/cart/applepay/validateMerchant", type: "POST", data: { url: validateURL, domainName: domain }, success: function(data) { data = JSON.parse(data); resolve(data); }, error: function() { resolve("failed"); } }) }) }Please let me know if using promises is the right way to go as given in the sample Emporium Code in Apple Website. Let me know if there are other performance optimizing methods to resolve this.
Posted
by aritrag.
Last updated
.