Batch Payments

Batch Payments

Introduction

Batch payment allows a merchant to prepare a file containing a list of transactions that will subsequently be processed by PayFacto’s solution. The files may be submitted manually via PayFacto Solution’s on-line interface, or more automatically via FTP. The files are processed daily.


Description

The batch payment system, as included in PayFacto’s solution, allows a merchant to perform purchase and preauthorization transactions, as well as to close preauthorization. These transactions are sent as part of a file to PayFacto’s solution, which processes them on a daily basis.


FTP Transmission


The FTP transmission process is as follows. The merchant must first create a transaction file and upload it to an FTP server. At the set processing time, the payment solution connects to the merchant’s FTP server and downloads the transaction files. The downloaded files are then checked for consistency. In case of error, a file describing the error is returned to the merchant. Accepted files are processed, the included transactions are run, and the results are recorded. Upon completion of all transactions, the payment solution creates a response file containing all transactions and their outcomes (approved, declined, etc.).

Manual Transmission


To submit transaction files manually, a merchant must first create a transaction file and use the payment solution’s on-line interface to upload the file to PayFacto. The received files are then checked for consistency. In case of error, the browser displays an error message.
The received files are put on hold and processed at the time set by PayFacto’s solution. All transactions are processed individually and the payment solution creates a response file containing all transactions and their outcome (approved, declined, etc.). This file is available via the Web interface.

Installation

The installation section informs the merchant of the steps they must take to enable them to make batch payments with the PayFacto payment solution.

FTP Configuration

Merchants who wish to transmit the transaction files via FTP must use a specific configuration.

Transaction Directories

The merchant must create a user name on the FTP server as well as three directories that can be both read from and written to.

Send Directory

The merchant must first create a directory that will contain the files for the PayFacto Solution to download. The merchant may give the directory any name. In this directory, the merchant must create a sub-directory named “done”, which will contain the files that have been sent to PayFacto.

Receive Directory

Another directory must be created to contain the response files, including error files and transaction result files.

Configuring the FTP Transfer with PayFacto

Merchants who wish to transfer files via FTP must contact Customer Service and provide the necessary information to connect to the FTP server:

  • IP address or FTP server name;
  • User name;
  • Password;
  • Full access path to the send and receive directories.

It is now possible to configure a transfer via a standard secure protocol: SFTP (FTP over SSH) and FTPS (FTP over SSL). The last one may be used with implicit and explicit mode. It is possible to use a special port (other than the default) for these two modes of transfer. You need to notify your integrator during the integration process.

SECURITY NOTICE : Our customers’ servers are not within the PayFacto PCI-DSS scope. We wish to remind our customers that it is their responsibility to configure their SFTP or FTPS servers, with a strong encryption, to meet the PCI-DSS standards.
Edit

Transmitting a file

Before transmitting transactions, the merchant must build a file containing all the transactions performed. These transactions consist of purchases, preauthorization, and preauthorization closings.

Supported Transaction Types

Six transactions types are supported. The obligatory parameters are as follows:

  • Purchase : transaction code, client number, amount, card number, expiration date, bill number.
  • Preauthorization : transaction code, client number, amount, card number, expiration date, bill number.
  • Preauthorization completion : transaction code, client number, amount, bill number, transaction number, authorization number, original bill number.
  • Refund : transaction code, client number, amount, card number, expiration date, bill number.
  • Purchase without card (with token) : transaction code, client number, amount, token, bill number. Optional parameters will be ignored when performing the transaction.
  • Refund without card : transaction code, client number, amount, bill number, original transaction number, original bill number.

Structure of the Transaction File

The transaction file has two main sections: the header, which contains information about the merchant and the transaction batch, and the transaction section. The file must be in text format.

Header Section

The header contains three parameters that need to be specified. Each parameter must be separated by a comma.

  • Batch number : 8 characters [A-Z, 0-9]: the batch number is a unique identifier for the submitted transaction batch.The batch number may not be reused.
  • Merchant number : 8 characters [0-9]: the merchant identification number provided by PayFacto.
  • Number of transactions : 8 characters [0-9]: the number of characters in the file.

Transaction Section

Transactions must be entered on separate lines after the header. Transactions may have 6 to 9 parameters, depending on the type: purchases and preauthorization each require 6 parameters, while authorization closings require 9 parameters. Each parameter must be separated by a comma.

  • Transaction code : 00, 01, 02, 03, 52 or 50 : code indicating which type of transaction was performed.

00 : purchase;
01 : preauthorization;
02 : preauthorization completion;
03 : refund;
52 : purchase without card (with token)
50 : refund without card

  • Client number: 8 characters [a-Z, 0-9]: the client merchant’s ID number (the person who performs the purchase with the merchant service).
  • Amount : 11 characters [0-9]: amount of transaction. 11 characters, without a decimal point. E.g.: 10.14 = 00000001014.
  • Card number : up to 40 characters [0-9, space]: the client’s credit card number, to which the Amount will be charged. In the case of a purchase without card, token replaces the card number.
  • Token : (for purchase without card only) 35 characters [a-z, 0-9] : token replaces the card number, it is associated with a customer and a credit card number. The token is supplied by PayFacto upon registration of a client in the recurrence module. For more details on the token, consult the “Recurrence” documentation.
  • Expiration date : 4 characters [0-9]: the credit card’s expiration date in the following format: MMYY. E.g.: April 08 = 0408. In the case of a purchase without card, enter 4 spaces.
  • Bill number : 12 characters [A-Z, 0-9]: the merchant bill number for this transaction. Must contain 12 characters. E.g.: 123456789123.
  • Transaction number : (completion only*) up to 12 characters [0-9]: the transaction number of the preauthorization to close.
  • Authorization number : (completion only*) 8 characters [A-Z, 0-9, space]: the authorization number of the preauthorization to close.
  • Original bill number : : (completion only) 12 characters [0-9]: the bill number of the transaction to close.


