User Tools

Site Tools


withdrawtocard

This is an old revision of the document!


WithdrawToCard

API for sending funds to customer's cards



Service address

Test web service address (for testing purposes) https://testapi.moneypolo.com:26443/WithdrawToCard.asmx

Real web service address https://api.moneypolo.com:26442/WithdrawToCard.asmx

Please note, that test and prod keys are different from each other. Working key will be issued by MoneyPolo company at the end of the testing period.



Limits

There is minimum/maximum limits for each transaction.

Minimum is 20. 20 is non-refundable amount in case of any error (wrong card number). Example: client provide card number 1234567812345678 and amount 100 USD, if there is errors in card number - system only returns 80 USD.

Maximum is 5000/day per card.



Security

Every transmitted request must be signed by the secret key. Issuance of the key by the company MoneyPolo to the Client is performed at the beginning of testing. The key is changed at the transfer to the production version of the service.



Request format

All the requests to the service are sent by standard tools by means of the SOAP webservice. Each request and response has own signature structure, that commonly looks like list of object fields separated by 2 number signs (hash) - '##'. example: ##Field1##Field2##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!

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



Methods

GetCountryByBIN

The method is applied for getting card information like Country of issue, type and brand.

Request parameters:

Name Type Description
BIN string BIN number (always 6 digits)

Request signature structure:
##BIN##key##

Response parameters:

Name Type Description
BIN string BIN number
Brand string Brand of the card (VISA/MASTER/…)
CountryCode string 2-chars ISO country code
Bank string Bank name - issuer of the card
CardType string Type of the card (DEBIT/CREDIT)
KnownIssues string Known issues with this bank

Response signature structure:
##BIN##Brand##CountryCode##Bank##CardType##key##



WithdrawToRU

The method is applied for sending funds to any card over the world.

Request parameters:

Name Type Description
MerchantDocID string Merchant's transaction ID
Amount decimal(18,2) transaction amount. format: ######.##
Currency string transaction currency ISO code (USD/EUR/RUB) 1
CardNumber string 16 digits number of card that funds go to
SenderFirstName string
SenderLastName string
ReceiverFirstName string
ReceiverLastName string
SenderPhone string sender's phone number in international format +7xxx123456789
SenderDocumentNumber string
SenderDocumentIssueDate string YYYY-MM-DD
SenderDocumentAuthority string
SenderBirthDate date YYYY-MM-DD
SenderAddress string
SenderCitizenship string 2-char country code
SenderCountry string 2-char country code
SenderCity string
AccountID int account to debit or 0. if parameter value is 0 - merchant's account will be debited for this transaction. if parameter is not equal to 0 - must be client account ID, that will be debited.

* 1 RUB possible to withdraw only to cards issued by Russian banks (if it is needed to send another currency, that currency must be exchanged to RUB) USD, EUR possible to withdraw to all other countries banks cards. To cards issued by Ukrainian banks it is possible to withdraw only USD to MasterCard cards.

Request signature structure:
##MerchantDocID##Amount##Currency##CardNumber##SenderFirstName##SenderLastName##ReceiverFirstName##ReceiverLastName##SenderPhone##SenderDocumentNumber##SenderDocumentIssueDate##SenderDocumentAuthority##SenderBirthDate##SenderAddress##SenderCitizenship##SenderCountry##SenderCity##AccountID##key##

Response parameters:

Name Type Description
DocumentID int ID of successfull request
MerchantDocID string Merchant's transaction ID

Response signature structure:
##DocumentID##MerchantDocID##key##



GetStatus

The method is applied for getting transaction status.

Request parameters:

Name Type Description
DocumentID int ID of request
MerchantDocID string Merchant's transaction ID

Request signature structure:
##DocumentID##MerchantDocID##key##

Response parameters:

Name Type Description
MerchantDocID string Merchant's transaction ID
Status string Status of the transaction
ARN string ARN number of the transaction. if provided.
StatusDetail string detail info for rejected transactions

Response signature structure:
##MerchantDocID ##Status##ARN##key##

Status values:

Status Description
STORNED Transaction was cancelled
REJECTED Transaction was rejected by bank
IN PROCESS Transaction is in process state
PROCESSED Transaction was successfully processed
ARCHIVE alias of PROCESSED



GetStatusByMerchantDocumentID

The method is applied for getting successful transaction's status and request ID.

Request parameters:

Name Type Description
MerchantDocID string Merchant's transaction ID

Request signature structure:
##MerchantDocID##key##

Response parameters:

Name Type Description
DocumentID string ID of request
Status string Status of the transaction
ARN string ARN number of the transaction. if provided.
StatusDetail string detail info for rejected transactions

Response signature structure:
##DocumentID##Status##ARN##StatusDetail##

Status values:

Status Description
STORNED Transaction was cancelled
REJECTED Transaction was rejected by bank
IN PROCESS Transaction is in process state
PROCESSED Transaction was successfully processed
ARCHIVE alias of PROCESSED



