User Tools

Site Tools


securepayment.api.http

SecurePayment.API.HTTP

HTTP API for SecurePayment 2.0



Description

SecurePayment HTTP API is simplified interface for SOAP webservice SecurePayment.API.SOAP



Service address

Request format

All the requests to the service are sent by standard HTTP POST request. Each request and response has the same signature structure, that consists of MerchantCode, Data (always JSON encoded) and Signature fields separated by 2 number signs (hash) - '##'. example: ##MerchantCode##Data##key##, where the key - is Merchant's secret key.

ATTENTION! Any response of the system may be considered successful only if the object of the response does not contain errors!

Example of building request:

<?php
 
$MerchantCode = 'your merchant code';
$Signature = '';
$DataArray = array('AccountID' => '00000');
$Data = json_encode($DataArray);
 
$sep = '##';
$str = $sep . $MerchantCode;
$str .= $sep . $Data;
$str .= $sep . 'your secret key';
$str .= $sep;
 
$Signature = strtoupper(hash('sha512', $str));
?>
<html>
<head>
    <title>api.getquestions</title>
</head>
<body style="background-color: #fff;">
    <form id="dataForm" method="POST" action="http://testpayment.moneypolo.com/api.showprofile.php">
		MerchantCode: <input name="MerchantCode" type="text" width="200" value="<?php echo $MerchantCode; ?>" /> </br>
		Data: <input name="Data" type="text" width="200" value='<?php echo $Data; ?>' /> </br>
		Signature: <input name="Signature" type="text" width="200" value="<?php echo $Signature; ?>" /> </br>
		<input type="submit" value="Test api.getquestions" />
    </form>
</body>
</html>

* upon request we can provide the fully featured sample for work with the service on php or С#.



Response format

Service always return JSON encoded object, does not matter if it contain just one field or multidimensional list of objects.
In case of any error, service will return error as clear text in format:
ERROR: xxx: zzz
where xxx is error number and zzz is error description.



Methods

OpenAccount

This method’s purpose is to open account in ZetGate. Client’s identification is performed with the help of combination of Email and Mobile phone number.

Request parameters:

Name Type Description
AccountType string reserved for future use. always leave empty.
FirstName string [A-Za-z0-9_\-\.,;:\\\@\/#\$%\&\*\(\)\[\] ]{1,150}
LastName string [A-Za-z0-9_\-\.,;:\\\@\/#\$%\&\*\(\)\[\] ]{1,150}
AddressLine1 string [A-Za-z0-9_\-\.,;:\\\@\/#\$%\&\*\(\)\[\] ]{1,50}
AddressLine2 string [A-Za-z0-9_\-\.,;:\\\@\/#\$%\&\*\(\)\[\] ]{0,50} *optional
City string [A-Za-z0-9_\-\.,;:\\\@\/#\$%\&\*\(\)\[\] ]{1,50}
State string [A-Za-z0-9_\-\.,;:\\\@\/#\$%\&\*\(\)\[\] ]{0,50} optional
CountryCode string [A-Z]{2}
PostalCode string [a-zA-Z0-9 ]{0,50}
Email string [A-Za-z0-9_\-\.@\+]{1,100}
Mobile string +[0-9]{1,20} in international format +xxxxxxxx…
ClientIP string [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
BirthDate string [0-9]{4}-[0-9]{2}-[0-9]{2}

Response parameters:

Name Type Description
AccountID int Opened account ID



ShowClientProfile

Method return KYC questions and handbooks for possible answers, when defined.

Request parameters:

Name Type Description
AccountID int ID of account need to be verified by KYC form

As response method returns current profile status and list of question objects that contains question code, description, type of field, valid answer mask and handbook. If KYC questionnaire was saved before, question object will contain previous answer as well.



SaveClientProfile

Call this method to save KYC questions.

Request parameters:

Name Type Description
AccountID int ID of account need to be verified by KYC form
ProfileData string list of answers in key=value structure, separated by semicolon “;”, where key = code of the question, value = user answer value.

ProfileData - Answers are concatenated into a string in the following format: (<QuestionCode> = <Answer[,Answer1]>;){n} where n - number of answers. A list of questions see in the ShowClientProfile

There are optional questions, they will be filled from documents. There is no need to fill it: DOB (Date of Birth), RADDL1 (Residential Address line 1), RADDL2 (Residential Address line 2), RCITY (Residential City), RSTATE (Residential State), RPCODE (Residential Postcode), RCOUNTRYCODE (Residential Country Code), IDTYPE (ID Type), IDNUM (ID Number), IDDOI (ID Date of Issuance), IDDOX (ID Date of Expiry), IDIA (ID Issuing Authority)

success response parameters:

Name Type Description
ProfileID int Created profile ID



UploadDocument

Call this method to upload scans of client's documents proofing his identity or address.

Request parameters:

Name Type Description
AccountID int ID of account need to be verified by KYC form
FileContent string File content in Base64 encoding. Max length for parameter is - 7 000 000
FileType string File type, see handbook 1 in UWCFSDocumentLoader
DocumentType string Document type, see handbook 2 in UWCFSDocumentLoader
FieldValues string Document field values

FieldValues - Filled document fields are concatenated into a string in the following format: (<field name> = <value of the field>;){n} where n - number of required fields for a particular type of document. A list of fields for each type of document see in the handbook 3 UWCFSDocumentLoader

As a responde method returns positive value DocumentID field in case of success upload.



Sample code

<?php
 
$MerchantCode = 'YOURMERCHANTCODE';
$Signature = '';
$DataArray = array();
$DataArray['AccountType'] = '';
$DataArray['FirstName'] = 'CLIENTFNAME';
$DataArray['LastName'] = 'CLIENTLNAME';
$DataArray['AddressLine1'] = 'CLIENTADDRESS';
$DataArray['AddressLine2'] = 'CLIENTADDRESS2';
$DataArray['City'] = 'CLIENTCITY';
$DataArray['State'] = 'CLIENTSTATE';
$DataArray['CountryCode'] = 'RU';
$DataArray['PostalCode'] = 'CLIENTPOSTALCODE';
$DataArray['Email'] = 'client@email.com';
$DataArray['Mobile'] = '+123456478910';
$DataArray['ClientIP'] = 'CLIENTIP';
$DataArray['BirthDate'] = 'CLIENTBIRTHDATE';
 
$Data = json_encode($DataArray);
 
$sep = '##';
$str = $sep . $MerchantCode;
$str .= $sep . $Data;
$str .= $sep . 'YOURMERCHANTKEY';
$str .= $sep;
 
$Signature = strtoupper(hash('sha512', $str));
?>
<html>
<head>
    <title>Test API.OpenAccount</title>
</head>
<body style="background-color: #fff;">
    <form id="dataForm" method="POST" action="https://payment.moneypolo.com/api.openaccount.php">
		MerchantCode: <input name="MerchantCode" type="text" width="200" value="<?php echo $MerchantCode; ?>" /> </br>
		Data: <input name="Data" type="text" width="200" value='<?php echo $Data; ?>' /> </br>
		Signature: <input name="Signature" type="text" width="200" value="<?php echo $Signature; ?>" /> </br>
		<input type="submit" value="Test API.OpenAccount" />
    </form>
</body>
</html>



Error codes

Error code Description
101 Missing request data. - In most cases you did not pass one of required parameters.
102 Unable to load merchant data. - Something wrong with configuration of your merchant profile, contact technical support.
103 Merchant can not process transactions
104 Wrong signature
105 Internal error. Transaction is logged for further analysis. - contact technical support



securepayment.api.http.txt · Last modified: 2016/09/27 08:39 by Anatolii Zhiliaev