- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I do not supply the cvv code I'm getting the following error trying to create customer and payment profile:
The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:cardCode' element is invalid - The value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:cardCode' - The Pattern constraint failed.
I'm using the Java 1.8.4 SDK. Wondering if it's an issue with the SDK or I am doing something wrong. Here is what the code looks like:
String apiLoginID = ...;
String transactionKey = ...;
Merchant merchant = Merchant.createMerchant(environment, apiLoginID, transactionKey);
CustomerProfile customerProfile = CustomerProfile.createCustomerProfile();
customerProfile.setMerchantCustomerId(...);
customerProfile.setEmail(...);
customerProfile.setDescription(...);
net.authorize.cim.Transaction transaction = merchant.createCIMTransaction(net.authorize.cim.TransactionType.CREATE_CUSTOMER_PROFILE);
transaction.setCustomerProfile(customerProfile);
CreditCard creditCard = CreditCard.createCreditCard();
creditCard.setCreditCardNumber(...);
creditCard.setExpirationMonth(...);
creditCard.setExpirationYear(...);
net.authorize.data.xml.Payment payment = net.authorize.data.xml.Payment.createPayment(creditCard);
net.authorize.data.xml.Address address = net.authorize.data.xml.Address.createAddress();
address.setAddress(...);
address.setCity(...);
address.setFirstName(...);
address.setLastName(...);
address.setPhoneNumber(...);
address.setState(...);
address.setZipPostalCode(...);
net.authorize.data.cim.PaymentProfile paymentProfile = net.authorize.data.cim.PaymentProfile.createPaymentProfile();
paymentProfile.setCustomerType(net.authorize.data.xml.CustomerType.INDIVIDUAL);
paymentProfile.addPayment(payment);
paymentProfile.setBillTo(address);
transaction.addPaymentProfile(paymentProfile);
transaction.setValidationMode(ValidationModeType.TEST_MODE);
@SuppressWarnings("unchecked")
net.authorize.cim.Result<net.authorize.cim.Transaction> result = (net.authorize.cim.Result<net.authorize.cim.Transaction>) merchant
.postTransaction(transaction);
Niki
Solved! Go to Solution.
07-06-2015 08:49 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Niki,
It appears that this is issue has been reported and there is a proposed fix in our github repository. I will talk to our SDK developers about validating this fix and accepting it into our SDK, but for the moment I can only recommend that you apply it manually.
07-06-2015 03:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Niki,
It appears that this is issue has been reported and there is a proposed fix in our github repository. I will talk to our SDK developers about validating this fix and accepting it into our SDK, but for the moment I can only recommend that you apply it manually.
07-06-2015 03:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Trevor,
I'll try the fix.
Niki
07-09-2015 03:01 AM

