The PayPal plus checkout for brazil is not working with the PayPal plugin version 5.0.3


The PayPal plus checkout for brazil is not working with the PayPal plugin version 5.0.3

I am getting the following error

ppplusdcc.min.js:32 Uncaught TypeError: Cannot read properties of undefined (reading ‚substr‘)
at Function.Q [as doCheckout] (ppplusdcc.min.js:32:18474)
at e.value (all.js?1651217797837242:7:22729)
at XMLHttpRequest. (all.js?1651217797837242:3:46608)

I have just edited the plugin based on this documentation

Integrate Payment Selection Page

But not working

Can you please help?

Edited files


   createPaymentWall() {
        this.paypal = window.PAYPAL;

            placeholder: this.options.placeholder,
            approvalUrl: this.options.approvalUrl,
            mode: this.options.mode,
            country: this.options.customerCountryIso,
            buttonLocation: this.options.buttonLocation,
            language: this.options.customerSelectedLanguage,
            useraction: this.options.userAction,
            surcharging: this.options.surcharging,
            //showLoadingIndicator: this.options.showLoadingIndicator,
            //showPuiOnSandbox: this.options.showPuiOnSandbox,
            onLoad: this.onPaymentSelectionLoad,

            /* ------Brasil PoC Extension------ */

            payerEmail: this.options.payerEmail,
            payerFirstName: this.options.payerFirstName,
            payerLastName: this.options.payerLastName,
            payerPhone: this.options.payerPhone,
            payerTaxId: this.options.payerTaxId,

            /*  -------------------------------- */
    {% if page.extensions[constant('Swag\\PayPal\\Checkout\\Plus\\PlusSubscriber::PAYPAL_PLUS_DATA_EXTENSION_ID')] %}
        <!--script src=""></script-->

        <script src="" type="text/javascript">
    {% endif %}

Is it possible that it has to do with the fact that Paypal-Brazil requires the Brazilian federal states to be entered in the address?
Please check whether the state selection is active and configured as a mandatory field for Brazil.

Hi @drakon

I have added state, but no hope, same error.