public function onlyOnePaymentMethod($actionCounts)
    {
        return (isset($actionCounts['card']) && $actionCounts['card'] == 1
                && (!isset($actionCounts['token'])
                    || isset($actionCounts['token']) && $actionCounts['token'] == 0)
                && (!isset($actionCounts['transactionId'])
                    || isset($actionCounts['transactionId']) == 0))
            || (isset($actionCounts['token']) && $actionCounts['token'] == 1
                && (!isset($actionCounts['card'])
                    || isset($actionCounts['card']) && $actionCounts['card'] == 0)
                && (!isset($actionCounts['transactionId'])
                    || isset($actionCounts['transactionId']) == 0))
            || (isset($actionCounts['transactionId']) && $actionCounts['transactionId'] == 1
                && (!isset($actionCounts['card'])
                    || isset($actionCounts['card']) && $actionCounts['card'] == 0)
                && (!isset($actionCounts['token'])
                    || isset($actionCounts['token']) == 0));
    }
public function onlyOnePaymentMethod($actionCounts)
    {
        return (isset($actionCounts['card']) && $actionCounts['card'] == 1
                && (!isset($actionCounts['token'])
                    || isset($actionCounts['token']) && $actionCounts['token'] == 0)
                && (!isset($actionCounts['transactionId'])
                    || isset($actionCounts['transactionId']) == 0))
            || (isset($actionCounts['token']) && $actionCounts['token'] == 1
                && (!isset($actionCounts['card'])
                    || isset($actionCounts['card']) && $actionCounts['card'] == 0)
                && (!isset($actionCounts['transactionId'])
                    || isset($actionCounts['transactionId']) == 0))
            || (isset($actionCounts['transactionId']) && $actionCounts['transactionId'] == 1
                && (!isset($actionCounts['card'])
                    || isset($actionCounts['card']) && $actionCounts['card'] == 0)
                && (!isset($actionCounts['token'])
                    || isset($actionCounts['token']) == 0));
    }
public function onlyOnePaymentMethod ( $ actionCounts ) { return ( isset ( $ actionCounts [ 'card' ] ) && $ actionCounts [ 'card' ] == 1 && ( ! isset ( $ actionCounts [ 'token' ] ) || isset ( $ actionCounts [ 'token' ] ) && $ actionCounts [ 'token' ] == 0 ) && ( ! isset ( $ actionCounts [ 'transactionId' ] ) || isset ( $ actionCounts [ 'transactionId' ] ) == 0 ) ) || ( isset ( $ actionCounts [ 'token' ] ) && $ actionCounts [ 'token' ] == 1 && ( ! isset ( $ actionCounts [ 'card' ] ) || isset ( $ actionCounts [ 'card' ] ) && $ actionCounts [ 'card' ] == 0 ) && ( ! isset ( $ actionCounts [ 'transactionId' ] ) || isset ( $ actionCounts [ 'transactionId' ] ) == 0 ) ) || ( isset ( $ actionCounts [ 'transactionId' ] ) && $ actionCounts [ 'transactionId' ] == 1 && ( ! isset ( $ actionCounts [ 'card' ] ) || isset ( $ actionCounts [ 'card' ] ) && $ actionCounts [ 'card' ] == 0 ) && ( ! isset ( $ actionCounts [ 'token' ] ) || isset ( $ actionCounts [ 'token' ] ) == 0 ) ) ; }
Ensures there is only one payment method, and checks that
there is only one card, one token, or one transactionId
in use.

@param array $actionCounts

@return bool
Ensures there is only one payment method and checks that there is only one card one token or one transactionId in use .