Skip to content

Magento 2 update braintree SDK

We are using Magento 2.3.5 version we want to update Braintree SDK version from 3.79.1 to 3.97.0

file-path – vendor/gene/module-braintree/view/base/requirejs-config.js
this is the code –

/**
 * Config to pull in all the relevant Braintree JS SDKs
 * @type {{paths: {braintreePayPalInContextCheckout: string, braintreePayPalCheckout: string, braintreeVenmo: string, braintreeHostedFields: string, braintreeDataCollector: string, braintreeThreeDSecure: string, braintreeGooglePay: string, braintreeApplePay: string, braintreeAch: string, braintreeLpm: string, googlePayLibrary: string}, map: {"*": {braintree: string}}}}
 */
var config = {
    map: {
        '*': {
            braintree: 'https://js.braintreegateway.com/web/3.79.1/js/client.min.js'
        }
    },

    paths: {
        braintreePayPalCheckout: 'https://js.braintreegateway.com/web/3.79.1/js/paypal-checkout.min',
        braintreeHostedFields: 'https://js.braintreegateway.com/web/3.79.1/js/hosted-fields.min',
        braintreeDataCollector: 'https://js.braintreegateway.com/web/3.79.1/js/data-collector.min',
        braintreeThreeDSecure: 'https://js.braintreegateway.com/web/3.79.1/js/three-d-secure.min',
        braintreeApplePay: 'https://js.braintreegateway.com/web/3.79.1/js/apple-pay.min',
        braintreeGooglePay: 'https://js.braintreegateway.com/web/3.79.1/js/google-payment.min',
        braintreeVenmo: 'https://js.braintreegateway.com/web/3.79.1/js/venmo.min',
        braintreeAch: 'https://js.braintreegateway.com/web/3.79.1/js/us-bank-account.min',
        braintreeLpm: 'https://js.braintreegateway.com/web/3.79.1/js/local-payment.min',
        googlePayLibrary: 'https://pay.google.com/gp/p/js/pay',
        braintreePayPalInContextCheckout: 'https://www.paypalobjects.com/api/checkout'
    }
};

when we are override in our theme with updated version –
app/design/frontend/Infortis/base/Magento_Paypal/requirejs-config.js

/**
 * Config to pull in all the relevant Braintree JS SDKs
 * @type {{paths: {braintreePayPalInContextCheckout: string, braintreePayPalCheckout: string, braintreeVenmo: string, braintreeHostedFields: string, braintreeDataCollector: string, braintreeThreeDSecure: string, braintreeGooglePay: string, braintreeApplePay: string, braintreeAch: string, braintreeLpm: string, googlePayLibrary: string}, map: {"*": {braintree: string}}}}
 */
var config = {
    map: {
        '*': {
            braintree: 'https://js.braintreegateway.com/web/3.97.0/js/client.min.js'
        }
    },

    paths: {
        braintreePayPalCheckout: 'https://js.braintreegateway.com/web/3.97.0/js/paypal-checkout.min',
        braintreeHostedFields: 'https://js.braintreegateway.com/web/3.97.0/js/hosted-fields.min',
        braintreeDataCollector: 'https://js.braintreegateway.com/web/3.97.0/js/data-collector.min',
        braintreeThreeDSecure: 'https://js.braintreegateway.com/web/3.97.0/js/three-d-secure.min',
        braintreeApplePay: 'https://js.braintreegateway.com/web/3.97.0/js/apple-pay.min',
        braintreeGooglePay: 'https://js.braintreegateway.com/web/3.97.0/js/google-payment.min',
        braintreeVenmo: 'https://js.braintreegateway.com/web/3.97.0/js/venmo.min',
        braintreeAch: 'https://js.braintreegateway.com/web/3.97.0/js/us-bank-account.min',
        braintreeLpm: 'https://js.braintreegateway.com/web/3.97.0/js/local-payment.min',
        googlePayLibrary: 'https://pay.google.com/gp/p/js/pay',
        braintreePayPalInContextCheckout: 'https://www.paypalobjects.com/api/checkout'
    }
};

Then in browser view page source it is showing 2 times.
How to update SDK version here ?