<?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 - Prepopulate email and phone in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67711#M41057</link>
    <description>&lt;P&gt;I also just tried sending the customer object in only with the email as I've seen instructed, if I pass the customer object at all through, the auth.net popup iframe throws a 404 every time. But the initial handshake returns a success.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2019 14:12:58 GMT</pubDate>
    <dc:creator>marco_envision</dc:creator>
    <dc:date>2019-05-15T14:12:58Z</dc:date>
    <item>
      <title>Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67694#M41051</link>
      <description>&lt;P&gt;Hi all, I am integrating accepted hosted to my page, and am using the below code, things work great, the email and phone do not carry through to the auth.net popup though. Has anyone else had this issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;




ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()
{
name = moduleSettings["ApiLoginID"].ToString(),
ItemElementName = ItemChoiceType.transactionKey,
Item = moduleSettings["ApiTransactionKey"].ToString(),
};

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;




settingType[] settings = new settingType[10];

settings[0] = new settingType();
settings[0].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();
settings[0].settingValue = "{\"text\": \"Submit Gift\"}";

settings[1] = new settingType();
settings[1].settingName = settingNameEnum.hostedPaymentOrderOptions.ToString();
settings[1].settingValue = "{\"show\": false}";

settings[2] = new settingType();
settings[2].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();
settings[2].settingValue = "{\"show\": true}";

settings[3] = new settingType(); 
settings[3].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();
settings[3].settingValue = "{\"showReceipt\": false}";settings[4] = new settingType();

settings[4].settingName = settingNameEnum.hostedPaymentPaymentOptions.ToString();
settings[4].settingValue = "{\"cardCodeRequired\": true, \"showCreditCard\": true, \"showBankAccount\": false}";

settings[5] = new settingType();
settings[5].settingName = settingNameEnum.hostedPaymentSecurityOptions.ToString();
settings[5].settingValue = "{\"captcha\": true}";

settings[6] = new settingType();
settings[6].settingName = settingNameEnum.hostedPaymentStyleOptions.ToString(); 
settings[6].settingValue = "{\"bgColor\": \"#0f175e\"}";

settings[7] = new settingType();
settings[7].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();
settings[7].settingValue = "{\"url\": \"" + System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Scheme) + System.Web.HttpContext.Current.Request.Url.Host + "/xxx/hosted.html\"}";settings[8] = new settingType();

settings[8].settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString();
settings[8].settingValue = "{\"showEmail\": true}";



var billTo = new customerAddressType();
billTo.firstName = firstName;
billTo.lastName = lastName;
billTo.country = country;
billTo.zip = zip;
billTo.address = address;
billTo.city = city;
billTo.state = state;
billTo.email = email;

if (phoneNumber != "null") billTo.phoneNumber = phoneNumber;


var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), 
amount = amount,
billTo = billTo
};



var request = new getHostedPaymentPageRequest();
request.transactionRequest = transactionRequest;
request.hostedPaymentSettings = settings;

// instantiate the controller that will call the service
var controller = new getHostedPaymentPageController(request); 
controller.Execute();

