diff options
-rw-r--r-- | class-wc-gnutaler-gateway.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/class-wc-gnutaler-gateway.php b/class-wc-gnutaler-gateway.php index 1305479..5d859c1 100644 --- a/class-wc-gnutaler-gateway.php +++ b/class-wc-gnutaler-gateway.php @@ -184,7 +184,6 @@ function gnutaler_init_gateway_class() { 20, 4 ); - $this->debug( "GNU Taler payment gateway class constructed" ); } @@ -426,8 +425,6 @@ function gnutaler_init_gateway_class() { * @return array The return array will either have the successful return value or a detailed error message. */ private function call_api( $method, $url, $body ): array { - $this->warning( "Running " . $method . " on " . $url ); - $apikey = $this->get_option( 'GNU_Taler_Backend_API_Key' ); $args = array( 'timeout' => 30, // In seconds. @@ -436,14 +433,14 @@ function gnutaler_init_gateway_class() { 'user-agent' => '', // Minimize information leakage. 'blocking' => true, // We do nothing without it. 'headers' => array( - 'Authorization: Bearer ' . $apikey, + 'Authorization' => 'Bearer ' . $apikey, ), 'decompress' => true, 'limit_response_size' => 1024 * 1024, // More than enough. ); if ( $body ) { $args['body'] = wp_json_encode( $body, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES, 16 ); - $args['headers'][] = 'Content-type: application/json'; + $args['headers']['Content-type'] = 'application/json'; $args['compress'] = true; } $this->debug( 'Issuing HTTP ' . $method . ' request to ' . $url . ' with options ' . wp_json_encode( $args ) . ' and body ' . $body ); |