Developers

We want to make payments easy for developers. Let us do the heavy lifting with these developer tools so you can simply and easily deploy payment and donation solutions.

Batch Processing

Once you have installed one of our API wrappers (in PHP, Ruby, or Java) you can get started right away with copy-and-paste code examples.

BATCH PROCESSING
FILE FORMATS

1. U.S. and U.K. Credit Cards - Without using customer codes

Date, Invoice, First Name, Last Name, Street, City, State, Zip Code, Amount, MOP, Credit Card #, Expiry

Example:

10/28/11, 00001,Joe,Smith,123 Any St,Anytown,ST,10023,25.00,AMX,300000000000001,0708

 

2. Canadian Credit Cards - Without Using Customer Codes

Date, Invoice, Full Name, Amount, MOP, Credit Card #, Expiry
Example:

10/28/11, 00001,JoeSmith,25.00,AMX,300000000000001,0708 

 

3. All Currencies - Using Customer Codes (North America & UK)

Invoice Number, Customer Code, Amount, Comment
Example:

a123467,A168786,1.10,comment1

 

4. Format Notes
  • If any fields must be omitted (the invoice number for example), the comma separators must still be included. Example:
10/28/11,,Joe,Smith,123 Any St,Anytown,ST,10023,25.00,AMX,300000000000001,0708

  • Credit Card Abbreviations must all be capitalized:
North America - VISA, MC, AMX, DSC
United Kingdom - VISA, MC, AMX, MAESTR

 

Process a Batch

Request Batch Process Results

 

 

Process a Batch - PHP

<?php
require 'iATS/iATS.php';

$agentCode = 'TEST88'; // Assigned by iATS
$password = 'TEST88'; // Assigned by iATS
$region = 'NA'; // NA = North America, UK = United Kingdom

// Only applies to recurring payments, but is a required parameter
$beginDate = strtotime('01/01/2014');
$endDate = strtotime('01/31/2014');

// Create and populate the request object.
$request = array(
'customerIPAddress' => '', // The client IP.
'customerCode' => '', // Optional. The iATS Customer Code.
'firstName' => 'Test', // The customer's first name.
'lastName' => 'Account', // The customer's last name.
'companyName' => 'Test Co.', // The customer's company name.
'address' => '1234 Any Street', // The customer's address.
'city' => 'Schenectady', // The customer's city.
'state' => 'NY', // The customer's state or province.
'zipCode' => '12345', // The customer's ZIP code.
'phone' => '555-555-1234', // The customer's phone number.
'fax' => '555-555-4321', // The customer's FAX number.
'alternatePhone' => '555-555-5555', // The customer's alternate phone number.
'email' => 'email@test.co', // The customer's email address.
'comment' => 'Customer code creation test.', // A comment describing this transaction.
'recurring' => FALSE, // TRUE if a recurring payment should be created.
'amount' => '5', // The payment amount.
'beginDate' => $beginDate, // The begin date of the recurring payment, if used.
'endDate' => $endDate, // The end date of the recurring payment, if used.
'scheduleType' => 'Annually', // The recurring payment schedule.
// Options: Weekly, Monthly, Quarterly, Annually.
'scheduleDate' => '', // The recurring payment schedule date.
// Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string.
'creditCardCustomerName' => 'Test Account', // The customer's name as appears on the credit card.
'creditCardNum' => '4222222222222220', // The customer's credit card number.
'creditCardExpiry' => '12/17', // The customer's credit card expiration date.
'mop' => 'VISA', // Optional. The customer's method of payment.
'currency' => 'USD', // Optional. The customer's currency.
);

//// Make the API call using the CustomerLink service.
$iATS_CL = new iATS\CustomerLink($agentCode, $password, $region);

$response = $iATS_CL->createCreditCardCustomerCode($request);

// Verify successful call.
if (trim($response['AUTHORIZATIONRESULT']) == 'OK')
{
// Assign the new Customer Code to a new variable
$creditCardCustomerCode = $response['CUSTOMERCODE'];
}
}

Return to Top

Process a Batch - Java

import com.iatspayments.www.NetGate.*;

import java.util.GregorianCalendar;

