ePages 7.48.0 - DE_EPAGES/SIA/API/Registration/SFTPHandler.pm

Package DE_EPAGES::SIA::API::Registration::SFTPHandler

Class used to handle format of file based communication with SIA.

Functions

BUILD
DEMOLISH
addDataToUploadFile
createRegistrationFile
deleteFile
deleteFilesFromSIA
downloadFilesFromSIA
existsRemoteFile
uploadFile

BUILD

Called by Moose after constructor. Creates a temporary folder for upload/download.

Syntax
BUILD;

DEMOLISH

Moose destructor. Deletes the temporary folder used for upload/download.

Syntax
DEMOLISH;

addDataToUploadFile

Adds MerchantData to the upload file to register a merchant with SIA.

Syntax
$PaymentMethod->addDataToUploadFile;
Input
$PaymentMethod (object)
payment method
Return
$isDataAdded (boolean)
$isDataAdded

createRegistrationFile

creates the registration file with header for upload

Syntax
$SFTPHandler->createRegistrationFile();

deleteFile

delete remote file

Syntax
$SFTPHandler->deleteFile();

deleteFilesFromSIA

Deletes all the given filenames from the SIA FTP server.

Syntax
$SFTPHandler->deleteFilesFromSIA(\@FileNamesToDelete);
Example
$SFTPHandler->deleteFilesFromSIA(qw (foo.txt bar.txt baz.txt));

downloadFilesFromSIA

Downloads the response files from the SIA FTP server (configured in SIAConfig).

Syntax
$SFTPHandler->downloadFilesFromSIA();
Return
(str)
Absolute path of the temporary directory where the response files were
downloaded to.

existsRemoteFile

checks if remote file exists

Syntax
$SFTPHandler->existsRemoteFile();
Return
remoteFileExists (boolean)
remote file exists on ftp

uploadFile

uploads file which was created at the begining to ftp server configured in sia config

Syntax
$SFTPHandler->uploadFile();