SDK Capture

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

You use a Capture transaction to transfer previously authorized funds from the customer to the merchant after order fulfillment. You can submit a Capture transaction for the full amount of the Authorization, or for a lesser amount by setting the partial attribute to true.

 

 

PHP

 

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

#Capture
#litleTxnId contains the Litle Transaction Id returned on the authorization

$capture_info = array(
        'litleTxnId'=>'100000000000000001',
        'id'=> '456',
    );

$initilaize = new LitleOnlineRequest(); 
$captureResponse = $initilaize->captureRequest($capture_info);

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

 

Java

 

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

public class CaptureExample {
    public static void main(String[] args) {
        Capture capture = new Capture();
        //litleTxnId contains the Litle Transaction Id returned on the authorization
        capture.setLitleTxnId(100000000000000001L);
        CaptureResponse response = new LitleOnline().capture(capture);
        //Display Results
        System.out.println("Response: " + response.getResponse());
        System.out.println("Message: " + response.getMessage());
        System.out.println("Litle Transaction ID: " + response.getLitleTxnId());
    }
}

 

.NET

 

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

    class Example
    {
        [STAThread]
        public static void Main(String[] args)
        {
            //litleTxnId contains the Litle Transaction Id returned on the authorization
            LitleOnline litle = new LitleOnline();
            capture capture = new capture();
            capture.litleTxnId = 100000000000000001;
            captureResponse captureResponse = litle.Capture(capture);
            //Display Results
            Console.WriteLine("Response: " + captureResponse.response);
            Console.WriteLine("Message: " + captureResponse.message);
            Console.WriteLine("Litle Transaction Id: " + captureResponse.litleTxnId);
            Console.ReadLine();
        }
    }

 

 

Ruby

 

require 'LitleOnline'
include LitleOnline

#Capture
#litleTxnId contains the Litle Transaction Id returned on the authorization
capture_info =  {'litleTxnId' => '100000000000000001'}
capture_response = LitleOnlineRequest.new.capture(capture_info)

#display results
puts "Response: " + capture_response.captureResponse.response
puts "Message: " + capture_response.captureResponse.message
puts "Litle Transaction ID: " + capture_response .captureResponse.litleTxnId

Attachments

    Outcomes