I am using the java sdk.
https://github.com/AuthorizeNet/sdk-java
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.
I have a chunk of code below for populating customer billing information. I set all information such as firstname, lastname, address, email etc.
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) 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();
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!
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
Solved! Go to Solution.
03-21-2018 12:12 AM - edited 03-21-2018 12:18 AM
You need to set the email address on the transaction.
I've updated the java sample code for Charge A Credit Card, same will work for you, see lines 35,35 & 42 of https://github.com/AuthorizeNet/sample-code-java/blob/master/src/main/java/net/authorize/sample/Paym...
03-22-2018 07:46 AM
You need to set the email address on the transaction.
I've updated the java sample code for Charge A Credit Card, same will work for you, see lines 35,35 & 42 of https://github.com/AuthorizeNet/sample-code-java/blob/master/src/main/java/net/authorize/sample/Paym...
03-22-2018 07:46 AM