Error codes

Error code Description
-901 Invalid BIN number
-902 Invalid amount
-903 Invalid Currency
-904 Invalid CardNumber
-905 Invalid CardExpiryYear
-906 Invalid CardExpiryMonth
-907 Invalid SenderFirstName
-908 Invalid SenderLastName
-909 Invalid SenderMiddleName
-910 Invalid SenderPhone
-911 Invalid SenderDocumentNumber
-912 Invalid SenderSecondDocumentType
-913 Invalid SenderSecondDocumentNumber
-914 Invalid MerchantDocID
-915 Error creating request
-916 Unknown BIN number
-917 Invalid card expirity date or card is already expired
-918 Transactions in requested currency is temporary blocked
-919 Invalid BIN (trying to send transaction to one of MP cards)
-920 Unknown card type. Only VISA/MasterCard cards allowed
-921 Invalid DocumentID
-922 Transaction limit exceeded
-923 Invalid ReceiverFirstName
-924 Invalid ReceiverPhone
-925 Invalid BankIssuerSwiftCode
-926 Invalid ReceiverLastName
-927 Invalid SenderDocumentAuthority
-928 Invalid SenderDocumentNumber
-929 Unable to create transaction - partner error. possible immediate reject.
-930 Transaction limit
-931 Invalid SenderAccount
-932 Invalid SenderName
-933 Invalid SenderAddress
-934 Invalid ReceiverAccount
-935 Invalid ReceiverName
-936 Invalid ReceiverAddress
-937 Invalid CurrencyCode
-938 Service is disabled
-939 Invalid AccountID
-940 Invalid AutoPayment
-941 Unsupported country
-942 Unsupported currency. Russian rubles might be sent to Russian issued cards only.
-943 Error creating request. Invalid Sender Account specified.
-944 Error creating request. Request with the same MerchantDocumentID already exists.
-945 Error creating request. Request with the same MerchantDocumentID already processed.
-946 Error creating request. Person is not Verified to make transaction.
-947 Error creating request. Person Account State does not allow operation.
-948 Error creating request. Amount is Less than minimum allowed amount.
-949 Error creating request. Amount is Greater than maximum allowed amount.
-950 Error creating request. Unavailable account balance or misconfiguration.



PHP Examples

<?php
// wtc.connector.php
class WTC
{
    protected $service;
 
    private $algo = 'sha512';
 
    private $merchantCode = 'XXX'; // you code
    private $addr = 'https://testapi.moneypolo.com:26443/WithdrawToCard.asmx?wsdl';
    private $key = 'xxxx'; // your key
 
    public $data = array();
 
    /**
    * Constructs the service
    */
    public function __construct ()
    {
        try
        {
			//DEBUG: array('trace' => 1)
            $this->service = new SoapClient($this->addr, array('trace' => 1));
        }
        catch (Exception $e)
        {
            return $e->getMessage();
        }
    }
 
    /**
    * Provides managment of errors calling the service's methods
    */
    public function __call($name, $arguments)
    {
        $result = false;
        $max_retries = 5;
        $retry_count = 0;
 
        while(!$result && $retry_count < $max_retries)
        {
            try
            {
                $result = parent::__call($name, $arguments);
            }
            catch(SoapFault $fault)
            {
                if($fault->faultstring != 'Could not connect to host')
                {
                    throw $fault;
                }
            }
            sleep(1);
            $retry_count++;
        }
        if ($retry_count == $max_retries)
        {
            throw new SoapFault('Could not connect to host after 5 attempts');
        }
        return $result;
    }
 
    public function Prepare_Data($request)
    {
        $this->data['request'] = array();	
 
		$this->data['request'] = $request;
 
        $this->data['sign']['MerchantCode'] = $this->merchantCode;
 
		//echo '##'.implode('##', $request).'##'.$this->key . '##';
 
        $this->data['sign']['Sign'] = strtoupper(
            hash($this->algo, '##'.implode('##', $request).'##'.$this->key.'##')
        );
        return true;
    }
 
    public function Send($methodName = 'GetServiceTypesList')
    {
		$result = $this->service->{$methodName}($this->data);
		//echo "REQUEST:\n" . htmlspecialchars($this->service->__getLastRequest()) . "\n";
		//echo "RESPONSE:\n" . htmlspecialchars($this->service->__getLastResponse()) . "\n";
        return $result;
    }
}
?>
<?php
$timezone = 'Europe/Prague';
date_default_timezone_set($timezone);
 
require_once ('./wtc.connector.php');
$WTCRequest = new WTC();
 
$request = array();
$request['BIN'] = '516844';
if($WTCRequest->Prepare_Data($request))
{
    $result = $WTCRequest->Send('GetCountryByBIN');
}
 
echo '<h1>Result</h1><pre>';
print_r($result);
echo '</pre>';
withdrawtocard.1513010076.txt.gz · Last modified: 2017/12/11 16:34 by Alexandr Grishin