Reply
Member
Posts: 3
Registered: ‎07-06-2015
Accepted Solution

Cvv issue with CIM Java SDK

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


Accepted Solutions
Solution
Accepted by topic author niordanov
‎10-14-2015 07:52 AM
Administrator
Posts: 591
Registered: ‎08-21-2009

Re: Cvv issue with CIM Java SDK

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.

 

View solution in original post


All Replies
Solution
Accepted by topic author niordanov
‎10-14-2015 07:52 AM
Administrator
Posts: 591
Registered: ‎08-21-2009

Re: Cvv issue with CIM Java SDK

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.

 

Member
Posts: 3
Registered: ‎07-06-2015

Re: Cvv issue with CIM Java SDK

Thanks, Trevor,

 

I'll try the fix.

 

Niki