Upload
dinhkhanh
View
219
Download
0
Embed Size (px)
Citation preview
Saferpay Batch Processing Page 2
Contents
1 Introduction ......................................................................................................................................................... 3 1.1 Requirements ...................................................................................................................................................... 3 1.2 Security and PCI DSS ........................................................................................................................................ 3 1.3 Other Information ................................................................................................................................................ 4 1.4 Supported Payment Means ................................................................................................................................ 4 1.5 Format Information ............................................................................................................................................. 4
2 Conventions ........................................................................................................................................................ 5 2.1 File Names ........................................................................................................................................................... 5 2.2 CustomerID ......................................................................................................................................................... 5 2.3 File Identifier (FileID) ........................................................................................................................................... 5 2.4 File Transfer ........................................................................................................................................................ 5 2.5 Input File Format ................................................................................................................................................. 6
3 Input File .............................................................................................................................................................. 7 3.1 Parameters and Descriptions ............................................................................................................................. 7 3.2 Parameter Description ........................................................................................................................................ 9 3.2.1 TERMINALID ........................................................................................................................................................ 9 3.2.2 ORDERID ............................................................................................................................................................. 9 3.2.3 PAN ...................................................................................................................................................................... 9 3.2.4 DOCREDIT ........................................................................................................................................................... 9 3.2.5 TIMEDATE............................................................................................................................................................ 9 3.2.6 Card Security Number......................................................................................................................................... 10 3.2.7 3-D Secure Parameters ECI, XID, CAVV ............................................................................................................ 10 3.2.8 Recurring ............................................................................................................................................................ 10 3.2.9 MANDATEID ....................................................................................................................................................... 10 3.2.10 IBAN ................................................................................................................................................................... 10 3.3 Example for payment record sets .................................................................................................................... 11 3.4 Identifying Duplicate Entries ............................................................................................................................ 11
4 Output file .......................................................................................................................................................... 12 4.1 Processed Record Set ...................................................................................................................................... 12 4.2 Incorrect entry in the output file ...................................................................................................................... 13 4.3 RESULT values .................................................................................................................................................. 14 4.4 Sample output file ............................................................................................................................................. 14 4.5 Output file if Batch Processing is processed automatically .......................................................................... 15
5 Automation ........................................................................................................................................................ 16 5.1 Upload ............................................................................................................................................................... 16 5.2 Download .......................................................................................................................................................... 16
6 Examples ........................................................................................................................................................... 17 6.1 Upload via HTML Form ..................................................................................................................................... 17 6.2 Download via HTML Form ................................................................................................................................ 17 6.3 Upload via Visual Basic Script ......................................................................................................................... 18 6.4 Download via Visual Basic Script .................................................................................................................... 19
7 Contact .............................................................................................................................................................. 20 7.1 Saferpay Integration Team ............................................................................................................................... 20 7.2 Saferpay Support Team .................................................................................................................................... 20
Saferpay Batch Processing Page 3
1 Introduction
This document describes the Saferpay Batch Processing, a service allowing the processing of credit
card and German electronic direct debit (ELV) payments via a batch file.
1.1 Requirements
The following conditions must be fulfilled to use the batch processing:
A corresponding license and with that an existing Saferpay account with login and password
At least one active Saferpay terminal via which payments can be processed. The corresponding TERMINALID respectively the ACCOUNTID must be available.
The format of the Data Set and the name of the input file must correspond to the format described in this document
1.2 Security and PCI DSS
Although the Saferpay system meets the PCI DSS (Payment Card Industry Data Security Standard)
requirements and is inspected regularly to verify compliance, you are encouraged to apply the
following rules when using Saferpay Batch Processing.
When using Saferpay Batch Processing, credit card data is entered in the input file and uploaded from your system to Saferpay. You should ensure that you comply with the security requirements of your card-accepting bank (acquirer) concerning the handling of credit card data.
We recommend you use the Saferpay Secure Card Data Service in combination with Saferpay Batch
Processing in order to significantly reduce the expense for the PCI DSS review of the merchant
system. This service allows you to process transmit and store the credit card data directly in the
secure Saferpay computer centre and no longer on the merchant system. For more information,
please contact the Saferpay technical support team or customer service department.
Processing of the card security number (also called CVC2, CVV2, CID or 4DBC) is optional. Please note, that according to PCI DSS regulation, the card security number is part of the confidential card data that may only be stored temporarily.
Due to PCI DSS regulation the processing of magnetic stripe data is no longer possible via Batch
Processing.
If you have any questions regarding PCI DSS, please contact your acquirer or a qualified security provider (see https://www.pcisecuritystandards.org).
Saferpay Batch Processing Page 4
1.3 Other Information
Please note the following points:
Uploaded files are processed within one day (24 hours) for the card companies.
The Saferpay Batch Processing is designed for not time critical payments and not for online authorizations in real time or seconds.
For time critical authorizations we recommend the use of the Saferpay Client API.
In order to ensure a smooth processing we recommend to process not more than 500 transactions per file.
Since acquires reject non-authorized transactions all transactions are authorized in a first step before being transmitted for further processing.
Please note that the Batch Processing will also trigger the Batch Close for all transactions, once the batch is finished.
1.4 Supported Payment Means
The Saferpay Batch Processing currently allows the processing of transactions for the following payment means:
Visa
MasterCard
American Express
Diners Club
J.C.B.
ELV electronic direct debit (Germany only)
1.5 Format Information
The following abbreviations for format information are used in this document:
a letters (a - z, A - Z)
n numeric characters (0 - 9)
an alphanumeric characters (a - z, A - Z, 0 - 9)
s special characters (:?,-(+‘.)/ and space)
ans alphanumeric and special characters
Saferpay Batch Processing Page 5
2 Conventions
2.1 File Names
The name of the file to be processed starts with the Saferpay CustomerID followed by a dash and the unique file identifier and ends with the file extension ”.IN“.
Syntax:
CustomerID-FileID.IN
2.2 CustomerID
Die CustomerID currently consists of 5 or 6 digits. This could change in the future.
2.3 File Identifier (FileID)
The File identifier has to be unique and is defined as follows:
length: variable 1-40 characters
permitted characters: 0-9, A-Z, a-z, - (dash), _ (underscore)
no distinction is made between uppercase and lowercase
Examples (FileID in italics):
12001-1.IN
12001-002.IN
12001-abcd5523.IN
12001-CA4DD53A-C1BB-4378-A7EB-4AB7AA6729D9.IN
2.4 File Transfer
The files are transferred between the sender and the Saferpay system via a secure SSL connection (https) from the Saferpay Backoffice. An email address can be stored to get a message when the file processing is finished.
Saferpay Batch Processing Page 6
2.5 Input File Format
The information required for uploading is saved in a text file. The following rules are to be respected in this context:
Parameters are separated by a comma (ASCII 0x44)
each line must terminate with a line separator CR or CRLF
Incorrectly formatted lines are rejected with the error code ICCTERR in the output file. It is the responsibility of the sender to correct the format and resubmit the file.
Saferpay Batch Processing Page 7
3 Input File
3.1 Parameters and Descriptions
If not marked as Optional all parameters are mandatory.
Position Parameter Format Description
1 RECORDTYPE an[7] File record type, must always be ICCT100
2 TERMINALID n[8] Saferpay Terminal ID to be used for the transaction.
The Terminal ID is assigned by the Saferpay
system and is part of the Saferpay Account ID
3 ORDERID an[..30] Optional
Sender’s reference number.
Processing-specific restrictions exist (see 3.2.2)
4 PAN ans [..50] Optional
The card number (primary account number), see separate format description (3.2.3) for use of the card reference number via the Secure Card Data service. Cannot used together with IBAN.
For card reference number:
CARDREFID:nnnn
5 EXPMONTH n[..2] Optional, if CARDREFID is set
Card expiry month.
{1, 2, …., 12} or {01, 02,…., 12}
6 EXPYEAR n[2] or n[4] Optional, if CARDREFID is set
Card expiry year.
{00, 01, ….., 11} oder {2000, 2001, ….., 2011}
7 CARDDATA a[1] Optional
A = Card was read by a reader (card number only is read)
M = Card number was entered manually
8 AMOUNT n[..12] Amount in the smallest currency unit. Only digits
(integer) and no decimal points (12,95 1295) are
allowed.
9 CURRENCY a[3] Currency in ISO 4217 code.
(EUR, CHF, USD, ...)
10 AUTHCODE an[..50] Reserved Field
Authorization code: no longer required since now all
transactions are authorized.
11 DOCREDIT n[1] 0 = Debit (amount is charged to the cardholder)
1 = Credit (amount is refunded to the cardholder –
refund not possible for german direct debit)
12 DOAUTHOR n[1] Carry out authorization; Since all transactions are
authorized first before being entered the value must
always be “1”.
Saferpay Batch Processing Page 8
Position Parameter Format Beschreibung
13 TIMEDATE n[12]
n[14]
Date and time of booking with format
YYYYMMDDhhmm or YYYYMMDDhhmmss. If
the seconds (ss) are not entered, Batch
Processing sets ss = 00. TIMEDATE is only
evaluated internally by Batch Processing
14 CVC n[3] or n[4] Optional1
3- or 4-digit card security number, also known as:
CID/4DBC (American Express)
CVC (MasterCard)
CVV2 (Visa)
CAV (JCB)
15 ECI n[1] Optional
Electronic Commerce Indicator
Required to identify 3-D Secure transactions (“Verified by Visa”,” MasterCard SecureCode”, “American Express SafeKey”):
0 = Internet payment without liability shift
1 = 3-D Secure payment with authentication
2 = 3-D Secure payment, card does not
participate in the procedure
16 CAVV ans[28]
Optional
Authentication code for 3-D Secure transaction,
as supplied by Merchant Plug In (MPI)
17 XID ans[28] Optional
ID for 3-D Secure transaction, as supplied by
Merchant Plug In (MPI)
18 RECURRING a[1] Optional
Tagging for recurring transactions.
Possible value is “R” to tag the transaction as
recurring, e.g. for subscription.
19 REFID ans[28] Optional
Transaction identifier ID of the initial payment for
recurring payments.
20 MANDATEID ans[..35] Optional
Mandate reference for German direct debit (ELV)
payments.
21 IBAN an[22] Optional
IBAN for German direct debit (ELV) payments.
Cannot used together with PAN.
1 The acquirer may require the presence of a card security number
Saferpay Batch Processing Page 9
3.2 Parameter Description
3.2.1 TERMINALID
The Saferpay TERMINALID represents a Saferpay terminal. You will find the Saferpay TERMINALID in the Saferpay Backoffice under Administration Accounts. A Saferpay ACCOUNTID consists of the customer ID, dash (-) and TERMINALID; e.g. 99867-94913159, where 99867 is the customer ID and 94913159 the TERMINALID.
3.2.2 ORDERID
The order ID serves to identify payments in order to enable the merchant to assign the transactions to the correct orders at a later time. The ORDERID is forwarded to the card processor (merchant bank) and is generally listed in the merchants settlement note.
Only numbers (ASCII 0x30...0x39), uppercase letters (0x41...0x5A), lowercase letters (0x61...0x7A) and “-“ and “_” (0x2D and 0x5F) are accepted. Correct processing cannot be guaranteed if other characters are transmitted.
The maximum number of digits varies from processor to processor. In most cases 12 digits has proven
to be a good value.
3.2.3 PAN
This field contains the card number, bank details or other identification number for a payment request.
Credit card:
For credit cards, the manually entered card number must be stated. The card expiry date is to be transmitted with the fields EXPMONTH and EXPYEAR. If a card reference number (CARDREFID) is to be processed, the text “CARDREFID:” (complete with colon) must precede the card reference number.
Examples:
Data Value of PAN
Visa credit card
4000 1234 5678 9012 4000123456789012
Card reference number = 680023981 CARDREFID:680023981
3.2.4 DOCREDIT
Specifies whether the customer is to be debited (= 0 for booking) or credited (= 1 for refund). Refunds are only possible for credit card transactions.
3.2.5 TIMEDATE
This field contains the time of booking in the format YYYYMMDDhhmmss (14 digits), where
YYYY = {2000, …, 2999} MM = {01, 02, …, 12} DD = {01, 02, …, 31} hh = {00, 01, …, 24} mm = {00, 01, …, 59} ss = {00, 01,…., 59}
Alternatively the format YYYYMMDDhhmm with 12 digits is also valid and can be used. Internally the Batch Processing then sets the seconds as ss = 00.
Saferpay Batch Processing Page 10
3.2.6 Card Security Number
According to the rules of the credit card organizations, the card security number (CVC, CVV2, CID,
4DBC) is to be kept strictly confidential. You are advised to always respect this concerning security
requirements. For more information please contact your acquirer.
3.2.7 3-D Secure Parameters ECI, XID, CAVV
In Accordance with your acquirer it might be possible to process 3-D Secure payments via the
Saferpay Batch Processing. Such payments are only possible with cards which have previously had
successful ecommerce transactions processed in the merchant’s webshop. In addition to the card
data the 3-D Secure parameters ECI, XID and CAVV of the previous payment are required.
3.2.8 Recurring
With these fields transactions can be tagged with value “R” as recurring payments. The consecutive
payment additionally references to the transaction identifier (ID) of the initial payment by using
parameter REFID. Please contact your acquirer for information if recurring transactions must be
tagged or not
3.2.9 MANDATEID
This field contains the SEPA mandate reference of a German direct debit (ELV) payment..
3.2.10 IBAN
This field contains the International Bank Account Number.
110.0087 © SIX Payment Services
3.3 Example for payment record sets
ICCT100,94913159,TEST1,9451123100000004,12,15,M,1000,EUR,,0,1,20120202165533
ICCT100,94913159,TEST2,9451123100000004,12,15,M,550,EUR,,0,1,20120202165534,442
ICCT100,94913159,TEST3,9451123100000004,12,15,M,105.00,EUR,,0,1,201202021655
ICCT100,94913159,TEST4,4000000000000002,12,2015,M,1050,EUR,,1,1,201202021656
ICCT100,94913159,TEST5,5232000000000017,12,2015,M,1120,EUR,,0,1,201202021500,,1,AA
ABCEkCYQABA314UQJhAAAAAAA=,DmZAXgVCNWAOAQN3AwAFWgN9CQM=
ICCT100,94913159,TEST6,375811111111115,12,10,M,1000,EUR,,0,1,201202021656
ICCT100,94913159,TEST7,CARDREFID:1234567890,02,15,M,670,EUR,,0,1,201202021658
ICCT100,94913159,TEST8,,,M,1009,EUR,,0,1,201202021659,,,,,,MyMandateID,DE779700000
10123456789
Explanation:
Line 1: Authorization and booking.
Line 2: Authorization, booking, card data with card security number.
Line 3: Incorrect, the amount must be entered without a decimal point.
Line 4: Credit (refund to cardholder).
Line 5: MasterCard SecureCode payment with ECI=1, CAVV and XID.
Line 6: Incorrect, card already expired.
Line 7: Booking, card reference number (CARDREFID) is used.
Line 8: Booking, payment by direct debit.
3.4 Identifying Duplicate Entries
The Batch Processing checks the transactions for duplicate entries. If an input transaction has the same values for TERMINALID, ORDERID, PAN, EXPMONTH, EXPYEAR, AMOUNT, CURRENCY, DOCREDIT and TIMEDATE as an already processed transaction, it is identified as a duplicate and returned with the following error text: ”Double Transaction - Transaction in LineNumber x has already been processed.”
To ensure that transactions are distinct at least within one field, TIMEDATE may optionally be stated
down to the second (14 digits, the year always has four digits). If no seconds are stated, File Import
sets the seconds to 00. TIMEDATE is only used internally by the batch import. It is recommended to
assure the distinctness of transactions via the use of a unique timestamp for each transaction.
Saferpay Batch Processing Page 12
4 Output file
For each file uploaded the sender receives an output file with the same file name as the input file but
suffixed with the file ID “.OUT”
Every data record is checked for format correctness. If the format check succeeds the record is
processed and the .out file entry will contain RECORDTYPE “ICCT101”. If the check fails the
corresponding entry will contain RECORDTYPE ”ICCTERR“.
4.1 Processed Record Set
For each processed record set of the input file (ICCT100) the output file contains a corresponding
response record set (ICCT101) with result and transaction identifier.
Position Parameter Format Description
1 RECORDTYPE an[7] Always contains the value ”ICCT101“.
2 TERMINALID n[8] Saferpay terminal ID of the transaction.
3 ORDERID an[..30] Optional
Sender reference number if stated in the input
file.
4 RESULT n[3] = 0 Transaction successful.
≠ 0 Error code.
5 ID ans[50] Transaction ID in Saferpay:
currently limited to max. 50 characters.
6 AUTHCODE an[..50] Optional
Authorization code of the processor.
7 TIMEDATE n[12] Date and time of authorization with format
YYYYMMDDhhmm
8 AUTHRESULT n[2] Optional
Processor reply code; only returned if
RESULT contains the value “65”. The reply
codes may have different meanings,
depending on the processor.
9 MANDATEID ans[..35] Optional
Mandate reference for German direct debit
(ELV) payments..
Saferpay Batch Processing Page 13
4.2 Incorrect entry in the output file
If a data record in the input file fails the format verification check, the output file contains an ICCTERR
message in the corresponding line of the output file.
Position Parameter Format Description
1 RECORDTYPE an[7] Always contains the value “ICCTERR“.
2 TERMINALID n[8] Saferpay Terminal ID of the transaction.
3 ORDERID an[..30] Optional
Sender reference number if stated in the input
file.
4 TIMEDATE n[12] Timestamp of the format check.
Format: YYYYMMDDhhmm
5 FIELDINDEX n[2] Position of the incorrect field in the record of the
input file.
6 FIELDNAME a[…] Name of the incorrect field in the record of the
input file.
7 MESSAGE ans[…] Optional
Additional description.
Sample error entries:
ICCTERR,1445001,test11,201102021612,1,RecordType,Double Transaction -
Transaction in LineNumber 1 has already processed
ICCTERR,1445001,test12,201102021612,13,TimeDate,DateTime length is wrong: 0
ICCTERR,14450001,test13,201102021612,8,Amount,Amount is not numeric 105.00
ICCTERR,14450001,test14,201102021612,2,TerminalID,User has no access for
TerminalId:1445001
ICCTERR,14450001,test15,201102021612,5,ExpMonth,ExpMonth is out of range
ICCTERR,14450001,test16,201102021612,6,ExpYear,Card is expired:1204
ICCTERR,14450001,test17,201102021612,4,CardNumber,7004 - No CardNumber found for
this CardRefId.
ICCTERR,14450001,test18,201102021612,13,TimeDate,DateTime length is wrong: 13
Saferpay Batch Processing Page 14
4.3 RESULT values
A transaction has only been processed successfully when RESULT=0 is returned.
Any different return value for RESULT indicates an error.
Value Message Description
61 Invalid card The card is invalid (plausibility check).
62 Invalid date The expiry date is invalid.
63 Card expired The card has expired; Is no longer valid.
64 Unknown card
The card is unknown; the card could not be assigned
to a card type.
65 Authorization declined The card processor has rejected the transaction. The
AUTHRESULT field contains processor-specific details
explaining the reasons.
67 No contract available There is no active contract for the concerned payment
mean or currency for the terminal.
83 Invalid currency Invalid currency code.
84 Invalid amount The amount is invalid.
104 PAN blacklist Card is blacklisted by Saferpay Risk Management.
105 Card country not
white listed
Card issuer country is not included in the Saferpay
Risk Management white list.
114 CVC mandatory The card security number must be entered
4.4 Sample output file
ICCT101,94913159,TEST1,0,6bf9e707a9e64938b7e4612b2bcb,074869,201102030852
ICCT101,94913159,TEST2,0,9bd5f26175a14cd1bd839dc81fa3,862777,201102030852
ICCTERR,94913159,TEST3,201102030852,8,Amount,Amount is not numeric: 105.00
ICCT101,94913159,TEST4,0,682dab8de6614ae4bb15d83e94bc,,201102030852
ICCT101,94913159,TEST5,0,12d693de415f425a919ba4aea4f3,124865,201102030852
ICCTERR,94913159,TEST6,201102030852,6,ExpYear,Card is expired: 1204
ICCT101,94913159,TEST7,0,96c0fe28e09d40b3b98248a4ac54,395000,201102030852
ICCT101,94913159,TEST8,67,74301cbe-87ca-4e3c-aeb0-3223c9f69210,,201102030852
Explanation:
Line 1: Authorization and booking, successfully processed and stored.
Line 2: Authorization and booking, successfully processed and stored.
Line 3: Transaction rejected by Batch Processing, with error code.
Line 4: Refund (credit), successfully processed.
Line 5: Transaction with reference number, successfully processed.
Line 6: Transaction rejected by Batch Processing, with error code.
Line 7: Authorization and booking with use of CARDREFID, successful.
Line 8: Request rejected, reply code 67 (no contract available).
110.0087 © SIX Payment Services
4.5 Output file if Batch Processing is processed automatically
If Batch Processing is processed automatically via upload or download (cf. chapter 3) an additional
result line appears at the end of the output file.
In case of successful processing the result line looks like:
ResultCode: 200 OK
If the access is not granted because of an invalid user name the message
ResultCode = 401 Unauthorized is returned:
Saferpay Batch Processing Page 16
5 Automation
File Import can be automated via the Saferpay website. Uploading and downloading are SSL encrypted with https.
For the automated use of the Saferpay Batch Processing a login and password are required.
5.1 Upload
The file to be uploaded must be sent to the following Saferpay URL:
https://www.saferpay.com/bo/fileimport/scriptupload
The login data is transferred within hidden fields using the parameters spUsername, spPassword and
UAFState and CustomerID.
Name Wert
spUsername contains the user ID, e.g. e99867001.
spPassword contains the password associated with the user ID
UAFState must always contain the value “login”
CustomerID contains the customerID, e.g. 99867
5.2 Download
Output files can be downloaded from the following Saferpay URL:
https://www.saferpay.com/bo/fileimport/scriptdownload
The login data is transferred within hidden fields using the parameters spUsername, spPassword and
UAFState and CustomerID. The filename is transmitted with the parameter Sequence.
Name Wert
spUsername contains the user ID, e.g. e99867001.
spPassword contains the password associated with the user ID.
UAFState must always contain the value “login”
CustomerID contains the customerID, e.g. 99867.
Sequence contains the filename
According to the PCI DSS security regulations the upload and download files must be
transmitted by POST. The GET method is not permitted!
Saferpay Batch Processing Page 17
6 Examples
6.1 Upload via HTML Form
<html>
<head><title>Upload Example for Saferpay File Import</title></head>
<body>
<h2>Upload Example for Saferpay File Import</h2>
<form enctype="multipart/form-data"
action="https://www.saferpay.com/bo/FileImport/ScriptUpload"
method="POST">
<input type="hidden" name="spUsername" value="xxxxxxxxx">
<input type="hidden" name="spPassword" value="xxxxxxxxx">
<input type="hidden" name="UAFState" value="login">
<input type="hidden" name="CustomerID" value="xxxxxxxxx">
<h3><p>Select file to upload:<br>
<input type="file" size="50"</p></h3>
<input type="submit" value="File Import">
</form>
</body>
</html>
6.2 Download via HTML Form
<html>
<head><title>Download Example for Saferpay File Import</title></head>
<body>
<h2>Download Example for Saferpay File Import</h2>
<form enctype="multipart/form-data"
action="https://www.saferpay.com/bo/FileImport/ScriptDownload"
method="POST">
<input type="hidden" name="spUsername" value="xxxxxxxxx">
<input type="hidden" name="spPassword" value="xxxxxxxxx">
<input type="hidden" name="CustomerID" value="xxxxxxxxx">
<h3><p>file name:<br>
<input type="text" length="30" name="Sequence" value=""></p></h3>
<input type="hidden" name="UAFState" value="login">
<input type="submit" value="Download">
</form>
</body>
</html>
Saferpay Batch Processing Page 18
6.3 Upload via Visual Basic Script
'Upload of file
File = "xxxxxx" :Username = "xxxxxx" : Password = "xxxxxx" : CustomerID _
= "xxxxxx" : UAFState = "login"
'read file data
Set fs = WScript.CreateObject("Scripting.FileSystemObject")
Set rd = fs.OpenTextFile(File) : Content = ""
do while rd.AtEndOfStream <> true: Content = Content & rd.ReadLine &_
vbCrLf : loop
rd.Close
'URL to Server
URL = "https://www.saferpay.com/bo/FileImport/ScriptUpload"
'needed for file upload
Boundary = "-----------------------------xaHbfgeHJ65Jk7"
ScriptBoundary = "--" & Boundary
Set http = WScript.CreateObject("Microsoft.XMLHTTP")
http.open "POST", URL, false
http.setRequestHeader "Content-Type", "multipart/form-data; boundary=" &_
Boundary
'send file content within boundary
PostFieldsBody = ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""spUsername"""& vbCrLf &_
vbCrLf & Username & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""spPassword"""& vbCrLf &_
vbCrLf & Password & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""CustomerId"""& vbCrLf &_
vbCrLf & CustomerID & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""UAFState"""& vbCrLf &_
vbCrLf & UAFState & vbCrLf & ScriptBoundary
PostFileBody = vbCrLf & _
"Content-Disposition: form-data; name=""f1""; filename=""" & File &_
"""" & vbCrLf & "Content-Type: text/plain" & vbCrLf & vbCrLf & _
Content & ScriptBoundary & "--" & vbCrLf
http.send PostFieldsBody & PostFileBody
'wait until http received all data
do while http.readyState <> 4 : DoEvents : loop
'clean objects
Set rd = nothing
Set fs = nothing
Set http = nothing
Saferpay Batch Processing Page 19
6.4 Download via Visual Basic Script
'download of file number
FileNr = "xxxxxx" : Path = "xxxxxx" : Username = "xxxxxx" : Password =_
"xxxxxx" : CustomerID = "xxxxxx" : UAFState = "login"
'prepare url for download incl. login
URL = "https://www.saferpay.com/bo/FileImport/ScriptDownload"
'download file content
Boundary = "-----------------------------xaHbfgeHJ65Jk7"
ScriptBoundary = "--" & Boundary
Set http = WScript.CreateObject("Microsoft.XMLHTTP")
http.open "POST", URL, false
http.setRequestHeader "Content-Type", "multipart/form-data; boundary=" &_
Boundary
'send file content within boundary
PostFieldsBody = ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""spUsername"""& vbCrLf &_
vbCrLf & Username & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""spPassword"""& vbCrLf &_
vbCrLf & Password & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""CustomerId"""& vbCrLf &_
vbCrLf & CustomerID & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""UAFState"""& vbCrLf & vbCrLf &_
UAFState & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""Sequence"""& vbCrLf & vbCrLf &_
FileNr & vbCrLf & ScriptBoundary & vbCrLf &_
"Content-Disposition: form-data; name=""Path"""& vbCrLf & vbCrLf &_
Path & vbCrLf & ScriptBoundary
http.send PostFieldsBody
'wait until http received all data
do while http.readyState <> 4: DoEvents: loop
'write content to file
Set fs = WScript.CreateObject("Scripting.FileSystemObject")
Set wr = fs.CreateTextFile(Path & CustomerID & "-" & FileNr &".out")
wr.Write http.ResponseText
wr.Close
'clean objects
Set wr = nothing
Set fs = nothing
Set http = nothing
Saferpay Batch Processing Page 20
7 Contact
7.1 Saferpay Integration Team
Do you have questions about this document or problems with the integration of Saferpay or do you
need assistance? Then please contact our integration team:
Saferpay Switzerland
SIX Payment Services AG
Hardturmstrasse 201
8021 Zürich
+41 848 66 44 44
www.six-payment-services.com/saferpay
Saferpay Europe
SIX Payment Services (Germany) GmbH
Langenhorner Chaussee 92-94
22415 Hamburg
+49 40 325 967- 280
www.six-payment-services.com/saferpay
7.2 Saferpay Support Team
Do you have questions about error messages or do you encounter problems with your running
system? Then please contact our support team:
Saferpay Switzerland
SIX Payment Services AG
Hardturmstrasse 201
8021 Zürich
+41 848 66 44 44
www.six-payment-services.com/saferpay
[email protected]@six-payment-services.com
Saferpay Europe
SIX Payment Services (Germany) GmbH
Langenhorner Chaussee 92-94
22415 Hamburg
+49 40 325 967- 250
www.six-payment-services.com/saferpay
[email protected]@six-payment-services.com
The Saferpay team wishes you every success with your Saferpay e-payment solution!