<?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 how to set email field when using java authorize.net sdk? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/how-to-set-email-field-when-using-java-authorize-net-sdk/m-p/62220#M36584</link>
    <description>&lt;P&gt;I am using the java sdk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/AuthorizeNet/sdk-java" target="_blank"&gt;https://github.com/AuthorizeNet/sdk-java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using accept.js to send credit card to authorize.net via javascript and then in server side i execute accept payment transaction call as described in the following documentation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/index.html#payment-transactions-create-an-accept-payment-transaction" target="_blank"&gt;https://developer.authorize.net/api/reference/index.html#payment-transactions-create-an-accept-payment-transaction&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a chunk of code below for populating customer billing information. I set all information such as firstname, lastname, address, email etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CustomerAddressType customerType = new CustomerAddressType()
customerType.setFirstName(firstName)
customerType.setLastName(lastName)
customerType.setAddress(address)
customerType.setCity(city)
customerType.setState(state)
customerType.setZip(zip)
customerType.setCountry(country)
customerType.setPhoneNumber(phone)
customerType.setEmail(email)

// Create the payment transaction request
TransactionRequestType txnRequest = new TransactionRequestType();
txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());
txnRequest.setPayment(paymentType);
txnRequest.setBillTo(customerType)

&amp;nbsp;

txnRequest.setAmount(total.setScale(2, RoundingMode.CEILING));


// Make the API Request
CreateTransactionRequest apiRequest = new CreateTransactionRequest();
apiRequest.setTransactionRequest(txnRequest);
CreateTransactionController controller = new CreateTransactionController(apiRequest);
controller.execute();


CreateTransactionResponse tresponse = controller.getApiResponse();&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;&lt;P&gt;The problem is that i cannot set the email field. All other fields appear in the transaction but email field is always blank. This hapens both in sandbox as well as production. So i am wondering if i have missed anything that is preventing me to set the email field? I appreciate any help! Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since i am not being able to paste the image i have uploaded to an external images host. Please see the image in this link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://ibb.co/daRQnx" target="_blank"&gt;https://ibb.co/daRQnx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 07:18:34 GMT</pubDate>
    <dc:creator>kofhearts</dc:creator>
    <dc:date>2018-03-21T07:18:34Z</dc:date>
    <item>
      <title>how to set email field when using java authorize.net sdk?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/how-to-set-email-field-when-using-java-authorize-net-sdk/m-p/62220#M36584</link>
      <description>&lt;P&gt;I am using the java sdk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/AuthorizeNet/sdk-java" target="_blank"&gt;https://github.com/AuthorizeNet/sdk-java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using accept.js to send credit card to authorize.net via javascript and then in server side i execute accept payment transaction call as described in the following documentation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/index.html#payment-transactions-create-an-accept-payment-transaction" target="_blank"&gt;https://developer.authorize.net/api/reference/index.html#payment-transactions-create-an-accept-payment-transaction&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a chunk of code below for populating customer billing information. I set all information such as firstname, lastname, address, email etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CustomerAddressType customerType = new CustomerAddressType()
customerType.setFirstName(firstName)
customerType.setLastName(lastName)
customerType.setAddress(address)
customerType.setCity(city)
customerType.setState(state)
customerType.setZip(zip)
customerType.setCountry(country)
customerType.setPhoneNumber(phone)
customerType.setEmail(email)

// Create the payment transaction request
TransactionRequestType txnRequest = new TransactionRequestType();
txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());
txnRequest.setPayment(paymentType);
txnRequest.setBillTo(customerType)

&amp;nbsp;

txnRequest.setAmount(total.setScale(2, RoundingMode.CEILING));


// Make the API Request
CreateTransactionRequest apiRequest = new CreateTransactionRequest();
apiRequest.setTransactionRequest(txnRequest);
CreateTransactionController controller = new CreateTransactionController(apiRequest);
controller.execute();


CreateTransactionResponse tresponse = controller.getApiResponse();&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;&lt;P&gt;The problem is that i cannot set the email field. All other fields appear in the transaction but email field is always blank. This hapens both in sandbox as well as production. So i am wondering if i have missed anything that is preventing me to set the email field? I appreciate any help! Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since i am not being able to paste the image i have uploaded to an external images host. Please see the image in this link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://ibb.co/daRQnx" target="_blank"&gt;https://ibb.co/daRQnx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 07:18:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/how-to-set-email-field-when-using-java-authorize-net-sdk/m-p/62220#M36584</guid>
      <dc:creator>kofhearts</dc:creator>
      <dc:date>2018-03-21T07:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to set email field when using java authorize.net sdk?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/how-to-set-email-field-when-using-java-authorize-net-sdk/m-p/62245#M36604</link>
      <description>&lt;P&gt;You need to set the email address on the transaction.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've updated the java sample code for Charge A Credit Card, same will work for you, see lines 35,35 &amp;amp; 42 of &lt;A href="https://github.com/AuthorizeNet/sample-code-java/blob/master/src/main/java/net/authorize/sample/PaymentTransactions/ChargeCreditCard.java" target="_blank"&gt;https://github.com/AuthorizeNet/sample-code-java/blob/master/src/main/java/net/authorize/sample/PaymentTransactions/ChargeCreditCard.java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 14:46:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/how-to-set-email-field-when-using-java-authorize-net-sdk/m-p/62245#M36604</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2018-03-22T14:46:21Z</dc:date>
    </item>
  </channel>
</rss>

