public function toResponse(): Response
    {
        $base = [
            'return_code' => is_null($this->fail) ? static::SUCCESS : static::FAIL,
            'return_msg' => $this->fail,
        ];

        $attributes = array_merge($base, $this->attributes);

        if ($this->sign) {
            $attributes['sign'] = Support\generate_sign($attributes, $this->app->getKey());
        }

        return new Response(XML::build($attributes));
    }
public function toResponse(): Response
    {
        $base = [
            'return_code' => is_null($this->fail) ? static::SUCCESS : static::FAIL,
            'return_msg' => $this->fail,
        ];

        $attributes = array_merge($base, $this->attributes);

        if ($this->sign) {
            $attributes['sign'] = Support\generate_sign($attributes, $this->app->getKey());
        }

        return new Response(XML::build($attributes));
    }
public function toResponse ( ) : Response { $ base = [ 'return_code' => is_null ( $ this -> fail ) ? static :: SUCCESS : static :: FAIL , 'return_msg' => $ this -> fail , ] ; $ attributes = array_merge ( $ base , $ this -> attributes ) ; if ( $ this -> sign ) { $ attributes [ 'sign' ] = Support \ generate_sign ( $ attributes , $ this -> app -> getKey ( ) ) ; } return new Response ( XML :: build ( $ attributes ) ) ; }
Build xml and return the response to WeChat.

@return \Symfony\Component\HttpFoundation\Response
Build xml and return the response to WeChat .