Payment not completed error

I am using a sandbox account, and I set United States in the region column (Settings>General>Language & Region>Region to US). I added test cards like (American Express and Visa) and the cards added successfully. But I am trying to pay then I get an error like "Payment Not Completed".

Note: I am trying from India.

Please let me know what exactly i am doing mistake here

Following code i am using.

<script src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js%22%3E%3C/script>

function onApplePayButtonClicked() {

    if (!ApplePaySession) {
        return;
    }

    // Define ApplePayPaymentRequest
    const request = {
        "countryCode": "US",
        "currencyCode": "USD",
        "merchantCapabilities": [
            "supports3DS"
        ],
        "supportedNetworks": [
            "visa",
            "masterCard",
            "amex",
            "discover"
        ],
        "total": {
            "label": "Demo (Card is not charged.)",
            "type": "final",
            "amount": "1.99"
        }
    };

    // Create ApplePaySession
    const session = new ApplePaySession(3, request);

    session.onvalidatemerchant = event => {
        // Call your own server to request a new merchant session.
        var merchantSession = merchantValidation(event.validationURL);
        session.completeMerchantValidation(merchantSession);
    };

    session.onpaymentmethodselected = event => {
        // Define ApplePayPaymentMethodUpdate based on the selected payment method.
        // No updates or errors are needed, pass an empty object.
        const update = {};
        session.completePaymentMethodSelection(update);
    };

    session.onshippingmethodselected = event => {
        // Define ApplePayShippingMethodUpdate based on the selected shipping method.
        // No updates or errors are needed, pass an empty object. 
        const update = {};
        session.completeShippingMethodSelection(update);
    };

    session.onshippingcontactselected = event => {
        // Define ApplePayShippingContactUpdate based on the selected shipping contact.
        const update = {};
        session.completeShippingContactSelection(update);
    };

    session.onpaymentauthorized = event => {
        // Define ApplePayPaymentAuthorizationResult
        const result = {
            "status": ApplePaySession.STATUS_SUCCESS
        };
        session.completePayment(result);
    };

    session.oncouponcodechanged = event => {
        // Define ApplePayCouponCodeUpdate
        const newTotal = calculateNewTotal(event.couponCode);
        const newLineItems = calculateNewLineItems(event.couponCode);
        const newShippingMethods = calculateNewShippingMethods(event.couponCode);
        const errors = calculateErrors(event.couponCode);

        session.completeCouponCodeChange({
            newTotal: newTotal,
            newLineItems: newLineItems,
            newShippingMethods: newShippingMethods,
            errors: errors,
        });
    };

    session.oncancel = event => {
        // Payment canceled by WebKit
    };

    session.begin();
}
Answered by DTS Engineer in 811795022

Hi @ravikumar111,

Please see the following technote for troubleshooting guidance:

TN3174: Diagnosing issues with the Apple Pay payment sheet on your website https://developer.apple.com/documentation/technotes/tn3174-diagnosing-issues-with-the-apple-pay-payment-sheet-on-your-website

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Hi @ravikumar111,

Please see the following technote for troubleshooting guidance:

TN3174: Diagnosing issues with the Apple Pay payment sheet on your website https://developer.apple.com/documentation/technotes/tn3174-diagnosing-issues-with-the-apple-pay-payment-sheet-on-your-website

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Payment not completed error
 
 
Q