*The transaction and authorization numbers are returned in a response file following the preauthorization.

Example of Transaction File



Note: The empty parameters between the commas are needed if they are in between needed parameters.
Refer to image with transaction code 50, card number and expiration date is empty due to them being in between needed parameters. While for a transaction code 00 the parameters that are not needed are at the end so we can end the line early.

Uploading the Files into the FTP Transfer Directory

The files must be on the FTP server by the time determined for batch processing.
All files must have an “.txt” or “.csv” extension.

Return of Files with Errors

FTP Return File

When using an FTP server, return codes are sent to the current directory in a file that has the same name as the original file but an “.err” extension. Error messages are documented in section 4.

Web Interface Returns

In the Web interface, only import errors are reported. Errors are displayed during the importing.

Validating Files

Only basic validation procedures are performed when importing a batch file. If the file contains the correct number of parameters and if the parameters have the required length, the file is approved. However, the file may be declined later in the process if one or more of the following parameters do not meet the requirements:

  • unique batch number;
  • merchant number;
  • number of transactions;
  • number of parameters in a transaction;
  • maximum length for transaction parameters.

Return Files of Successfully Processed Files

Return File [Batch Number].cvs

The return file’s name will be : yyyMMddhhmm_ FileName.enc
The encrypted file’s name will be : BatchNumber_ yyyyMMddhhmm.csv

Transaction Reports

Response file’s format :


Header line : : batch number, merchant number, number of transactions ;
Batch number : 8 characters [A-Z, 0-9] ;
Merchant number : 8 characters [0-9] ;
Number of transactions : digit [0-9] ;
One line per transaction : transaction code, client number, amount, card number, expiration date, bill number, return code, transaction number, authorization number ;
Transaction code : 00 ou 01 ou 02 ;
Client number : 8 characters [A-Z, 0-9] ;
Amount : 11 characters [0-9] ;
Card number : Up to 40 characters [space, 0-9] ;
Expiration date : 4 characters [0-9] MMYY ;
Bill number : 12 characters [A-Z, 0-9] ;
Return code : Up to 4 characters [A-Z, 0-9] (return codes are detailed separately) ;
Transaction number : (Completed transaction) Up to 12 characters [0-9] ;
Authorization number : (Authorized transaction) 8 characters [A-Z, 0-9, space].

Management interface

Batch Processing Home Page

If more than one merchant uses batch processing, a list of merchants will be displayed.

FTP Interface

All batches are displayed in reverse chronological order. A batch has either a “Processing” or “Completed” status. If the batch is completed, the response file (the same one that was transferred via FTP) may be downloaded.

On-line Interface

All batches are displayed in reverse chronological order.
A batch has either a “Received”, “Processing”, or “Completed status”.
A batch with a “Received” status may be deleted.
If the batch is completed, the response file may be downloaded.

Downloading the Response File

Click on “Download” to download the response file.

Importing a Batch File via the Web Interface

After selecting the file and clicking “Send”, a confirmation screen displays the file name, batch number and transaction number.

If the import was successful, the Web interface will return the message “Status Received (0) if the file successfully imported”. Otherwise, a 60XX error message is displayed.

Deleting a Batch in the Web Interface

After clicking on “Delete”, a confirmation screen appears, displaying the batch’s details.

Return codes

Batch payment’s return codes (6000) are explained in the document Return Codes

    • Related Articles

    • Endpoint : Close Batch

      Close Batch This transaction is used to close the open batch on a terminal. This transaction is mainly used to trigger a Settlement transaction to our Semi-Integrated terminal. The returnCode will indicate if the batch was in-balance or not. Request ...
    • Recurring Payments (Tokens)

      dit Introduction The recurrent payment module allows to merchant to execute transactions according to criteria established with the client and without the presence of the cardholder. It also allows to automatically making payments at regular ...
    • API Specifications

      Overview To communicate with the Payment API you should submit HTTP POST requests to the corresponding endpoints. There are differ endpoints for Test and Production. The API uses FORM parameters (key-value parameters passed in an HTTP POST URL) for ...
    • Code Example - Java

      JAVA Edit main.java CTPaymentClient restv1Client = new CTPaymentClient("https://test.api.payfacto.com/", "00000000000000000000000000000000000" ); // PURCHASE EXAMPLE HashMap<String, String> params = new HashMap<String, String>(); ...
    • Code Example Microsoft .NET

      Microsoft .NET Edit main.cs PaymentTransaction paymentTransaction = new PaymentTransaction("https://test.api.payfacto.com/v1", "00000000000000000000000000000000000"); String purchaseInput = FillPurchaseInput(); transactionOutput = ...