public class CreateAToken {
public static void main(String[] args) throws Exception {

//Creates the customer link to the service
CustomerLinkService customerLink = new CustomerLinkService();
CreateCreditCardCustomerCodeV1 createCreditCardCustomerCodeV1 = new CreateCreditCardCustomerCodeV1();
createCreditCardCustomerCodeV1.setPassword("TEST");
createCreditCardCustomerCodeV1.setPassword("TEST88");
createCreditCardCustomerCodeV1.setCustomerIPAddress("");
createCreditCardCustomerCodeV1.setFirstName("Test");
createCreditCardCustomerCodeV1.setLastName("Account");
createCreditCardCustomerCodeV1.setCompanyName("Test Co");
createCreditCardCustomerCodeV1.setAddress("1234 Any Stree");
createCreditCardCustomerCodeV1.setState("NY");
createCreditCardCustomerCodeV1.setZipCode("12345");
createCreditCardCustomerCodeV1.setPhone("555-555-1234");
createCreditCardCustomerCodeV1.setFax("555-555-4321");
createCreditCardCustomerCodeV1.setAlternatePhone("555-555-5555");
createCreditCardCustomerCodeV1.setEmail("email@test.co");
createCreditCardCustomerCodeV1.setComment("Customer code creation test.");
createCreditCardCustomerCodeV1.setRecurring(false);
createCreditCardCustomerCodeV1.setAmount("5");
createCreditCardCustomerCodeV1.setScheduleDate("");
createCreditCardCustomerCodeV1.setScheduleType("Annually");
createCreditCardCustomerCodeV1.setBeginDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setEndDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setCreditCardNum("4222222222222220");
createCreditCardCustomerCodeV1.setCreditCardExpiry("12/17");
createCreditCardCustomerCodeV1.setMop("VISA");

//Creates the response which holds the customer code
IATSResponse response = customerLink.createCreditCardCustomerCode(createCreditCardCustomerCodeV1);
createCreditCardCustomerCodeV1.setCustomerCode(response.getProcessResult().getCustomerCode());
System.out.println("Customer Code (Optional): " + response.getProcessResult().getCustomerCode());
System.out.println("Authorization Result: " + response.getProcessResult().getAuthorizationResult());

}
}

Return to Top

Process a Batch - Ruby

require 'iats_payments'

# North American server:
service = ProcessLinkService.new(nil)


# UK Server:
# service = ProcessLinkService.new("https://www.iatspayments.com/NetGate/ProcessLink.asmx");

processCard = ProcessCreditCardV1.new
processCard.agentCode = "TEST88"
processCard.password = "TEST88"
processCard.creditCardNum = "4222222222222220"
processCard.creditCardExpiry = "05/15"
processCard.cvv2 = "123"
processCard.mop = "VISA"
processCard.firstName = "John"
processCard.lastName = "Smith"
processCard.address = "West Georgia St"
processCard.city = "BC"
processCard.state = "AP"
processCard.zipCode = "1312"
processCard.total = "3"
processCard.comment = "Test"
response = service.processCreditCard(processCard)
puts response.PROCESSRESULT.TRANSACTIONID, "Generated Transaction Id"

Return to Top

 

REQUEST BATCH PROCESS RESULTS

Batch results consist of the data you sent, with a result and transaction ID appended to each row. The example below returned the following data:

1234567890,A11718222,10,comment on first transaction,OK: 678594:
1234567891,A11718224,50,this is another transaction,OK: 678594:

Request Batch Process Results - PHP

<?php
require 'iATS/iATS.php';

$agentCode = 'TEST88'; // Assigned by iATS
$password = 'TEST88'; // Assigned by iATS

$iATS_PL = new iATS\ProcessLink($agentCode, $password);

$request = array(
'customerIPAddress' => '', // Optional. The client's IP.
'batchId' => $batch_id // The ID of the existing iATS batch process which was returned by processCreditCardBatch() in a previous step
);


//// Make the API call using the ProcessLink service.
$response = $iATS_PL->getBatchProcessResultFile($request);

$result_message = $response['AUTHORIZATIONRESULT'];
$base64_encoded_content = $response['BATCHPROCESSRESULTFILE'];

// CSV content will be what you submitted, but with a status message & code appended to each line.
$batch_result_csv_content = base64_decode($base64_encoded_content);

// The meat of the results ...
var_dump($batch_result_csv_content);

Return to Top

Request Batch Process Results - Java

import com.iatspayments.www.NetGate.GetBatchProcessResultFileV1;
import com.iatspayments.www.NetGate.IATSResponse;
import com.iatspayments.www.NetGate.ProcessLinkService;
import sun.misc.BASE64Decoder;

import java.io.IOException;
import java.io.InputStream;

public class requestBatchProcessResults{
public static void main(String[] args) throws Exception {
ProcessLinkService processLinkService = new ProcessLinkService();
GetBatchProcessResultFileV1 getBatchProcessResultFileV1 = new GetBatchProcessResultFileV1();
getBatchProcessResultFileV1.setCustomerIPAddress("");
getBatchProcessResultFileV1.setBatchId("");

IATSResponse response = processLinkService.getBatchProcessResultFile(getBatchProcessResultFileV1);
String resultMessage = response.getAuthResult().getAuthStatus();
String base64EncodedContent = response.getBatchResult().getBatchprocessResultFile();

BASE64Decoder decoder = new BASE64Decoder();
byte[] decodedBytes = decoder.decodeBuffer(base64EncodedContent);
System.out.println(decodedBytes);
}
}

Return to Top

Request Batch Process Results - Ruby

class requireBatchProcessResult
require 'iats_payments'
service = processLink.new(nil)
getBatchProcessResultFile = GetBatchProcessResultFile.new
getBatchProcessResultFile.customerIPAddress = ""
getBatchProcessResultFile.batchID = ""

response = service.getBatchProcessResultFile(getBatchProcessResultFile)
result_message = response.getAuthorizationResult
base64_encoded_content = response.getBatchProcessresultFile
batch_result_csv_content = Base64.decode64(base64_encoded_content)

end

Return to Top

Contact Us