src/Backend/Modules/Commerce/Domain/PaymentMethod/Checkout/PaymentMethodQuote.php
/**
     * Check that - based on the shipment method - this is a valid payment method to proceed with.
     */
Check that - based on the shipment method - this is a valid payment method to proceed with.
Check that - based on the shipment method - this is a valid payment method to proceed with .
protected function isAllowedPaymentMethod(): bool
    {
        $shipmentMethod = $this->getShipmentMethod();
        if (
            !array_key_exists('available_payment_methods', $shipmentMethod) ||
            !$shipmentMethod['available_payment_methods'] instanceof ArrayCollection
        ) {
            return true;
        }
        foreach ($shipmentMethod['available_payment_methods'] as $availablePaymentMethod) {
            if ($availablePaymentMethod->getName() === $this->name) {
                return true;
            }
        }
        return false;
    }
protected function isAllowedPaymentMethod ( ) : bool { $ shipmentMethod = $ this -> getShipmentMethod ( ) ; if ( ! array_key_exists ( 'available_payment_methods' , $ shipmentMethod ) || ! $ shipmentMethod [ 'available_payment_methods' ] instanceof ArrayCollection ) { return true ; } foreach ( $ shipmentMethod [ 'available_payment_methods' ] as $ availablePaymentMethod ) { if ( $ availablePaymentMethod -> getName ( ) === $ this -> name ) { return true ; } } return false ; }
Check that - based on the shipment method - this is a valid payment method to proceed with.
Check that - based on the shipment method - this is a valid payment method to proceed with .
// When element doesn't exist on the shipping method, it should be available for everything