Apple Pay processing stuck

I am implementing a payment integration with Cybersource using Apple Pay. I was able to request a valid merchant session from the Apple Pay Servers and pass it to the completeMerchantValidation function (apple pay on the web). The payment sheet pops up but keeps getting stuck at "processing". After 30-60 seconds an error pops up: "Apple Pay Not Completed. This website was not able to complete the payment. Please try again.". I found one related topic on the Apple forum but the only solution had something to do with the domain (initiativeContext) but I doubled checked and this was not my problem.

Does someone has any idea why this is not working?

I am trying to figure out why it is stuck at processing for days now but I can't find anything...

Accepted Reply

I was stuck at this exact step as well. But after some trial and error, I figured that the documentation is not quite exact at the description of completePaymentMethodSelection.
It says that you can pass an empty object if there is no update to send. But in fact, you have to respond with at least a "newTotal" key representing your current (unchanged) total, e.g.:

this.applePaySession.onpaymentmethodselected = event => {
    // Define ApplePayPaymentMethodUpdate based on the selected payment method.
    // No updates or errors are needed, pass an empty object.
    const update = {
        "newTotal": {
            "label": "Demo",
            "type": "final",
            "amount": 42.00,
        }
    };
    this.applePaySession.completePaymentMethodSelection(update);
};

Sending this instead of an empty object finally brought me one step further and let me approve the transaction on the iPhone.

  • You are an absolute legend! I was stuck at this step for over a month. Sending the object instead of the empty object fixed the issue.

  • Thank you so much for this. Two weeks of hunting for this solution that no one else came up with, and it solved my problem right away.

Add a Comment

Replies

I found one related topic on the Apple forum but the only solution had something to do with the domain (initiativeContext)

Right, this can happen if you use https://example.com/path in your initiativeContext instead of just example.com.

Other than that there are many reasons this can happen. I would take a look at TN3103 Apple Pay on the Web troubleshooting guide for more information on how to debug this further.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
  • Hi Matt,

    Thanks for your reply. The domain in the initiativeContext is correct so I don't think the issue is related to that.

    I was wondering, I get a valid response from the Apple servers when validating the merchant using the validationURL retrieved from the client. The only thing I am not 100% sure of is all the different kind of certificates. As I get a valid json response from the validation URL, I assume my certificates are correct. Can I rule out the certificates being an issue?

    The device itself is also not the issue. I am logged in as a Sandbox tester and was able to do a payment via https://applepaydemo.apple.com/.

    The only parameters that are shared between client and server is the merchant identifier and the domain (initiativeContext) the request is send from. If I change one the merchant identifiers (client or server), I get an error from the validationURL which means the merchant identifier is not the issue. The initiativeContext is the only thing remaining which I checked numerous times and is configured correctly.

Add a Comment

I was stuck at this exact step as well. But after some trial and error, I figured that the documentation is not quite exact at the description of completePaymentMethodSelection.
It says that you can pass an empty object if there is no update to send. But in fact, you have to respond with at least a "newTotal" key representing your current (unchanged) total, e.g.:

this.applePaySession.onpaymentmethodselected = event => {
    // Define ApplePayPaymentMethodUpdate based on the selected payment method.
    // No updates or errors are needed, pass an empty object.
    const update = {
        "newTotal": {
            "label": "Demo",
            "type": "final",
            "amount": 42.00,
        }
    };
    this.applePaySession.completePaymentMethodSelection(update);
};

Sending this instead of an empty object finally brought me one step further and let me approve the transaction on the iPhone.

  • You are an absolute legend! I was stuck at this step for over a month. Sending the object instead of the empty object fixed the issue.

  • Thank you so much for this. Two weeks of hunting for this solution that no one else came up with, and it solved my problem right away.

Add a Comment