// get the response from the service (errors contained if any)
var response = controller.GetApiResponse();&lt;/PRE&gt;&lt;P&gt;I can create the customer separately through the createCustomerProfileRequest, I just don't know how to tie it into this when a payment is made. I was told to do it in the&amp;nbsp;transactionRequestType object by setting the customer object in there but it doesn't work for me, the request comes back as a success, but then the call to the payment url for Authorize.NET popup comes back with a 404 so nothing is displayed (&lt;A href="https://test.authorize.net/payment/payment?token=" target="_blank"&gt;https://test.authorize.net/payment/payment?token=&lt;/A&gt;...). Leaving it as shown above shoes the email and phone fields just not populated like the other fields. Any help would be so greatly appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 18:42:30 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67694#M41051</guid>
      <dc:creator>marco_envision</dc:creator>
      <dc:date>2019-05-14T18:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67695#M41052</link>
      <description>&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/27538"&gt;@marco_envision&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;You pass those under a CustomerDataType object.</description>
      <pubDate>Wed, 15 May 2019 03:27:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67695#M41052</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-05-15T03:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67710#M41056</link>
      <description>&lt;P&gt;Hi, thank you for the response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did and nothing works, it throws a 404 when loading the popup if I try doing either of the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            var transactionRequest = new transactionRequestType
            {
                transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // authorize capture only
                amount = amount,
                billTo = billTo,
                //customer = new customerDataType()
                //customer = new customerDataType() { id = _merchantCustomerId, email = billTo.email, type = customerTypeEnum.individual }
            };&lt;/PRE&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 14:11:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67710#M41056</guid>
      <dc:creator>marco_envision</dc:creator>
      <dc:date>2019-05-15T14:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67711#M41057</link>
      <description>&lt;P&gt;I also just tried sending the customer object in only with the email as I've seen instructed, if I pass the customer object at all through, the auth.net popup iframe throws a 404 every time. But the initial handshake returns a success.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 14:12:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67711#M41057</guid>
      <dc:creator>marco_envision</dc:creator>
      <dc:date>2019-05-15T14:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67716#M41061</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/27538"&gt;@marco_envision&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  var transactionRequest = new transactionRequestType
            {
                transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // authorize capture only
                amount = amount,
                billTo = billTo,
                //customer = new customerDataType()
                //customer = new customerDataType() { id = _merchantCustomerId, email = billTo.email, type = customerTypeEnum.individual }
            };&lt;/PRE&gt;&lt;P&gt;Try defining the customer outside of the transactionRequestType object. In the above code you have the customer commented out, so I can imagine it throwing an error. What I type below won't be correct syntax, but will give you an idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var billTo = new customerAddressType();
billTo.firstName = firstName;
billTo.lastName = lastName;
billTo.country = country;
billTo.zip = zip;
billTo.address = address;
billTo.city = city;
billTo.state = state;
billTo.email = email;

var customer = new customerDataType();
customer.email = email;
//corrected customer object

if (phoneNumber != "null") customer.phoneNumber = phoneNumber;


var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), 
amount = amount,
billTo = billTo,
customer = customer
};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 18:55:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67716#M41061</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-05-15T18:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67731#M41074</link>
      <description>&lt;P&gt;HI, yes I had commented it out, I was merely showing you the things I've tried. I've also tried creating a customer object and passing it in, as you mentioned, with no success. I'm at a loss why the object is there to be sent but does not work in any case when passed in. Has anyone been able to pass a customerDataType object to a&amp;nbsp;transactionRequestType object? I would be so grateful for any assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Marco&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 20:47:02 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67731#M41074</guid>
      <dc:creator>marco_envision</dc:creator>
      <dc:date>2019-05-16T20:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67732#M41075</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/27538"&gt;@marco_envision&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have passed it no problem on 3 separate web applications, at least 100 times. Did you try the code I posted? I think that should work, although you might have to make syntax changes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 21:20:29 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67732#M41075</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-05-16T21:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67839#M41153</link>
      <description>&lt;P&gt;&lt;A href="http://dnn922research.envisionbeta.net/donation" target="_blank"&gt;http://dnn922research.envisionbeta.net/donation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a sample, if you run through the process (tied to the sandbox account, not live), and hit "Continue to secure payment", it will open the popup, but will return a 404 error when hitting the auth.net page, I've logged the json response from the handshake to the console log, looks fine, just throws a 404. If I remove the customer being added to the&amp;nbsp;transactionRequest it works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See code that is there now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;public static ANetApiResponse Run(decimal amount, string firstName, string lastName, string country, string zip, string address,&lt;BR /&gt;string city, string state, string phoneNumber, string email, System.Collections.Hashtable moduleSettings)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;if (moduleSettings["Environment"].ToString() == "PRODUCTION")&lt;BR /&gt;{&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.PRODUCTION;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()&lt;BR /&gt;{&lt;BR /&gt;name = moduleSettings["ApiLoginID"].ToString(),&lt;BR /&gt;ItemElementName = ItemChoiceType.transactionKey,&lt;BR /&gt;Item = moduleSettings["ApiTransactionKey"].ToString(),&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;ServicePointManager.Expect100Continue = true;&lt;BR /&gt;ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;settingType[] settings = new settingType[10];&lt;/P&gt;&lt;P&gt;settings[0] = new settingType();&lt;BR /&gt;settings[0].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();&lt;BR /&gt;settings[0].settingValue = "{\"text\": \"Submit Gift\"}";&lt;/P&gt;&lt;P&gt;settings[1] = new settingType();&lt;BR /&gt;settings[1].settingName = settingNameEnum.hostedPaymentOrderOptions.ToString();&lt;BR /&gt;settings[1].settingValue = "{\"show\": false}";&lt;/P&gt;&lt;P&gt;settings[2] = new settingType();&lt;BR /&gt;settings[2].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();&lt;BR /&gt;settings[2].settingValue = "{\"show\": true}";&lt;/P&gt;&lt;P&gt;settings[3] = new settingType();&lt;BR /&gt;settings[3].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();&lt;BR /&gt;settings[3].settingValue = "{\"showReceipt\": false}";&lt;/P&gt;&lt;P&gt;settings[4] = new settingType();&lt;BR /&gt;settings[4].settingName = settingNameEnum.hostedPaymentPaymentOptions.ToString();&lt;BR /&gt;settings[4].settingValue = "{\"cardCodeRequired\": true, \"showCreditCard\": true, \"showBankAccount\": false}";&lt;/P&gt;&lt;P&gt;settings[5] = new settingType();&lt;BR /&gt;settings[5].settingName = settingNameEnum.hostedPaymentSecurityOptions.ToString();&lt;BR /&gt;settings[5].settingValue = "{\"captcha\": true}";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;settings[6] = new settingType();&lt;BR /&gt;settings[6].settingName = settingNameEnum.hostedPaymentStyleOptions.ToString();&lt;BR /&gt;settings[6].settingValue = "{\"bgColor\": \"#0f175e\"}";&lt;/P&gt;&lt;P&gt;settings[7] = new settingType();&lt;BR /&gt;settings[7].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();&lt;BR /&gt;settings[7].settingValue = "{\"url\": \"" + System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Scheme) + System.Web.HttpContext.Current.Request.Url.Host + "/DesktopModules/Donation_Module/hosted.html\"}";&lt;/P&gt;&lt;P&gt;settings[8] = new settingType();&lt;BR /&gt;settings[8].settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString();&lt;BR /&gt;settings[8].settingValue = "{\"showEmail\": true}";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var billTo = new customerAddressType();&lt;BR /&gt;billTo.firstName = firstName;&lt;BR /&gt;billTo.lastName = lastName;&lt;BR /&gt;billTo.country = country;&lt;BR /&gt;billTo.zip = zip;&lt;BR /&gt;billTo.address = address;&lt;BR /&gt;billTo.city = city;&lt;BR /&gt;billTo.state = state;&lt;BR /&gt;billTo.email = email;&lt;BR /&gt;&lt;BR /&gt;if (phoneNumber != "null") billTo.phoneNumber = phoneNumber;&lt;/P&gt;&lt;P&gt;var cust = new customerDataType();&lt;BR /&gt;cust.email = email;&lt;BR /&gt;&lt;BR /&gt;var transactionRequest = new transactionRequestType&lt;BR /&gt;{&lt;BR /&gt;transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // authorize capture only&lt;BR /&gt;amount = amount,&lt;BR /&gt;billTo = billTo,&lt;BR /&gt;customer = cust&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var request = new getHostedPaymentPageRequest();&lt;BR /&gt;request.transactionRequest = transactionRequest;&lt;BR /&gt;request.hostedPaymentSettings = settings;&lt;/P&gt;&lt;P&gt;// instantiate the controller that will call the service&lt;BR /&gt;var controller = new getHostedPaymentPageController(request);&lt;BR /&gt;controller.Execute();&lt;/P&gt;&lt;P&gt;// get the response from the service (errors contained if any)&lt;BR /&gt;var response = controller.GetApiResponse();&lt;/P&gt;&lt;P&gt;// validate response&lt;BR /&gt;if (response != null &amp;amp;&amp;amp; response.messages.resultCode == messageTypeEnum.Ok)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Message code : " + response.messages.message[0].code);&lt;BR /&gt;Console.WriteLine("Message text : " + response.messages.message[0].text);&lt;BR /&gt;Console.WriteLine("Token : " + response.token);&lt;BR /&gt;}&lt;BR /&gt;else if (response != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text);&lt;BR /&gt;Console.WriteLine("Failed to get hosted payment page");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 21:08:44 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/67839#M41153</guid>
      <dc:creator>marco_envision</dc:creator>
      <dc:date>2019-05-28T21:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted - Prepopulate email and phone</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/75970#M47428</link>
      <description>&lt;P&gt;I turned into just uncertain if this became good enough for cases where a person takes a mail order payment on the telephone, so the cardboard holder is not present? The &lt;A href="https://www.boneheadphone.com/best-turntable-under-200/" target="_self"&gt;website&lt;/A&gt; regarded to indicate that you needed to use the virtual terminal for this.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 17:49:49 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Prepopulate-email-and-phone/m-p/75970#M47428</guid>
      <dc:creator>shsie3l3</dc:creator>
      <dc:date>2021-04-25T17:49:49Z</dc:date>
    </item>
  </channel>
</rss>

