public function handleNotify(callable $callback)
    {
        $notify = $this->getNotify();

        if (!$notify->isValid()) {
            throw new FaultException('Invalid request payloads.', 400);
        }

        $notify = $notify->getNotify();
        $successful = $notify->get('result_code') === 'SUCCESS';

        $handleResult = call_user_func_array($callback, [$notify, $successful]);

        if (is_bool($handleResult) && $handleResult) {
            $response = [
                'return_code' => 'SUCCESS',
                'return_msg'  => 'OK',
            ];
        } else {
            $response = [
                'return_code' => 'FAIL',
                'return_msg'  => $handleResult,
            ];
        }

        return new Response(XML::build($response));
    }
public function handleNotify(callable $callback)
    {
        $notify = $this->getNotify();

        if (!$notify->isValid()) {
            throw new FaultException('Invalid request payloads.', 400);
        }

        $notify = $notify->getNotify();
        $successful = $notify->get('result_code') === 'SUCCESS';

        $handleResult = call_user_func_array($callback, [$notify, $successful]);

        if (is_bool($handleResult) && $handleResult) {
            $response = [
                'return_code' => 'SUCCESS',
                'return_msg'  => 'OK',
            ];
        } else {
            $response = [
                'return_code' => 'FAIL',
                'return_msg'  => $handleResult,
            ];
        }

        return new Response(XML::build($response));
    }
public function handleNotify ( callable $ callback ) { $ notify = $ this -> getNotify ( ) ; if ( ! $ notify -> isValid ( ) ) { throw new FaultException ( 'Invalid request payloads.' , 400 ) ; } $ notify = $ notify -> getNotify ( ) ; $ successful = $ notify -> get ( 'result_code' ) === 'SUCCESS' ; $ handleResult = call_user_func_array ( $ callback , [ $ notify , $ successful ] ) ; if ( is_bool ( $ handleResult ) && $ handleResult ) { $ response = [ 'return_code' => 'SUCCESS' , 'return_msg' => 'OK' , ] ; } else { $ response = [ 'return_code' => 'FAIL' , 'return_msg' => $ handleResult , ] ; } return new Response ( XML :: build ( $ response ) ) ; }
Handle payment notify.

@param callable $callback

@return Response
Handle payment notify .