Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ONLY GET ORDER SUMMARY BACK. #372

Open
jmd8045 opened this issue May 16, 2019 · 1 comment
Open

ONLY GET ORDER SUMMARY BACK. #372

jmd8045 opened this issue May 16, 2019 · 1 comment

Comments

@jmd8045
Copy link

jmd8045 commented May 16, 2019

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);
@KarthikeyanKumar
Copy link

Hi,

Can you please provide detailed steps to reproduce the issue ?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants