private function setApiEnvironment($credentials)
    {
        if (empty($credentials['mode']) || !in_array($credentials['mode'], ['sandbox', 'live'])) {
            $this->mode = 'live';
        } else {
            $this->mode = $credentials['mode'];
        }
    }
private function setApiEnvironment($credentials)
    {
        if (empty($credentials['mode']) || !in_array($credentials['mode'], ['sandbox', 'live'])) {
            $this->mode = 'live';
        } else {
            $this->mode = $credentials['mode'];
        }
    }
private function setApiEnvironment ( $ credentials ) { if ( empty ( $ credentials [ 'mode' ] ) || ! in_array ( $ credentials [ 'mode' ] , [ 'sandbox' , 'live' ] ) ) { $ this -> mode = 'live' ; } else { $ this -> mode = $ credentials [ 'mode' ] ; } }
Set API environment to be used by PayPal.

@param array $credentials

@return void
Set API environment to be used by PayPal .