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

**URL:** <https://forum.shopware.com/t/the-paypal-plus-checkout-for-brazil-is-not-working-with-the-paypal-plugin-version-5-0-3/94162>\
**Category:** Programmierung\
**Tags:** programming\
**Created:** [29. April 2022 um 07:55 UTC](https://forum.shopware.com/t/the-paypal-plus-checkout-for-brazil-is-not-working-with-the-paypal-plugin-version-5-0-3/94162 "2022-04-29T07:55:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abinjohnedamana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/abinjohnedamana/32/17378_2.png) [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Post date:** [29. April 2022 um 07:55 UTC](https://forum.shopware.com/t/the-paypal-plus-checkout-for-brazil-is-not-working-with-the-paypal-plugin-version-5-0-3/94162/1 "2022-04-29T07:55:46Z")

</div>

Hi

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](https://developer.paypal.com/docs/regional/br/payment-selection-page/)

But not working

Can you please help?

Edited files

SwagPayPal/src/Resources/views/storefront/page/checkout/confirm/index.html.twig  
SwagPayPal/src/Resources/app/storefront/src/checkout/swag-paypal.plus-payment-wall.js

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

        this.paypal.apps.PPP({
            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,

            /* -------------------------------- */
        });

```

```auto
    {% if page.extensions[constant('Swag\\PayPal\\Checkout\\Plus\\PlusSubscriber::PAYPAL_PLUS_DATA_EXTENSION_ID')] %}
        <!--script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js"></script-->

        <script src="https://www.paypalobjects.com/webstatic/ppplusdcc/ppplusdcc.min.js" type="text/javascript">
        </script>
    {% endif %}

```

---

<div class="post-metadata">

**Author:** ![drakon](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/drakon/32/7724_2.png) [@drakon](https://forum.shopware.com/u/drakon)\
**Post date:** [29. April 2022 um 08:55 UTC](https://forum.shopware.com/t/the-paypal-plus-checkout-for-brazil-is-not-working-with-the-paypal-plugin-version-5-0-3/94162/2 "2022-04-29T08:55:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![abinjohnedamana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/abinjohnedamana/32/17378_2.png) [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Post date:** [29. April 2022 um 12:51 UTC](https://forum.shopware.com/t/the-paypal-plus-checkout-for-brazil-is-not-working-with-the-paypal-plugin-version-5-0-3/94162/3 "2022-04-29T12:51:01Z")

</div>

Hi @drakon

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

---

<div class="post-metadata">

**Author:** ![drpn\_swf](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@drpn\_swf](https://forum.shopware.com/u/drpn_swf)\
**Post date:** [4. August 2022 um 09:59 UTC](https://forum.shopware.com/t/the-paypal-plus-checkout-for-brazil-is-not-working-with-the-paypal-plugin-version-5-0-3/94162/4 "2022-08-04T09:59:32Z")

</div>

Store the config object in a variable like below.

```auto
this.ppp = this.paypal.apps.PPP({
            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,

            /* -------------------------------- */
        });

```

then you can use

```auto
this.ppp.doContinue();

```
