<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accept Hosted FORM ERROR  (REDIRECT METHOD) in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67899#M41203</link>
    <description>&lt;P&gt;EXAMPLE:&amp;nbsp;&lt;SPAN&gt;merchant_authenticate&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;function merchant_authenticate()
     {
        if($this-&amp;gt;DEBUG)
        {
            $this-&amp;gt;logEvent("INFO: URL  [".$this-&amp;gt;anobj-&amp;gt;get_field('url')."]");
            $this-&amp;gt;logEvent("INFO: LOGIN[".$this-&amp;gt;anobj-&amp;gt;get_field('login')."]");
            $this-&amp;gt;logEvent("INFO: XTKEY[".$this-&amp;gt;anobj-&amp;gt;get_field('x_trans_key')."]");
        }
        $this-&amp;gt;maobj = new AnetAPI\MerchantAuthenticationType();
        $this-&amp;gt;maobj-&amp;gt;setName($this-&amp;gt;anobj-&amp;gt;get_field('login'));
        $this-&amp;gt;maobj-&amp;gt;setTransactionKey($this-&amp;gt;anobj-&amp;gt;get_field('x_trans_key'));
        return($this-&amp;gt;maobj);
     }&lt;/PRE&gt;&lt;P&gt;EXAMPLE:&amp;nbsp;&lt;SPAN&gt;create_transaction&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;function create_transaction($amount,$customer_obj,$bill_to_obj,$order_obj)
     {
            $transactionRequestType = new AnetAPI\TransactionRequestType();
            $transactionRequestType-&amp;gt;setTransactionType( "authCaptureTransaction");
            $transactionRequestType-&amp;gt;setAmount($amount);
            $transactionRequestType-&amp;gt;setOrder($order_obj);
            $transactionRequestType-&amp;gt;setCustomer($customer_obj);
            $transactionRequestType-&amp;gt;setBillTo($bill_to_obj);
            //$transactionRequestType-&amp;gt;setPayment($paymentOne);
            //-----------------------------------------------------------
            //get the line items
            //-----------------------------------------------------------
            $lineItems = $this-&amp;gt;get_line_items();
            $transactionRequestType-&amp;gt;setLineItems($lineItems);

        return($transactionRequestType);
     }&lt;/PRE&gt;&lt;P&gt;EXAMPLE add_line_Item:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function add_line_item($item_id,$name,$desc,$qty,$unit_price,$taxable=0)
     {
        if($this-&amp;gt;DEBUG)
        {
            $this-&amp;gt;logEvent("INFO: ITEM ID [".$item_id."]");
            $this-&amp;gt;logEvent("INFO: NAMe    [".$name."]");
            $this-&amp;gt;logEvent("INFO: DESC    [".$desc."]");
            $this-&amp;gt;logEvent("INFO: QTY     [".$qty."]");
            $this-&amp;gt;logEvent("INFO: UNIT PR [".$unit_price."]");
            $this-&amp;gt;logEvent("INFO: TAXABLE [".$taxable."]");
        }
            $lineItem1 = new AnetAPI\LineItemType();
            $lineItem1-&amp;gt;setItemId($item_id);
            $lineItem1-&amp;gt;setName($name);
            $lineItem1-&amp;gt;setDescription($desc);
            $lineItem1-&amp;gt;setQuantity($qty);
            $lineItem1-&amp;gt;setUnitPrice($unit_price);
            $lineItem1-&amp;gt;setTaxable(0); // 1 Yes 0 for no
            $this-&amp;gt;lineItems_ary[$this-&amp;gt;linc++] = $lineItem1;
      }&lt;/PRE&gt;&lt;P&gt;EXAMPLE:&amp;nbsp;&lt;SPAN&gt;set_customer_data&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function set_customer_data(members $mbrobj) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Customer info 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer = new AnetAPI\CustomerDataType(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer-&amp;gt;setId($mbrobj-&amp;gt;get_field('id')); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer-&amp;gt;setEmail($mbrobj-&amp;gt;get_field('email_three')); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer-&amp;gt;setType("individual"); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return($customer); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;EXAMPLE:&amp;nbsp;set_bill_to_info(mbrobj) &amp;lt;&amp;lt;-- mbrobj is an object with members name address etc.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function set_bill_to_info($mbrobj)
    {
            // Bill To
            $billto = new AnetAPI\CustomerAddressType();
            $billto-&amp;gt;setFirstName($mbrobj-&amp;gt;get_field('fname'));
            $billto-&amp;gt;setLastName($mbrobj-&amp;gt;get_field('lname'));
            $billto-&amp;gt;setAddress($mbrobj-&amp;gt;get_field('address_one'));
            $billto-&amp;gt;setCity($mbrobj-&amp;gt;get_field('city'));
            $billto-&amp;gt;setZip($mbrobj-&amp;gt;get_field('zip'));
            $billto-&amp;gt;setCountry("USA");
            return($billto);

    }&lt;/PRE&gt;</description>
    <pubDate>Sat, 01 Jun 2019 11:53:34 GMT</pubDate>
    <dc:creator>jmd804500</dc:creator>
    <dc:date>2019-06-01T11:53:34Z</dc:date>
    <item>
      <title>Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67886#M41191</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;I get the error message below in the console.log using Chrome browser.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;1) The token is received correctly.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;2) When the page returns from&amp;nbsp;&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;it has nothing but Order Summary on it and the following error message in the console below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help you can give is appreciated (been fighting this&amp;nbsp; for over a week)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;payment:24 Uncaught SyntaxError: Invalid or unexpected token&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CODE OVERVIEW:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;//-----------------------------------------------------------
    //authenticate your merchant info
    //-----------------------------------------------------------
    $mbrobj = new members(71870);
    $ahaobj = new accepted_host_authorize(null);
    $ahaobj-&amp;gt;set_total_transaction('120.00');
    $ahaobj-&amp;gt;set_tranid('123456');
    $ahaobj-&amp;gt;set_mbrobj($mbrobj);
    //-----------------------------------------------------------
    //This sets the refId  field with the invoice number
    //-----------------------------------------------------------
    $ahaobj-&amp;gt;set_invoice($invoice);
    //-----------------------------------------------------------
    //MERCHANT AUTHENTICATE
    //-----------------------------------------------------------
    $maobj  = $ahaobj-&amp;gt;merchant_authenticate();
    //-------------------------------------------------
    // NOW GENERATE THE FIELDS FOR THE POST
    //-------------------------------------------------
    $ahaobj-&amp;gt;set_mbr_obj($mbrobj);
    //-----------------------------------------------------------
    //SET UP ORDER
    //-----------------------------------------------------------
    $order_obj = $ahaobj-&amp;gt;set_order(null,"TGCA ORDER");
    //-----------------------------------------------------------
    //ADD LINE ITEM
    //-----------------------------------------------------------
    $ahaobj-&amp;gt;add_line_item('0','TEST','TEST','1','120.00');
    //-----------------------------------------------------------
    //ADD CUSTOMER DATA
    //-----------------------------------------------------------
    $customer_data_obj = $ahaobj-&amp;gt;set_customer_data($mbrobj);
    //-----------------------------------------------------------
    //ADD BILL TO
    //-----------------------------------------------------------
    $bill_to_obj = $ahaobj-&amp;gt;set_bill_to_info($mbrobj);

    //-----------------------------------------------------------
    //SET HOSTSTED FORM OPTIONS
    //-----------------------------------------------------------
//-----------------------------------------------------------
    //SET HOSTSTED FORM OPTIONS
    //-----------------------------------------------------------
    $hosted_settings_ary = $ahaobj-&amp;gt;set_hosted_form_options($mbrobj,
                                        ' http://tgca_dev.jdoherty.net/php/sadispatch.php?event=renew_ccpost&amp;amp;first_time=init',
                                        ' http://tgca_dev.jdoherty.net/php/sadispatch.php?event=renew_ccpost&amp;amp;first_time=cancel');
    //-----------------------------------------------------------
    //CREATE TRANSACTIONS
    //-----------------------------------------------------------
    $trans_type_obj = $ahaobj-&amp;gt;create_transaction('120.00',
                                                      $customer_data_obj,
                                                      $bill_to_obj,
                                                      $order_obj);


    //-----------------------------------------------------------
    //get the token from payment server
    //-----------------------------------------------------------
    $resp = $ahaobj-&amp;gt;get_an_token($inv,$trans_type_obj,$hosted_settings_ary);


============  GET_AN_TOKEN=============


function get_an_token($invoice,AnetAPI\TransactionRequestType $trans_type_obj,array $settings_ary)
     {
        $pay_page_request_obj = new AnetAPI\GetHostedPaymentPageRequest();
        $maobj = $this-&amp;gt;merchant_authenticate();
        //$this-&amp;gt;set_up_accepted_host_options();
        //-----------------------------------------------------------
        //set Merchant Authenticate
        //-----------------------------------------------------------
        $pay_page_request_obj-&amp;gt;setMerchantAuthentication($maobj);
        //-----------------------------------------------------------
        //SET REF ID
        //-----------------------------------------------------------
        $pay_page_request_obj-&amp;gt;setRefId($invoice);//refId is the invioce
        //-----------------------------------------------------------
        //SET TRANSACTION TYPE
        //-----------------------------------------------------------
        $pay_page_request_obj-&amp;gt;setTransactionRequest($trans_type_obj);
        //-----------------------------------------------------------
        //SET HostedPaymentSetting
        //-----------------------------------------------------------
        foreach($settings_ary as $skey =&amp;gt; $sval)
        {
            $pay_page_request_obj-&amp;gt;addToHostedPaymentSettings($sval);
        }

        //-----------------------------------------------------------
        //EXECUTE REQUEST
        //-----------------------------------------------------------
        $controller = new AnetController\GetHostedPaymentPageController($pay_page_request_obj);
        if($this-&amp;gt;mode == '1' or $this-&amp;gt;mode == '4')
        {
            $response = $controller-&amp;gt;executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
        }
        elseif($this-&amp;gt;mode == '3')
        {
            $response = $controller-&amp;gt;executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);

        }
        else
        {
            $this-&amp;gt;logEvent("ERROR: UNKNOWN MODE[".$this-&amp;gt;mode."] ***** SPECIFIED *****");
            return;


}
        //-----------------------------------------------------------
        //SET RESPONSE
        //-----------------------------------------------------------
        if (($response != null) &amp;amp;&amp;amp; ($response-&amp;gt;getMessages()-&amp;gt;getResultCode() == "Ok"))
        {
            $this-&amp;gt;token = $response-&amp;gt;getToken();
            if($this-&amp;gt;DEBUG){$this-&amp;gt;logEvent("INFO: TOKEN RECEIVED[".$this-&amp;gt;token."]");}
            $message = $response-&amp;gt;getMessages()-&amp;gt;getMessage();
            foreach($message as $mkey =&amp;gt; $mval)
            {
                $this-&amp;gt;logEvent("INFO: ".$message[$mkey]-&amp;gt;getCode().
                " ".$message[$mkey]-&amp;gt;getText());
            }
        }
        else
        {
            $this-&amp;gt;logEvent("ERROR: Failed to get hosted payment page token");
            $error_message = $response-&amp;gt;getMessages()-&amp;gt;getMessage();
            $this-&amp;gt;logEvent("ERROR: ".$error_message[0]-&amp;gt;getCode()." ".$error_message[0]-&amp;gt;getText());
        }
        return($response);

     }

