Issue in the payment processing after the merchant validation

    session.onvalidatemerchant = function(event) {
        const validationURL = event.validationURL;
        console.log("Validation URL:", validationURL);

        document.getElementById('methodapplepay').value = "validate";
        document.getElementById('validationURL').value = validationURL;

        $.ajax({
            url: 'ajax/processInternalDonate.php',
            type: 'POST',

            data: $("#payment_form").serialize(),
            success: function(dataValidate) {

                
                
                dataValidate = JSON.parse(dataValidate);


                
                                    
                
                session.completeMerchantValidation(dataValidate);
                
            },
            error: function(xhr, status, error) {
                console.error('Merchant validation failed:', error);
                
                session.abort();
            }
        });
    };

    session.onpaymentauthorized = function(event) {
        var payment = event.payment;
        

        

        $.ajax({
            url: 'ajax/processInternalDonate.php',
            type: 'POST',
            data: {pay_mode:"pay_mode",method:"process_payment",payment:JSON.stringify(payment)},
            success: function(dataprocess) {
                if (dataprocess.success) {
                    session.completePayment(ApplePaySession.STATUS_SUCCESS);
                } else {
                    session.completePayment(ApplePaySession.STATUS_FAILURE);
                }
            },
            error: function(xhr, status, error) {
                console.error('Payment processing failed:', error);
                session.completePayment(ApplePaySession.STATUS_FAILURE);
            }
        });
    };

 from this above two session methods for the first method I got the merchant validation response from the API calling from that method but for the session.onpaymentauthorized  when the second API is calling then I got the message payment not processed on my apple pay popup upon autorisation from my phone so I want that you provide me the correct backend flow for this API calling so we get the amount charged and I also got the payment object from event.object on logging in my console.
Answered by DTS Engineer in 811797022

Hi @Roni123,

Please see the following technotes for troubleshooting guidance on payment processing failures:

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

TN3176: Troubleshooting Apple Pay payment processing issues https://developer.apple.com/documentation/technotes/tn3176-troubleshooting-apple-pay-payment-processing-issues)

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Hi @Roni123,

Please see the following technotes for troubleshooting guidance on payment processing failures:

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

TN3176: Troubleshooting Apple Pay payment processing issues https://developer.apple.com/documentation/technotes/tn3176-troubleshooting-apple-pay-payment-processing-issues)

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Issue in the payment processing after the merchant validation
 
 
Q