Magento – How to disable PayPal express payment method on one of the store

enable-disablemagento2.3payment-methodspaypal-express

I got 2 variations of the store – EU and USA. I need to disable the PayPal Express method on the EU store, how can I do that?

enter image description here

There no option to disable Payment on EU store:
enter image description here
But avaliable on default config:

enter image description here

Best Answer

I waste much time to make a bad hack. Here payments methods displays:

<div if="isPaymentMethodsAvailable()"
 class="items payment-methods">
<div repeat="foreach: paymentGroupsList, item: '$group'"
     class="payment-group">
    <div if="getRegion($group().displayArea)().length"
         translate="getGroupTitle($group)"
         class="step-title"
         data-role="title">
    </div>
    <each args="data: getRegion($group().displayArea), as: 'method'" render=""/>
</div>

I changed PayPal title from the admin menu on EU store to PayPal hidden

I found the js file that renders this components:

Magento_Checkout/web/js/view/payment/list.js

Then I check on initChildren method this title:

        initChildren: function () {
        var self = this;

        _.each(paymentMethods(), function (paymentMethodData) {
            if(paymentMethodData.title!="PayPal hidden") {
                self.createRenderer(paymentMethodData);
            }
        });

        return this;
    },
Related Topic