============== set_hosted_form_options ==============
function set_hosted_form_options($mbrobj,$x_realy_url,$x_cancel_url)
     {
        $this-&amp;gt;seting_incr = 0;
        $setting1 = new AnetAPI\SettingType();
        $setting1-&amp;gt;setSettingName("hostedPaymentButtonOptions");
        $setting1-&amp;gt;setSettingValue("{\"text\": \"Submit Payment\"}");

        $setting2 = new AnetAPI\SettingType();
        $setting2-&amp;gt;setSettingName("hostedPaymentStyleOptions");
        $setting2-&amp;gt;setSettingValue("{\"bgColor\": \"red\"}");

        $setting3 = new AnetAPI\SettingType();
        $setting3-&amp;gt;setSettingName("hostedPaymentOrderOptions");
        $setting3-&amp;gt;setSettingValue("{\"show\": true,\"merchantName\":\"Texas Girls Coaches Assoc.\"}");

        $setting4 = new AnetAPI\SettingType();
        $setting4-&amp;gt;setSettingName("hostedPaymentReturnOptions");
        $x_relay_url = $this-&amp;gt;anobj-&amp;gt;get_field('x_relay_url');
        $x_relay_url .= "&amp;amp;invid=";
        $x_relay_url .= $this-&amp;gt;get_invoice();
        $x_cancel_url = $this-&amp;gt;anobj-&amp;gt;get_field('x_cancel_url');
        $x_cancel_url .= "&amp;amp;invid=";
        $x_cancel_url .= $this-&amp;gt;get_invoice();
       $setting4-&amp;gt;setSettingValue("{\"url\": \"".$x_relay_url."\", \"cancelUrl\": \"".$x_cancel_url."\", \"showReceipt\": true}");

        $setting5 = new AnetAPI\SettingType();
        $setting5-&amp;gt;setSettingName("hostedPaymentPaymentOptions");
        $setting5-&amp;gt;setSettingValue("{\"cardCodeRequired\":true,\"showCreditCard\": true,\"showBankAccount\":true}");

        $setting6 = new AnetAPI\SettingType();
        $setting6-&amp;gt;setSettingName("hostedPaymentSecurityOptions");
        $setting6-&amp;gt;setSettingValue("{\"captcha\":true}");

        $setting7 = new AnetAPI\SettingType();
        $setting7-&amp;gt;setSettingName("hostedPaymentBillingAddressOptions");
        $setting7-&amp;gt;setSettingValue("{\"show\":true}");

        $setting8 = new AnetAPI\SettingType();
        $setting8-&amp;gt;setSettingName("hostedPaymentCustomerOptions");
        $setting8-&amp;gt;setSettingValue("{\"showEmail\":true,\"requiredEmail\":true}");
        //-----------------------------------------------------------
        //Now set the Hosted Payment Options in the page Request
        //-----------------------------------------------------------
        $cnt = 0;
        $hosted_payment_setting[$cnt++] = $setting1;
        $hosted_payment_setting[$cnt++] = $setting2;
        $hosted_payment_setting[$cnt++] = $setting3;
        $hosted_payment_setting[$cnt++] = $setting4;
        $hosted_payment_setting[$cnt++] = $setting5;
        $hosted_payment_setting[$cnt++] = $setting6;
        $hosted_payment_setting[$cnt++] = $setting7;
        $hosted_payment_setting[$cnt++] = $setting8;

        return($hosted_payment_setting);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;main.bundle.js:1 ERROR ReferenceError: g_errorPanelMessage is not defined&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at e.ngOnInit (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at main.bundle.js:1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at main.bundle.js:1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at el (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at Ol (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at Object.updateDirectives (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at Object.updateDirectives (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at Object.Qi [as checkAndUpdateView] (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at e.detectChanges (main.bundle.js:1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at main.bundle.js:1&lt;BR /&gt;Se @ main.bundle.js:1&lt;BR /&gt;e.handleError @ main.bundle.js:1&lt;BR /&gt;(anonymous) @ main.bundle.js:1&lt;BR /&gt;t.invoke @ polyfills.bundle.js:1&lt;BR /&gt;n.run @ polyfills.bundle.js:1&lt;BR /&gt;e.runOutsideAngular @ main.bundle.js:1&lt;BR /&gt;e.tick @ main.bundle.js:1&lt;BR /&gt;e._loadComponent @ main.bundle.js:1&lt;BR /&gt;e.bootstrap @ main.bundle.js:1&lt;BR /&gt;(anonymous) @ main.bundle.js:1&lt;BR /&gt;e._moduleDoBootstrap @ main.bundle.js:1&lt;BR /&gt;(anonymous) @ main.bundle.js:1&lt;BR /&gt;t.invoke @ polyfills.bundle.js:1&lt;BR /&gt;onInvoke @ main.bundle.js:1&lt;BR /&gt;t.invoke @ polyfills.bundle.js:1&lt;BR /&gt;n.run @ polyfills.bundle.js:1&lt;BR /&gt;(anonymous) @ polyfills.bundle.js:1&lt;BR /&gt;t.invokeTask @ polyfills.bundle.js:1&lt;BR /&gt;onInvokeTask @ main.bundle.js:1&lt;BR /&gt;t.invokeTask @ polyfills.bundle.js:1&lt;BR /&gt;n.runTask @ polyfills.bundle.js:1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 16:10:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67886#M41191</guid>
      <dc:creator>jmd804500</dc:creator>
      <dc:date>2019-05-31T16:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67891#M41196</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/29063"&gt;@jmd804500&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what is causing this just glancing at it, but you seem to be making things more complicated than they have to be.&amp;nbsp; I do not think it is your form being called, as you are calling the form in PHP.&amp;nbsp; Your console is giving you a js syntax error. Back to your script, is there any reason you put your script together like this as opposed to just using the sample code and modifying it? The sample code works very well and it looks like you're putting together your own thing (or modifying a SIM script). The sample code has been tested and works and there isn't really a reason to start from scratch.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jun 2019 01:10:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67891#M41196</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-06-01T01:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67897#M41201</link>
      <description>&lt;P&gt;We use classes all I have done is to encapsulate the regular SDK in a class to allow it fit into our system ("Which is much larger than the authorize.net part).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Renaissance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does the order and such look correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jun 2019 11:30:16 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67897#M41201</guid>
      <dc:creator>jmd804500</dc:creator>
      <dc:date>2019-06-01T11:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67898#M41202</link>
      <description>&lt;P&gt;my read of the documentation is that if I don't specify a payment method then the API will put a credit card in there. Is there some API call in hostedPayment Options which needs to be specified?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jun 2019 11:32:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67898#M41202</guid>
      <dc:creator>jmd804500</dc:creator>
      <dc:date>2019-06-01T11:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67899#M41203</link>
      <description>&lt;P&gt;EXAMPLE:&amp;nbsp;&lt;SPAN&gt;merchant_authenticate&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;function merchant_authenticate()
     {
        if($this-&amp;gt;DEBUG)
        {
            $this-&amp;gt;logEvent("INFO: URL  [".$this-&amp;gt;anobj-&amp;gt;get_field('url')."]");
            $this-&amp;gt;logEvent("INFO: LOGIN[".$this-&amp;gt;anobj-&amp;gt;get_field('login')."]");
            $this-&amp;gt;logEvent("INFO: XTKEY[".$this-&amp;gt;anobj-&amp;gt;get_field('x_trans_key')."]");
        }
        $this-&amp;gt;maobj = new AnetAPI\MerchantAuthenticationType();
        $this-&amp;gt;maobj-&amp;gt;setName($this-&amp;gt;anobj-&amp;gt;get_field('login'));
        $this-&amp;gt;maobj-&amp;gt;setTransactionKey($this-&amp;gt;anobj-&amp;gt;get_field('x_trans_key'));
        return($this-&amp;gt;maobj);
     }&lt;/PRE&gt;&lt;P&gt;EXAMPLE:&amp;nbsp;&lt;SPAN&gt;create_transaction&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;function create_transaction($amount,$customer_obj,$bill_to_obj,$order_obj)
     {
            $transactionRequestType = new AnetAPI\TransactionRequestType();
            $transactionRequestType-&amp;gt;setTransactionType( "authCaptureTransaction");
            $transactionRequestType-&amp;gt;setAmount($amount);
            $transactionRequestType-&amp;gt;setOrder($order_obj);
            $transactionRequestType-&amp;gt;setCustomer($customer_obj);
            $transactionRequestType-&amp;gt;setBillTo($bill_to_obj);
            //$transactionRequestType-&amp;gt;setPayment($paymentOne);
            //-----------------------------------------------------------
            //get the line items
            //-----------------------------------------------------------
            $lineItems = $this-&amp;gt;get_line_items();
            $transactionRequestType-&amp;gt;setLineItems($lineItems);

        return($transactionRequestType);
     }&lt;/PRE&gt;&lt;P&gt;EXAMPLE add_line_Item:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function add_line_item($item_id,$name,$desc,$qty,$unit_price,$taxable=0)
     {
        if($this-&amp;gt;DEBUG)
        {
            $this-&amp;gt;logEvent("INFO: ITEM ID [".$item_id."]");
            $this-&amp;gt;logEvent("INFO: NAMe    [".$name."]");
            $this-&amp;gt;logEvent("INFO: DESC    [".$desc."]");
            $this-&amp;gt;logEvent("INFO: QTY     [".$qty."]");
            $this-&amp;gt;logEvent("INFO: UNIT PR [".$unit_price."]");
            $this-&amp;gt;logEvent("INFO: TAXABLE [".$taxable."]");
        }
            $lineItem1 = new AnetAPI\LineItemType();
            $lineItem1-&amp;gt;setItemId($item_id);
            $lineItem1-&amp;gt;setName($name);
            $lineItem1-&amp;gt;setDescription($desc);
            $lineItem1-&amp;gt;setQuantity($qty);
            $lineItem1-&amp;gt;setUnitPrice($unit_price);
            $lineItem1-&amp;gt;setTaxable(0); // 1 Yes 0 for no
            $this-&amp;gt;lineItems_ary[$this-&amp;gt;linc++] = $lineItem1;
      }&lt;/PRE&gt;&lt;P&gt;EXAMPLE:&amp;nbsp;&lt;SPAN&gt;set_customer_data&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function set_customer_data(members $mbrobj) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Customer info 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer = new AnetAPI\CustomerDataType(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer-&amp;gt;setId($mbrobj-&amp;gt;get_field('id')); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer-&amp;gt;setEmail($mbrobj-&amp;gt;get_field('email_three')); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$customer-&amp;gt;setType("individual"); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return($customer); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;EXAMPLE:&amp;nbsp;set_bill_to_info(mbrobj) &amp;lt;&amp;lt;-- mbrobj is an object with members name address etc.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function set_bill_to_info($mbrobj)
    {
            // Bill To
            $billto = new AnetAPI\CustomerAddressType();
            $billto-&amp;gt;setFirstName($mbrobj-&amp;gt;get_field('fname'));
            $billto-&amp;gt;setLastName($mbrobj-&amp;gt;get_field('lname'));
            $billto-&amp;gt;setAddress($mbrobj-&amp;gt;get_field('address_one'));
            $billto-&amp;gt;setCity($mbrobj-&amp;gt;get_field('city'));
            $billto-&amp;gt;setZip($mbrobj-&amp;gt;get_field('zip'));
            $billto-&amp;gt;setCountry("USA");
            return($billto);

    }&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Jun 2019 11:53:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67899#M41203</guid>
      <dc:creator>jmd804500</dc:creator>
      <dc:date>2019-06-01T11:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67961#M41254</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/29063"&gt;@jmd804500&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't figure out what you are doing without looking at this for much longer than I can budget, unfortunately. You are making things overly complicated. There is no need to make a custom function for each part of the hosted form API call. Your problem will be solved almost instantly if you copy and paste the sample PHP code from the reference. You will just have to add your line items and the other fields as necessary. The sample code is missing several properties and is just something basic that works and that you can start with.&amp;nbsp; It will get you there much faster than this.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 23:11:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/67961#M41254</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-06-08T23:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/72856#M45045</link>
      <description>&lt;P&gt;Hey, was a solution to this issue ever figured out?&lt;/P&gt;&lt;P&gt;I'm having a similar situation. It was working yesterday.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 20:44:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/72856#M45045</guid>
      <dc:creator>Scott_GQ</dc:creator>
      <dc:date>2020-08-13T20:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted FORM ERROR  (REDIRECT METHOD)</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/72857#M45046</link>
      <description>&lt;P&gt;Figured this one out. Not sure how it applies to your code, but I was adding a query string to the end of my redirect after continue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;hostedPaymentReturnOptions has two properties:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; url and urlText.&lt;/P&gt;&lt;P&gt;My url property had a query string afterwards that would give me information about the transaction for processing when it gets back to my side.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I removed the ?...=... and it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Super weird. Not sure how I'm suppose to get information about the transaction now, but that's an issue for another time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 21:04:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-FORM-ERROR-REDIRECT-METHOD/m-p/72857#M45046</guid>
      <dc:creator>Scott_GQ</dc:creator>
      <dc:date>2020-08-13T21:04:06Z</dc:date>
    </item>
  </channel>
</rss>

