sdk-php icon indicating copy to clipboard operation
sdk-php copied to clipboard

ONLY GET ORDER SUMMARY BACK.

Open jmd8045 opened this issue 6 years ago • 1 comments

After I issue the after I successfully get_token I then do the redirect to authorize.net with a post to https://test.authorize.net/payment/payment

I get a blank page back with only the title Order Summary

Any help greatly appreciated....

Jim

 $ma = $this->merchant_authenticate();

        $request = new AnetAPI\GetHostedPaymentPageRequest();
        $request->setMerchantAuthentication($ma);

        $request->setRefId($invoice);//refId is the invioce

        $request->setTransactionRequest($an_obj);
        $stary = $this->get_form_options();
        if(count($stary) > 0)
        {
            foreach($stary as $skey => $sval)
            {
                if($this->DEBUG)
                {
                    $this->logEvent("INFO: SKEY[".$skey."]");
                }
                $request->addToHostedPaymentSettings($sval);
            }
        }
        //-----------------------------------------------------------
        //EXECUTE REQUEST
        //-----------------------------------------------------------
        $controller = new AnetController\GetHostedPaymentPageController($request);
        if($this->mode == '1' or $this->mode == '4')
        {
            $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
        }
        elseif($this->mode == '3')
        {
            $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);

        }
        else
        {
            $this->logEvent("ERROR: UNKNOWN MODE[".$this->mode."] ***** SPECIFIED *****");
            return;
        }
//-----------------------------------------------------------
        //SET RESPONSE
        //-----------------------------------------------------------
        if (($response != null) && ($response->getMessages()->getResultCode() == "Ok"))
        {
            $this->token = $response->getToken();
            if($this->DEBUG){$this->logEvent("INFO: TOKEN RECEIVED[".$this->token."]");}
            $message = $response->getMessages()->getMessage();
            foreach($message as $mkey => $mval)
            {
                $this->logEvent("INFO: ".$message[$mkey]->getCode().
                " ".$message[$mkey]->getText());
            }
        }
        else
        {
            $this->logEvent("ERROR: Failed to get hosted payment page token");
            $error_message = $response->getMessages()->getMessage();
            $this->logEvent("ERROR: ".$error_message[0]->getCode()." ".$error_message[0]->getText());
        }
        return($response);

jmd8045 avatar May 16 '19 13:05 jmd8045

Hi,

Can you please provide detailed steps to reproduce the issue ?

Can you also provide information regarding the following ? Sdk Version Php version

KarthikeyanKumar avatar Aug 09 '19 11:08 KarthikeyanKumar