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.

Refund a Charge

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.

REFUND A CHARGE

Hint: See the Testing Info & Data page for testing refunds.

Refund a Specific Credit Card Transaction

Refund an ACH Transaction (North America only)

 

 

Refund a Specific Credit Card Transaction - 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

Refund a Specific Credit Card Transaction - 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

Refund a Specific Credit Card Transaction - 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

Refund an ACH Transaction

North America only.

Refund an ACH Transaction - PHP

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

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

$iATS_CL = new iATS\CustomerLink($agentCode, $password, $region);

$request = array(
'customerIPAddress' => '', // Optional. The client IP.
'customerCode' => $creditCardCustomerCode, // The iATS customer code token you generated with a previous call to the CustomerLink service
);

//// Make the API call using the CustomerLink service.
$response = $iATS_CL->getCustomerCodeDetail($request);

// Response will be an array - either the returned data, or an API error.
// Handle your returned data here.

Return to Top

Refund an ACH Transaction - Java

import com.iatspayments.www.NetGate.*;
import java.util.GregorianCalendar;

public class RetrieveCustomerData {

public static void main(String a[]) throws Exception {

CustomerLinkService customerLinkService = new CustomerLinkService();

CreateCreditCardCustomerCodeV1 createCreditCardCustomerCodeV1 = new CreateCreditCardCustomerCodeV1();

createCreditCardCustomerCodeV1.setPassword("TEST88");
createCreditCardCustomerCodeV1.setPassword("TEST");
createCreditCardCustomerCodeV1.setPassword("TEST88");
createCreditCardCustomerCodeV1.setCustomerIPAddress("");
createCreditCardCustomerCodeV1.setFirstName("Test");
createCreditCardCustomerCodeV1.setLastName("Account");
createCreditCardCustomerCodeV1.setCustomerCode("");
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");

IATSResponse response = customerLinkService.createCreditCardCustomerCode(createCreditCardCustomerCodeV1);
System.out.println("Customer code: " + response.getProcessResult().getCustomerCode());
}
}

Return to Top

Refund an ACH Transaction - Ruby

class RetrieveCustomerData
require 'iats_payments'
service = CustomerLinkService.new(nil)
getCustomerCodeDetail = GetCustomerCodeDetail.new

getCustomerCodeDetail.customerIPAddress = ""
getCustomerCodeDetail.customerCode = creditCardCustomerCode

response = service.getCustomerCodeDetail(getCustomerCodeDetail)
end

Return to Top

Contact Us