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.

Create a Recurring Transaction

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.

CREATE A RECURRING TRANSACTION

Recurring transactions can be created in two different styles:

  • iATS manages the schedule
  • You (iATS Partner) manage the schedule

 

Partner Managed Schedule

To create a recurring transaction on a schedule that you manage yourself, the only thing you need to do is create a customer code token, and then process a transaction using that token on whatever schedule you decide.

iATS Managed Schedule

Recurring transactions are initiated by creating or updating a customer code token, setting the recurring argument to TRUE, and specifying the startDate, endDate, and scheduleType variables appropriately.

To cancel a recurring transaction, update the customer code token, setting RECURRING argument to FALSE.

PHP

/* See the Create a Token code sample page for the full example.
The values below are the only things that need to be updated from that example
to create a recurring transaction. */
...
'recurring' => TRUE,
'amount' => '9.99',
'beginDate' => strtotime('01/15/2014'),
'endDate' => strtotime('12/15/2014'),
'scheduleType' => 'Monthly', // can be one of Weekly, Monthly, Quarterly or Annually.
'scheduleDate' => '15', // The recurring payment schedule date.
// Monthly: 1~31;
// Weekly: 1~7;
// Quarterly or Annually: empty string
...

Return to Top

Java

import com.iatspayments.www.NetGate.*;

import java.util.GregorianCalendar;

public class CreateRecurringTransaction {
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.setCustomerCode("");
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");
createCreditCardCustomerCodeV1.setRecurring(true);
createCreditCardCustomerCodeV1.setAmount("9.99");
createCreditCardCustomerCodeV1.setBeginDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setEndDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setScheduleType("Monthly");


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

}
}

Return to Top

Ruby

.......

createCreditCardCustomerCodeV1.recurringPayment = TRUE
createCreditCardCustomerCodeV1.amount = "9.99"
createCreditCardCustomerCodeV1.beginDate = Time.new()
createCreditCardCustomerCodeV1.endDate = Time.new()
createCreditCardCustomerCodeV1.scheduleType = "Monthly"
createCreditCardCustomerCodeV1.scheduleDate = "15"

....

Return to Top

Contact Us