Hi guys,
I am JAVA deveploper.
I select ARB method for payment service of my app.
To start I created a sandbox account for demo.
My example code work is good , except check CCV code function.
Transactions always execute without CVV code or CCV code is incorrect.
I also enable CCV handling filter by guideline at:
Here is my code:
Merchant merchant = Merchant.createMerchant(Environment.SANDBOX, apiLoginID, transactionKey); PaymentSchedule new_schedule = PaymentSchedule.createPaymentSchedule(); new_schedule.setIntervalLength(1); new_schedule.setSubscriptionUnit(SubscriptionUnitType.MONTHS); new_schedule.setStartDate(new Date()); new_schedule.setTotalOccurrences(9999); new_schedule.setTrialOccurrences(0); // Create a new credit card // CreditCard credit_card = CreditCard.createCreditCard(); credit_card.setCreditCardNumber("4111 1111 1111 1111"); credit_card.setExpirationDate("2016-13"); credit_card.setCardCode("aaa"); // Create a billing info // Address billing_info = Address.createAddress(); billing_info.setFirstName("Customer7 " + System.currentTimeMillis()); billing_info.setLastName("Customer7"); // Create a customer and specify billing info // Customer customer = Customer.createCustomer(); customer.setBillTo(billing_info); // Create a subscription and specify payment, schedule and customer // Subscription subscription = Subscription.createSubscription(); subscription.setPayment(Payment.createPayment(credit_card)); subscription.setSchedule(new_schedule); subscription.setCustomer(customer); subscription.setAmount(new BigDecimal(6.00)); subscription.setTrialAmount(Transaction.ZERO_AMOUNT); subscription.setRefId("REF:" + System.currentTimeMillis()); subscription.setName("Customer7 " + System.currentTimeMillis()); net.authorize.arb.Transaction transaction = merchant.createARBTransaction(TransactionType.CREATE_SUBSCRIPTION, subscription); Result<Transaction> result = (Result<Transaction>)merchant.postTransaction(transaction);
What does I miss something?
Thank in advance!
โ08-14-2014 09:49 PM
It a sandbox account, any ccv code will work.
If you need to test the error, read the error generation guide
โ08-15-2014 06:06 AM
Hi Raynor,
Thank for reply.
I also read about guide "error generation".
But how to post transation to new url like "https://test.authorize.net/gateway/transact.dll"?
I checked with statement:
Merchant merchant = Merchant.createMerchant(Environment.SANDBOX, apiLoginID, transactionKey);
baseUrl of Environment.SANDBOX is "https://test.authorize.net"
I try create new Environment with new baseURL.
But It cannot because constructor of Environment is private.
โ08-17-2014 07:37 PM
If you need to modify the source, you can download it on
https://github.com/AuthorizeNet/sdk-java
Oop, you are trying to do ARB, ARB does not valid the credit card when you create the subscription, because it doesn't not generate a transaction.
If you need to valid the card before creating an ARB, do a AIM auth_only transaction first.
โ08-18-2014 04:21 AM - edited โ08-18-2014 04:26 AM