2

We have a site example.com behind ssl that runs a page with ApplePay. We've got a server side that returns a Merchant Session that looks like the following:

{"epochTimestamp":1581975586106,"expiresAt":1581979186106,"merchantSessionIdentifier":"SSH8E666B0...","nonce":"1239e567","merchantIdentifier":"...8557220BAF491419A...","domainName":"example.com","displayName":"ApplePay","signature":"...20101310f300d06096086480165030402010500308..."}

We receive this response in session.onvalidatemerchant as a string and convert it to a Json Object and pass to session.completeMerchantValidation. As a result we get the following error:

Code: "InvalidAccessError"
Message: "The object does not support the operation or argument"

We run the following code on our page:

.....
session.onvalidatemerchant = (event) => {
        const validationURL = event.validationURL;        
        getApplePaySession(validationURL).then(function (response) {
            try {
                let resp = JSON.parse(response);
                session.completeMerchantValidation(resp);
            } catch (e) {
                console.error(JSON.stringify(e));
            }
        });
    };
....

Additional questions:

  1. Is the object described above a "correct" Merchant Session opaque that needs to be passed to completeMerchantValidation or it's missing some fields?
  2. Is this object needs to be passed as is or it needs to be base64 encoded?
  3. Does it need to be wrapped into another object?

Any help or lead is greatly appreciated.

iraj jelodari
  • 3,118
  • 3
  • 35
  • 45
saltm123
  • 21
  • 2
  • you use "ApplePayPaymentToken" ? – Soleil Feb 18 '20 at 18:22
  • @Soleil we probably will but my guess we are not there yet. We can't pass completeMerchantValidation at this point. As far as I understand, ApplePayPaymentToken comes in later when we are authorizing the Payment. Please let me know if I'm wrong/missing something – saltm123 Feb 18 '20 at 20:09
  • i worked with Apple ID to login users into a app, and need a certificate that generate into account developer, to send request to login user https://help.apple.com/developer-account/#/devbfa00fef7?sub=devf31990e3f – Soleil Feb 18 '20 at 21:39
  • Yes, we passed that step – saltm123 Feb 19 '20 at 04:05

0 Answers0