SDK AVS Only

Document created by gjsissons on May 6, 2016
Version 1Show Document
  • View in full screen mode

An AVS Only transaction is a variation of an Authorization transaction that uses the Address Verification System to enable you to verify that a customer-supplied address matches the billing address associated with the card. To submit an AVS Only transaction, submit an Authorization transaction with the <amount> element set to 000 and the optional billToAddress element with appropriate child values.

 

PHP example

 

<?php
require_once realpath(dirname(__FILE__)) . '/../lib/LitleOnline.php';

#AVS Only
$auth_info = array(
  'orderId' => '1',
  'id'=> '456',
  'amount' => '000',
  'orderSource'=>'ecommerce',
  'billToAddress'=>array(
    'name' => 'John Smith',
    'addressLine1' => '1 Main St.',
    'city' => 'Burlington',
    'state' => 'MA',
    'zip' => '01803-3747',
    'country' => 'US'
  ),
  'card'=>array(
    'number' =>'4457010000000009',
    'expDate' => '0118',
    'cardValidationNum' => '349',
    'type' => 'VI'
  )
);

$initialize = &new LitleOnlineRequest();
$avsResponse = $initialize->authorizationRequest($auth_info);

#display results
echo ("Response: " . (XmlParser::getNode($avsResponse,'response')) . "<br>");
echo ("Message: " . XmlParser::getNode($avsResponse,'message') . "<br>");
echo ("Litle Transaction ID: " . XmlParser::getNode($avsResponse,'litleTxnId'));
echo ("AVS Result: " . XmlParser::getNode($avsResponse,'avsResult'));

 

Java example

 

import com.litle.sdk.*;
import com.litle.sdk.generate.*;

//AVS Only
public class AvsOnlyExample {
    public static void main(String[] args) {
        Authorization auth = new Authorization();
        auth.setOrderId("1");
        auth.amount(0L);
        auth.setOrderSource(OrderSourceType.ECOMMERCE);
        Contact billToAddress = new Contact();
        billToAddress.setName("John Smith");
        billToAddress.setAddressLine1("1 Main St.");
        billToAddress.setCity("Burlington");
        billToAddress.setState("MA");
        billToAddress.setCountry(CountryTypeEnum.US);
        billToAddress.setZip("01803-3747");
        auth.setBillToAddress(billToAddress);
        CardType card = new CardType();
        card.setNumber("375001010000003");
        card.setExpDate("0118");
        card.setCardValidationNum("349");
        card.setType(MethodOfPaymentTypeEnum.AX);
        auth.setCard(card);

        AuthorizationResponse response = new LitleOnline().authorize(authorization);
        //Display Results
        System.out.println("Response: " + response.getResponse());
        System.out.println("Message: " + response.getMessage());
        System.out.println("Litle Transaction ID: " + response.getLitleTxnId());
        System.out.println("AVS Result: " + response.getFraudResult().getAvsResult());
    }
}

 

.NET example

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Litle.Sdk;

//Address Verification System with Auth transaction
class Example
{
        [STAThread]
         public static void Main(String[] args)
         {
             LitleOnline litle = new LitleOnline();
             authorization authorization = new authorization();
             authorization.orderId = "1";
             authorization.amount = 0;
             authorization.orderSource = orderSourceType.ecommerce;
             contact contact = new contact();
             contact.name = "John Smith";
             contact.addressLine1 = "1 Main St.";
             contact.city = "Burlington";
             contact.state = "MA";
             contact.zip = "01803-3747";
             contact.country = countryTypeEnum.US;
             authorization.billToAddress = contact;
             cardType card = new cardType();
             card.type = methodOfPaymentTypeEnum.VI;
             card.number = "4457010000000009";
             card.expDate = "0118";
             card.cardValidationNum = "349";
             authorization.card = card;

             authorizationResponse response = litle.Authorize(authorization);
             //Display Results
             Console.WriteLine("Response: " + response.response);
             Console.WriteLine("Message: " + response.message);
             Console.WriteLine("Litle Transaction Id: " + response.litleTxnId);
             Console.WriteLine("AVS response: " + response.fraudResult.avsResult);
             Console.ReadLine();
         }
}

 

Ruby example

 

require 'LitleOnline'
include LitleOnline

#AVS Only
auth_info = {
  'orderId' => '1',
  'amount' => '0',
  'orderSource'=>'ecommerce',
  'billToAddress'=>{
  'name' => 'John Smith',
  'addressLine1' => '1 Main St.',
  'city' => 'Burlington',
  'state' => 'MA',
  'zip' => '01803-3747',
  'country' => 'US'},
  'card'=>{
  'number' =>'4**************9',
  'expDate' => '0118',
  'cardValidationNum' => '349',
  'type' => 'VI'}
}
auth_response = LitleOnlineRequest.new.authorization(auth_info)

#display results
puts "Response: " + auth_response.authorizationResponse.response
puts "Message: " + auth_response.authorizationResponse.message
puts "Litle Transaction ID: " + auth_response.authorizationResponse.litleTxnId
puts "AVS Match: " + auth_response.authorizationResponse.fraudResult.avsResult


Attachments

    Outcomes