44import java .math .RoundingMode ;
55
66import net .authorize .Environment ;
7- import net .authorize .api .contract .v1 .ANetApiResponse ;
8- import net .authorize .api .contract .v1 .CreateTransactionRequest ;
9- import net .authorize .api .contract .v1 .CreateTransactionResponse ;
10- import net .authorize .api .contract .v1 .CreditCardType ;
11- import net .authorize .api .contract .v1 .MerchantAuthenticationType ;
12- import net .authorize .api .contract .v1 .MessageTypeEnum ;
13- import net .authorize .api .contract .v1 .PaymentType ;
14- import net .authorize .api .contract .v1 .TransactionRequestType ;
15- import net .authorize .api .contract .v1 .TransactionResponse ;
16- import net .authorize .api .contract .v1 .TransactionTypeEnum ;
7+ import net .authorize .api .contract .v1 .*;
178import net .authorize .api .controller .CreateTransactionController ;
189import net .authorize .api .controller .base .ApiOperationBase ;
1910
@@ -40,10 +31,15 @@ public static ANetApiResponse run(String apiLoginId, String transactionKey, Doub
4031 creditCard .setExpirationDate ("0822" );
4132 paymentType .setCreditCard (creditCard );
4233
34+ // Set email address (optional)
35+ CustomerDataType customer = new CustomerDataType ();
36+ customer .setEmail ("test@test.test" );
37+
4338 // Create the payment transaction object
4439 TransactionRequestType txnRequest = new TransactionRequestType ();
4540 txnRequest .setTransactionType (TransactionTypeEnum .AUTH_CAPTURE_TRANSACTION .value ());
4641 txnRequest .setPayment (paymentType );
42+ txnRequest .setCustomer (customer );
4743 txnRequest .setAmount (new BigDecimal (amount ).setScale (2 , RoundingMode .CEILING ));
4844
4945 // Create the API request and set the parameters for this specific request
0 commit comments