BankStore XML Integration

  1. Introduction
  2. Cobros mediante Operativa DCC
  3. BANKSTORE XML Integration
    1. Execution of user registration in the system
    2. User Information
    3. User removal
    4. Execution of Charges to a user in the system
    5. Execution of Charges to a user in the system with DCC
    6. Confirmación de moneda en pago DCC
    7. Refund to User in the system
    8. Execution of subscription registration in the system
    9. Editing a subscription in the system
    10. Subscription removal
    11. Execution of subscription registration in the system with USERID and TOKENID
    12. Creating a user preauthorization in the system
    13. Confirmation of a user preauthorization in the system
    14. Cancelation of a user preauthorization in the system
    15. Confirmation of a user defered preauthorization in the system
    16. Cancelation of a user defered preauthorization in the system
    17. Execution of a user registration in the system by Token
    18. Execution of Charges to a user by Reference
  4. Card Expiration Notification
    1. Notification (Request to URL)
  5. APPENDIX I – Business signature calculation
  6. APPENDIX II – OPERATION TYPES

Introduction

The aim of this document is to serve as a reference during the integration process of a business with the PAYCOMET payment gateway, using the system BankStore that stores bank details of the customers of the business.

By using this option, the client accepts the requirement to submit quarterly SAQ-AEP and get ASV scans.

It also includes a reference Appendix and a document, including the error codes returned by the system to simplify the debugging process, is available on the website of PAYCOMET.

The IFRAME/XML integration through the BankStore service allows access to payment transactions without direct user intervention, extending the operation of individual payment to the management of the bank details of the customer of the business. The requests originate at the server of the business and are processed by the payment gateway.

The technology chosen for carrying out operations is SOAP, XML-based and allows safe passage through firewalls and through the network, in addition to IFRAME to capture card data.

The BankStore service is differentiated by its communication between the business and the gateway combining information on customer data. The business stores personal data of its customer and PAYCOMET the bank details. Once the business registers the user, PAYCOMET returns an identifier formed by a unique customer number (IDUSER) and a token (TOKENUSER).

In this way the business has a common identifier with PAYCOMET to perform operations on your customer account such as:

  • User Registration (add_user)
  • User Info (info_user)
  • User Removal (remove_user)
  • User Purchase (execute_purchase)
  • User Purchase with DCC (execute_purchase_dcc)
  • Purchase confirmation with DCC (confirm_purchase_dcc)

The subscription operation has been added in the same service. This operation is completely parallel to that of storage of bank details of the customer. The management of subscriptions will be carried out with the following functions:

  • Subscription registration (create_subscription)
  • Editing a subscription (edit_subscription)
  • Subscription removal (remove_subscription)

Also, operations related to preauthorizations are also present through the functions:

  • Preauthorization registration (create_preauthorization)
  • Preauthorization confirmation (preauthorization_confirm)
  • Preauthorization cancellation (preauthorization_cancel)

In this way, two concepts are divided into the same service and it is necessary to clarify their purpose and differences:

BankStoreBankStore Subscripción
Storage of bank details of the customer of the business Subscription management with storage of bank details of the customer of the business
Ideal for businesses with usual purchases from the same customer without having to re-enter card data Ideal for subscriptions to a service or installment payments. Important: PAYCOMET will not be responsible for billing denials that might occur in installments.
Refunds can be made via XML SOAP Refunds must be made from the Control Panel
The subscription registration can be made by XML SOAP or POS WEB (IFRAME or FULLSCREEN). The subscription registration can be made by XML SOAP or POS WEB (IFRAME or FULLSCREEN).

Cobros mediante Operativa DCC

PAYCOMET allows transactions to be carried out through BankStore operations, in DCC modality (Dynamic Currency Conversion).

Dynamic Currency Conversion (DCC) converts international purchases with Visa® and MasterCard® credit cards into the local currency of the cardholder. Part of the conversion charge will be refunded to the business. PAYCOMET administrates the full conversion process; from the direct exchange rates of the treasury and processing of transactions, to conciliation of deferred payments, liquidation, financing and support.

With DCC, international clients will know the exact total of the purchase in their local currency. Conversion rates are generally much more competitive than those of exchange companies.

This operation must be activated before use. Contact us to register for the desired product.

DCC integration differs from conventional integration due to the use of a specific service for carrying out the client payment. The services dedicated to DCC are:

  • User Purchase with DCC
  • Purchase confirmation with DCC

The user registration procedure: add_user, continues to be necessary in the case of purchases without 3D Secure. The main difference is the incorporation of an additional step for receiving the available exchange of the native currency of the card at the time of the transaction:

BANKSTORE XML Integration

Since the entire payment process is performed in the background (server to server) the changes to be performed in the business are totally unrelated to the user experience.

The technology used for the operation with the PAYCOMET payment gateway is SOAP, based on HTTPS to prevent transportation problems through firewalls and other devices while ensuring the safety of operations. There is extensive support for carrying out SOAP requests for the major programming languages used in web environments.

The requests are made through the HTTPS transport protocol, so you must ensure that your system is capable of correctly performing requests and managing security certificates returned by the platform to ensure proper use.

There are several operations that can be launched from the same service. The available operations are described below.

Execution of user registration in the system

Function: (add_user)

By using this option, the client accepts the requirement to submit quarterly SAQ-AEP and get ASV scans.

The variables required to register a user with their bank details are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_MERCHANT_PAN [0-9]{16,19} Mandatory. Card number, without any spaces or dashes
DS_MERCHANT_EXPIRYDATE [0-9]{4} Mandatory. Expiry date of the card, expressed as “mmyy” (two-digits for the month and two-digits for the year)
DS_MERCHANT_CVV2 [0-9]{3,4} Mandatory. CVC2 Code of the card
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_IDUSER [0-9]{1,13} Unique identifier of the user registered in the system. It will come back empty in the case of error.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Token code associated with the DS_IDUSER.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the field DS_IDUSER and DS_TOKEN_USER which shall be stored by the business, associating it to the account of their customer, to subsequently make charges on their credit/debit card.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:add_user xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_MERCHANT_PAN type="xsd:string"> 1234 5678 9012 3456  </DS_MERCHANT_PAN>
        <DS_MERCHANT_EXPIRYDATE type="xsd:string"> 0535  </DS_MERCHANT_EXPIRYDATE>
        <DS_MERCHANT_CVV2 type="xsd:string"> 123  </DS_MERCHANT_CVV2>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_CARDHOLDERNAME type="xsd:string"> Francisco y Meta  </DS_MERCHANT_CARDHOLDERNAME>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function addUser()
{
    $endPoint     = "https:secure.paytpv.com/gateway/xml-bankstore?wsdl";
    $merchantCode = "123456";
    $terminal     = "1234";
    $password     = "yourpasswd";

    $signature = sha1(
        $merchantCode
        . $token
        . $jetID
        . $terminal
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];

    try {
        $clientSOAP = new SoapClient($endPoint);

        $addUserResponse
            = $clientSOAP->add_user(
                $merchantCode,
                $terminal,
                $merchantPan,
                $merchantExpiryDate,
                $mtrchantCVV2,
                $signature,
                $ip
            );

        if ($addUserResponse["DS_RESPONSE"] == "1") {
             OK
            return true;
        } else {
            KO
            var_dump($addUserResponse["DS_ERROR_ID"]);
            return false;
        }
    } catch (SoapFault $e) {
        var_dump($e);
    }
}

public ServiceResponse add_user(String[] args) throws Exception {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String pan = args[4];
    String expirydate = args[5];
    String cvv2 = args[6];
    String cardholdername = args[7];
    String expirydate = args[8];

    merchantsignature = makeSHA1hash(merchantcode + pan + cvv2 + terminal + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("add_user");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_MERCHANT_PAN", pan);
    soapReq.addProperty("DS_MERCHANT_EXPIRYDATE", expirydate);
    soapReq.addProperty("DS_MERCHANT_CVV2", cvv2);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_CARDHOLDERNAME", cardholdername);

    return callSoap(result, soapReq);

}

User Information

Function: (info_user)

This function will be used to confirm to the customers of the business which card will be used to make the payment. This step is optional but it is convenient to avoid mistrust.

The variables required to request information from a user are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_PAN [0-9]{16,19} Card number, without any spaces or dashes. Only the last four digits will be returned. The rest will be masked with X.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.
DS_CARD_BRAND [a-zA-Z]{30} Card brand. If it can be identified, information on the card brand will be sent (Visa, MasterCard, American Express, etc). Otherwise, the field will be returned blank.
DS_CARD_TYPE [a-zA-Z]{20} Type of card. If it can be identified, information on the type of card will be sent (DEBIT, CREDIT, etc). Otherwise, the field will be returned blank.
DS_CARD_I_COUNTRY_ISO3 [a-zA-Z]{3} ISO3 Code the country of the issuer of the card. If it can be identified, the ISO3 Code of the country of the issuer of the card will be sent. Otherwise, the field will be returned blank.
DS_EXPIRYDATE [YYYY/MM] Expiry date of the card expressed in the format YYYY/MM
DS_CARD_HASH [a-zA-Z0-9]{64} Hash unique credit card id
DS_CARD_CATEGORY [a-zA-Z0-9]{16} Card category

If the request generates an error of some kind (incorrect signature, user not found, etc) all fields will be delivered empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the field DS_MERCHANT_PAN which will contain the credit/debit card masked, leaving visible only the last 4 digits. This operation is very useful to show the customer of the business the card with which the transaction will be made.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:info_user xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function infoUser()
{
    $endPoint = "https:secure.paytpv.com/gateway/xml-bankstore?wsdl";
    $merchantCode = "123456";
    $terminal = "1234";
    $password = "yourpasswd";

    $signature = sha1(
        $merchantCode
        . $token
        . $jetID
        . $terminal
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];

    try {
        $clientSOAP = new SoapClient($endPoint);

        $addUserResponse = $clientSOAP->add_user(
            $merchantCode,
            $terminal,
            $merchantPan,
            $merchantExpiryDate,
            $mtrchantCVV2,
            $signature,
            $ip
        );

        if ($addUserResponse["DS_RESPONSE"] == "1") {
             OK
            $infoUser = $clientSOAP->info_user(
                $merchantCode,
                $terminal,
                $addUserResponse["DS_IDUSER"],
                $addUserResponse["DS_USER_TOKEN"],
                $signature,
                $ip
            );
            var_dump($infoUser);
            return true;
        } else {
            KO
            var_dump($addUserResponse["DS_ERROR_ID"]);
            return false;
        }
    } catch (SoapFault $e) {
        var_dump($e);
    }
}


        
public ServiceResponse info_user(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("info_user");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

User removal

Function: (remove_user)

This function will be used for removing a user from the account of the business.

The variables required to request removal of a user are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, user not found, etc) all fields will be delivered empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the field DS_RESPONSE the value of which will be 0 or empty in case of error and 1 in case of successful removal.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:remove_user xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


function removeUser(
    $idpayuser,
    $tokenpayuser
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->remove_user(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $signature,
            $ip
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse remove_user(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("remove_user");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Execution of Charges to a user in the system

Function: (execute_purchase)

Once the user is registered in the system, charges may be made to their account by sending their credentials and data of the operation.

The variables required for making a charge to a user registered in the system are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_AMOUNT [0-9]{1,8} Mandatory. Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Mandatory. Reference of the operation. Must be unique on every valid transaction.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Mandatory. Currency of the transaction. See more information in CURRENCY CODES
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)
DS_MERCHANT_PRODUCTDESCRIPTION [a-zA-Z0-9]{40} Optional. Description of the product
DS_MERCHANT_OWNER [a-zA-Z0-9]{40} Optional. Description of the transaction
DS_MERCHANT_SCORING [0-100] Optional. Valor de scoring de riesgo de la transacción. Entre 0 y 100.

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in MONEDAS
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authorization bank code of the transaction (required to execute a return).
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, user not found, etc) all fields will be delivered empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the field DS_RESPONSE the value of which will be 0 or empty in case of error and 1 in case of successful removal.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:execute_purchase xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_CURRENCY type="xsd:string"> EUR </DS_MERCHANT_CURRENCY>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_PRODUCTDESCRIPTION type="xsd:string"> Product description </DS_MERCHANT_PRODUCTDESCRIPTION>
        <DS_MERCHANT_OWNER type="xsd:string"> Card Owner  </DS_MERCHANT_OWNER>
        <DS_MERCHANT_SCORING" type="xsd:integer>
        <DS_MERCHANT_DATA type="xsd:string"> Comerce Data </DS_MERCHANT_DATA>
        <DS_MERCHANT_MERCHANTDESCRIPTOR type="xsd:string"> Commerce descriptor </DS_MERCHANT_MERCHANTDESCRIPTOR>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function executePurchase(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference,
    $currency,
    $productdescription,
    $owner,
    $scoring = null,
    $merchant_data = null,
    $merchant_description = null
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $amount
        . $transreference
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->execute_purchase(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $currency,
            $signature,
            $ip,
            $productdescription,
            $owner,
            $scoring,
            $merchant_data,
            $merchant_description
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse execute_purchase(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String amount = args[6];
    String orderid = args[7];
    String currency = args[8];
    String productdescription = args[9];
    String cardholder = args[10];
    String scoring = args[11];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + amount + orderid + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("execute_purchase");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", amount);
    soapReq.addProperty("DS_MERCHANT_ORDER", orderid);
    soapReq.addProperty("DS_MERCHANT_CURRENCY", currency);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_PRODUCTDESCRIPTION", productdescription);
    soapReq.addProperty("DS_MERCHANT_OWNER", cardholder);
    soapReq.addProperty("DS_MERCHANT_SCORING", scoring);

    return callSoap(result, soapReq);
}

Execution of Charges to a user in the system with DCC

Function: (execute_purchase_dcc)

Once the user is registered on the system, they can make payments with their account by sending their credentials and operation information. The DCC caseload requires that a payment process is carried out in two steps: execute_purchase_dcc, where the native currency of the card is received (in the case of the card having the same currency as the product associated with the transaction, the result will be a 1:1 conversion) and will be subsequently confirmed with the confirm_purchase_dcc method with the selected currency and the original session of the transaction.

The variables that the service requires for carrying out a DCC payment for a user registered in the system are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_AMOUNT [0-9]{1,8} Mandatory. Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Mandatory. Reference of the operation. Must be unique on every valid transaction.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the application of the business
DS_MERCHANT_PRODUCTDESCRIPTION [a-zA-Z0-9]{40} Optional. Description of the product
DS_MERCHANT_OWNER [a-zA-Z0-9]{40} Optional. Description of the transaction

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Transaction currency. It will always be the same as the original product.
DS_MERCHANT_DCC_SESSION [a-zA-Z0-9]{1,40} Session var for later confirmation of the authorization. This value must be stored to confirm payment in the currency chosen by the end user.
DS_MERCHANT_DCC_CURRENCY [EUR][USD][GBP][JPY] Native currency of the customer's card.
DS_MERCHANT_DCC_CURRENCYISO3 [0-9]{1,3} Native currency of the customer's card in ISO3
DS_MERCHANT_DCC_CURRENCYNAME [A-Za-z0-9]{1,20} Literal currency in string. If the native currency is the same as the product PAYCOMET, este campo vendrá con valor 0.
DS_MERCHANT_DCC_EXCHANGE [0-9]*\.?[0-9]* Currency exchange rate. Return string but it will come in format float.
DS_MERCHANT_DCC_AMOUNT [0-9]{1,8} Amount of the operation in whole format. 1,00 EURO = 100, 4,50 EUROS = 450...
DS_MERCHANT_DCC_MARKUP [0-9]*\.?[0-9]* Percentage value in float of DCC margin applied by the financial institution. Por ejemplo: 0.03 será un 3%
DS_MERCHANT_DCC_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain).
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

In case of the transaction being correct, the service will restore all fields. In this case the DS_ERROR_ID field will be restored empty. The information to save for the confirmation of the operation is the DS_MERCHANT_DCC_SESSION which is a unique transaction identifier linking the purchase operation initiated on DCC. In the following step the currency must be confirmed for finalising the transaction and linking to the DCC session.

DCC payment is not fully available in test environment. This function will make the payment directly and it won't return a dcc session id.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:execute_purchase_dcc xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_PRODUCTDESCRIPTION type="xsd:string"> Product description </DS_MERCHANT_PRODUCTDESCRIPTION>
        <DS_MERCHANT_OWNER type="xsd:string"> Card Owner  </DS_MERCHANT_OWNER>
        <DS_MERCHANT_MERCHANTDESCRIPTOR type="xsd:string"> Commerce descriptor </DS_MERCHANT_MERCHANTDESCRIPTOR>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function executePurchaseDcc(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference,
    $productdescription = false,
    $owner = false,
    $merchant_description = null
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $amount
        . $transreference
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->execute_purchase_dcc(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $signature,
            $ip,
            $productdescription,
            $owner,
            $merchant_description
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}
       
public ServiceResponse execute_purchase_dcc(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String amount = args[6];
    String orderid = args[7];
    String productdescription = args[8];
    String cardholder = args[9];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + amount + orderid + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("execute_purchase_dcc");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", amount);
    soapReq.addProperty("DS_MERCHANT_ORDER", orderid);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_PRODUCTDESCRIPTION", productdescription);
    soapReq.addProperty("DS_MERCHANT_OWNER", cardholder);

    return callSoap(result, soapReq);
}

Confirmación de moneda en pago DCC

Function: (confirm_purchase_dcc)

Once the DS_MERCHANT_DCC_SESSION parameter has been restored when a DCC purchase has been made, the state of the transaction will be “waiting” for the currency confirmation. The business must suggest to the client the currency in which they wish to pay (showing the conversion in real time) and when it is selected, the business must confirm the authorisation with the currency selected by the end user.

(example of interaction with the end user)

The variables required for confirming a DCC operation on the system are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Mandatory. Reference original operation.
DS_MERCHANT_DCC_CURRENCY [EUR][USD][GBP][JPY][...] Mandatory. The chosen currency transaction. It may be the product PAYCOMET native or by the end user selected. The amount will be sent in execute_purchase_dcc if it is the same product and become if different.
DS_MERCHANT_DCC_SESSION [a-zA-Z0-9]{1,40} Mandatory. Sent in the same session process execute_purchase_dcc.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY][...] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authorization bank code of the transaction (required to execute a return).
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} On error, here come the error code generated. If not exits will be 0 or empty in case of error and 1 in case of successful removalerror vendrá 0 o vacío. Los códigos de error vienen especificados en el apartado: CÓDIGOS DE ERROR.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

In case of the transaction being correct, the service will restore all fields (except DS_MERCHANT_CARDCOUNTRY which is optional) which must be stored by the business in case of a possible refund. In this case the field DS_ERROR_ID will be restored with the value 0.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:confirm_purchase_dcc xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_DCC_CURRENCY type="xsd:string"> EUR </DS_MERCHANT_DCC_CURRENCY>
        <DS_MERCHANT_DCC_SESSION type="xsd:string"> dccsession  </DS_MERCHANT_DCC_SESSION>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function confirmPurchaseDcc(
    $transreference,
    $dcccurrency,
    $dccsession
) {
    $signature = sha1(
        $merchantCode
        . $terminal
        . $transreference
        . $dcccurrency
        . $dccsession
        . $password
    );
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->confirm_purchase_dcc(
            $merchantCode,
            $terminal,
            $transreference,
            $dcccurrency,
            $dccsession,
            $signature
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse confirm_purchase_dcc(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String ipaddr = args[2];
    String orderid = args[3];
    String dcccurrency = args[4];
    String dccsession = args[5];

    merchantsignature = makeSHA1hash(merchantcode + terminal + orderid + dcccurrency + dccsession);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("confirm_purchase_dcc");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_MERCHANT_ORDER", orderid);
    soapReq.addProperty("DS_MERCHANT_DCC_CURRENCY", dcccurrency);
    soapReq.addProperty("DS_MERCHANT_DCC_SESSION", dccsession);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);

    return callSoap(result, soapReq);
}

Refund to User in the system

Function: (execute_refund)

By means of this function, refunds of the operations performed may be made. The user identification data and the bank authorization code will be necessary.

The variables required for making a refund of an operation are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Mandatory. Original bank code of the authorization of the transaction
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Mandatory. Original reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Mandatory. Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the application of the business
DS_MERCHANT_AMOUNT [0-9]{1,8} Optional. For partial refunds. Amount to be refunded in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authentication bank code of the transaction.
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return all fields. In this case the field DS_ERROR_ID will be returned empty. The service will return the field DS_RESPONSE the value of which will be 0 or empty in case of error and 1 in case of successful refund.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:execute_refund xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AUTHCODE type="xsd:string"> merchantauthcode </DS_MERCHANT_AUTHCODE>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_CURRENCY type="xsd:string"> EUR </DS_MERCHANT_CURRENCY>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_MERCHANTDESCRIPTOR type="xsd:string"> Commerce descriptor </DS_MERCHANT_MERCHANTDESCRIPTOR>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function executeRefund(
    $idpayuser,
    $tokenpayuser,
    $transreference,
    $currency,
    $authcode,
    $amount = null,
    $merchant_description = null
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $authcode
        . $transreference
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->execute_refund(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $authcode,
            $transreference,
            $currency,
            $signature,
            $ip,
            $amount,
            $merchant_description
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse execute_refund(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String orderid = args[6];
    String currency = args[7];
    String authcode = args[8];
    String amount = args[9];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + authcode + orderid + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("execute_refund");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AUTHCODE", authcode);
    soapReq.addProperty("DS_MERCHANT_ORDER", orderid);
    soapReq.addProperty("DS_MERCHANT_CURRENCY", currency);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", amount);

    return callSoap(result, soapReq);
}

Execution of subscription registration in the system

Function: (create_subscription)

The registration of a subscription implies the registration of a user in the BankStore system of PAYCOMET. This process is completely independent from the isolated charge to a customer of the business.

The variables required for registering a user with subscription are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_MERCHANT_PAN [0-9]{16,19} Mandatory. Card number, without any spaces or dashes
DS_MERCHANT_EXPIRYDATE [0-9]{4} Mandatory. Expiry date of the card, expressed as “mmyy” (two-digits for the month and two-digits for the year)
DS_MERCHANT_CVV2 [0-9]{3,4} Mandatory. CVC2 Code of the card
DS_SUBSCRIPTION_STARTDATE [YYYY-MM-DD] Mandatory. Subscription start date. If the value is empty the date is the same day of registration.
DS_SUBSCRIPTION_ENDDATE [YYYY-MM-DD] Mandatory. Subscription end date. It may not be later than the Subscription start date + 5 years.
DS_SUBSCRIPTION_ORDER [A-Za-z0-9]{1,20} Mandatory. First characters of the reference of the operation. IMPORTANT: Do not include the characters “[“ o “]”, they will be used to recognize the user of the business.
DS_SUBSCRIPTION_PERIODICITY [0-9]{3} Mandatory. Frequency of collection from the start date. The number expresses Days. It may not be greater than 365 days.
DS_SUBSCRIPTION_AMOUNT [0-9]{1,8} Mandatory. Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_SUBSCRIPTION_CURRENCY [EUR][USD][GBP][JPY] Mandatory. Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)
DS_MERCHANT_SCORING [0-100] Optional. Valor de scoring de riesgo de la transacción. Entre 0 y 100.

Example:

DS_SUBSCRIPTION_ORDER = Luis_3268314

The charge of the subscription to DS_IDUSER 32 on December 23, 2030 the system will return it as DS_SUBSCRIPTION_ORDER:

DS_SUBSCRIPTION_ORDER = Luis_3268314[23]20301223

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_IDUSER [0-9]{1,13} Unique identifier of the user registered in the system. It will come back empty in the case of error.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Token code associated with the DS_IDUSER.
DS_SUBSCRIPTION_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_SUBSCRIPTION_ORDER [A-Za-z0-9]{1,20} Original reference of the operation + [DS_IDUSER] + date of the transaction in format YYYYMMDD.
DS_SUBSCRIPTION_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authentication bank code of the transaction.
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the fields DS_IDUSER and DS_TOKEN_USER which shall be stored by the business, associating it to the account of their customer, to later modify the subscription or cancel the subscription.

If the execution of the first installment is successful the system will return all the fields except DS_ERROR_ID which will be left empty.

If the execution of the first installment has an error for several reasons (balance, validity of the card, etc...), the subscription will be canceled having to create a new subscription. In this case only DS_ERROR_ID will be returned with the specific error code.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:create_subscription xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_MERCHANT_PAN type="xsd:string"> 1234 5678 9012 3456  </DS_MERCHANT_PAN>
        <DS_MERCHANT_EXPIRYDATE type="xsd:string"> 0535  </DS_MERCHANT_EXPIRYDATE>
        <DS_MERCHANT_CVV2 type="xsd:string"> 123  </DS_MERCHANT_CVV2>
        <DS_SUBSCRIPTION_STARTDATE type="xsd:string"> 2034-05-21 </DS_SUBSCRIPTION_STARTDATE>
        <DS_SUBSCRIPTION_ENDDATE type="xsd:string"> 2035-06-25 </DS_SUBSCRIPTION_ENDDATE>
        <DS_SUBSCRIPTION_ORDER type="xsd:string"> subscritionorder </DS_SUBSCRIPTION_ORDER>
        <DS_SUBSCRIPTION_PERIODICITY type="xsd:string"> 15 </DS_SUBSCRIPTION_PERIODICITY>
        <DS_SUBSCRIPTION_AMOUNT type="xsd:string"> 1234 </DS_SUBSCRIPTION_AMOUNT>
        <DS_SUBSCRIPTION_CURRENCY type="xsd:string"> EUR </DS_SUBSCRIPTION_CURRENCY>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_EXECUTE" type="xsd:integer>
        <DS_MERCHANT_CARDHOLDERNAME type="xsd:string"> Francisco y Meta  </DS_MERCHANT_CARDHOLDERNAME>
        <DS_MERCHANT_SCORING" type="xsd:integer>
        <DS_MERCHANT_DATA type="xsd:string"> Comerce Data </DS_MERCHANT_DATA>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function createSubscription(
    $pan,
    $expdate,
    $cvv,
    $startdate,
    $enddate,
    $transreference,
    $periodicity,
    $amount,
    $currency,
    $ownerName = null,
    $scoring = null,
    $merchant_data = null
) {
    $pan = preg_replace(
        '/\s+/',
        '',
        $pan
    );
    $expdate = preg_replace(
        '/\s+/',
        '',
        $expdate
    );
    $cvv = preg_replace(
        '/\s+/',
        '',
        $cvv
    );
    $signature = sha1(
        $merchantCode
        . $pan
        . $cvv
        . $terminal
        . $amount
        . $currency
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->create_subscription(
            $merchantCode,
            $terminal,
            $pan,
            $expdate,
            $cvv,
            $startdate,
            $enddate,
            $transreference,
            $periodicity,
            $amount,
            $currency,
            $signature,
            $ip,
            1,
            $ownerName,
            $scoring,
            $merchant_data
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse create_subscription(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String pan = args[4];
    String expirydate = args[5];
    String cvv2 = args[6];
    String startdate = args[7];
    String enddate = args[8];
    String orderid = args[9];
    String periodicity = args[10];
    String amount = args[11];
    String currency = args[12];
    String cardholder = args[13];
    String scoring = args[14];

    merchantsignature = makeSHA1hash(merchantcode + pan + cvv2 + terminal + amount + currency + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("create_subscription");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("pan", dS_MERCHANT_PAN);
    soapReq.addProperty("DS_MERCHANT_EXPIRYDATE", expirydate);
    soapReq.addProperty("DS_MERCHANT_CVV2", cvv2);
    soapReq.addProperty("DS_SUBSCRIPTION_STARTDATE", startdate);
    soapReq.addProperty("DS_SUBSCRIPTION_ENDDATE", enddate);
    soapReq.addProperty("DS_SUBSCRIPTION_ORDER", orderid);
    soapReq.addProperty("DS_SUBSCRIPTION_PERIODICITY", periodicity);
    soapReq.addProperty("DS_SUBSCRIPTION_CURRENCY", currency);
    soapReq.addProperty("DS_SUBSCRIPTION_AMOUNT", amount);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_CARDHOLDERNAME", cardholder);
    soapReq.addProperty("DS_MERCHANT_SCORING", scoring);

    return callSoap(result, soapReq);
}

Editing a subscription in the system

Function: (edit_subscription)

If a user renews their subscription or simply wants to increase the payment of the service we offer the service of editing a subscription. In this case it will not be possible to change the currency nor the bank details of the customer of the business. The modification of the subscription involves the prior registration of a user in subscription mode in the BankStore system of PAYCOMET. This process is completely independent from the isolated charge to a customer of the business.

The variables required for editing a subscription are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_SUBSCRIPTION_STARTDATE [YYYY-MM-DD] Mandatory. Subscription start date. If the value is empty the date is the same day of registration.
DS_SUBSCRIPTION_ENDDATE [YYYY-MM-DD] Mandatory. Subscription end date.
DS_SUBSCRIPTION_PERIODICITY [0-9]{3} Mandatory. Frequency of collection from the start date. The number expresses Days.
DS_SUBSCRIPTION_AMOUNT [0-9]{1,8} Mandatory. Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_EXECUTE [0-1]{1} Mandatory. If the registration process involves the payment of the first installment the value of DS_EXECUTE must be 1. If you only want the subscription registration without the payment of the first installment (it will be executed with the parameters sent) its value must be 0.
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_IDUSER [0-9]{1,13} Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Token code associated with the DS_IDUSER.
DS_SUBSCRIPTION_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_SUBSCRIPTION_ORDER [A-Za-z0-9]{1,20} Original reference of the operation + [DS_IDUSER] + date of the transaction in format YYYYMMDD.
DS_SUBSCRIPTION_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authentication bank code of the transaction.
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

If the execution of the first installment is successful the system will return all the fields except DS_ERROR_ID which will be left empty.

If the execution of the first installment has an error for several reasons (balance, validity of the card, etc...), the subscription will be canceled having to create a new subscription. In this case only DS_ERROR_ID will be returned with the specific error code.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:edit_subscription xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_SUBSCRIPTION_STARTDATE type="xsd:string"> 2034-05-21 </DS_SUBSCRIPTION_STARTDATE>
        <DS_SUBSCRIPTION_ENDDATE type="xsd:string"> 2035-06-25 </DS_SUBSCRIPTION_ENDDATE>
        <DS_SUBSCRIPTION_PERIODICITY type="xsd:string"> 15 </DS_SUBSCRIPTION_PERIODICITY>
        <DS_SUBSCRIPTION_AMOUNT type="xsd:string"> 1234 </DS_SUBSCRIPTION_AMOUNT>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_EXECUTE" type="xsd:integer>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function editSubscription(
    $idpayuser,
    $tokenpayuser,
    $startdate,
    $enddate,
    $periodicity,
    $amount,
    $execute
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $amount
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->edit_subscription(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $startdate,
            $enddate,
            $periodicity,
            $amount,
            $signature,
            $execute,
            $ip
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse edit_subscription(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String subscriptionstartdate = args[6];
    String subscriptionenddate = args[7];
    String subscriptionperiodicity = args[8];
    String subscriptionamount = args[9];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + DS_SUBSCRIPTION_AMOUNT + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("edit_subscription");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_SUBSCRIPTION_STARTDATE", subscriptionstartdate);
    soapReq.addProperty("DS_SUBSCRIPTION_ENDDATE", subscriptionenddate);
    soapReq.addProperty("DS_SUBSCRIPTION_PERIODICITY", subscriptionperiodicity);
    soapReq.addProperty("DS_SUBSCRIPTION_AMOUNT", subscriptionamount);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Subscription removal

Function: (remove_subscription)

This function will be used for removing a subscription from the account of the business.

The variables required for requesting the removal of a subscription are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the application of the business.

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, user not found, etc) all fields will be delivered empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the field DS_RESPONSE the value of which will be 0 or empty in case of error and 1 in case of successful removal.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:remove_subscription xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function removeSubscription(
    $idpayuser,
    $tokenpayuser
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->remove_subscription(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $signature,
            $ip
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse remove_subscription(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("remove_subscription");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Execution of subscription registration in the system with USERID and TOKENID

Function: (create_subscription_token)

The registration of a subscription through this process will create a subscription for a user that was already registered in the system, without it being necessary in this case to send card data again.

The variables required for registering the subscription are:

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_SUBSCRIPTION_STARTDATE [YYYY-MM-DD] Mandatory. Subscription start date. If the value is empty the date is the same day of registration.
DS_SUBSCRIPTION_ENDDATE [YYYY-MM-DD] Mandatory. End date of the subscription. It may not be greater than the start date of the subscription + 5 years
DS_SUBSCRIPTION_ORDER [A-Za-z0-9]{1,20} Mandatory. First characters of the reference of the operation. IMPORTANT: Do not include the characters “[“ o “]”, they will be used to recognize the user of the business.
DS_SUBSCRIPTION_PERIODICITY [0-9]{3} Mandatory. Frequency of collection from the start date. The number expresses Days. It may not be greater than 365 days.
DS_SUBSCRIPTION_AMOUNT [0-9]{1,8} Mandatory. Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_SUBSCRIPTION_CURRENCY [EUR][USD][GBP][JPY] Mandatory. Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction (owner of the card)
DS_MERCHANT_SCORING [0-100] Optional. Valor de scoring de riesgo de la transacción. Entre 0 y 100.

Example:

DS_SUBSCRIPTION_ORDER = Luis_3268314

The charge of the subscription to DS_IDUSER 32 on December 23, 2030 the system will return it as DS_SUBSCRIPTION_ORDER:

DS_SUBSCRIPTION_ORDER = Luis_3268314[23]20301223

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_IDUSER [0-9]{1,13} Unique identifier of the user registered in the system. It will come back empty in the case of error.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Token code associated with the DS_IDUSER.
DS_SUBSCRIPTION_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_SUBSCRIPTION_ORDER [A-Za-z0-9]{1,20} Original reference of the operation + [DS_IDUSER] + date of the transaction in format YYYYMMDD.
DS_SUBSCRIPTION_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authentication bank code of the transaction.
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, incorrect amount, user not found, etc) all fields will be empty, except “DS_ERROR_ID” which will contain the error code.

If the execution of the first installment is successful the system will return all the fields except DS_ERROR_ID which will be left empty.

If the execution of the first installment has an error for several reasons (balance, validity of the card, etc...), the subscription will be canceled having to create a new subscription. In this case only DS_ERROR_ID will be returned with the specific error code.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:create_subscription_token xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_SUBSCRIPTION_STARTDATE type="xsd:string"> 2034-05-21 </DS_SUBSCRIPTION_STARTDATE>
        <DS_SUBSCRIPTION_ENDDATE type="xsd:string"> 2035-06-25 </DS_SUBSCRIPTION_ENDDATE>
        <DS_SUBSCRIPTION_ORDER type="xsd:string"> subscritionorder </DS_SUBSCRIPTION_ORDER>
        <DS_SUBSCRIPTION_PERIODICITY type="xsd:string"> 15 </DS_SUBSCRIPTION_PERIODICITY>
        <DS_SUBSCRIPTION_AMOUNT type="xsd:string"> 1234 </DS_SUBSCRIPTION_AMOUNT>
        <DS_SUBSCRIPTION_CURRENCY type="xsd:string"> EUR </DS_SUBSCRIPTION_CURRENCY>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_SCORING" type="xsd:integer>
        <DS_MERCHANT_DATA type="xsd:string"> Comerce Data </DS_MERCHANT_DATA>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function CreateSubscriptionToken(
    $idpayuser,
    $tokenpayuser,
    $startdate,
    $enddate,
    $transreference,
    $periodicity,
    $amount,
    $currency,
    $scoring = null,
    $merchant_data = null
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $amount
        . $currency
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->create_subscription_token(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $startdate,
            $enddate,
            $transreference,
            $periodicity,
            $amount,
            $currency,
            $signature,
            $ip,
            $scoring,
            $merchant_data
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse create_subscription_token(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String subscriptionstartdate = args[6];
    String subscriptionenddate = args[7];
    String subscriptionorder = args[8];
    String subscriptionperiodicity = args[9];
    String subscriptionamount = args[10];
    String subscriptioncurrency = args[11];
    String merchantscoring = args[12];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + subscriptionamount + subscriptioncurrency + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("create_subscription_token");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_SUBSCRIPTION_STARTDATE", subscriptionstartdate);
    soapReq.addProperty("DS_SUBSCRIPTION_ENDDATE", subscriptionenddate);
    soapReq.addProperty("DS_SUBSCRIPTION_ORDER", subscriptionorder);
    soapReq.addProperty("DS_SUBSCRIPTION_PERIODICITY", subscriptionperiodicity);
    soapReq.addProperty("DS_SUBSCRIPTION_AMOUNT", subscriptionamount);
    soapReq.addProperty("DS_SUBSCRIPTION_CURRENCY", subscriptioncurrency);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_SCORING", merchantscoring);

    return callSoap(result, soapReq);
}

Creating a user preauthorization in the system

Function: (create_preauthorization)

Once the user is registered in the system, preauthorization operations may be performed by sending their credentials and data of the operation.

The variables required for carrying out a preauthorization for a user registered in the system are the same as those described in section Execution of charges to a user in the system

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:create_preauthorization xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_CURRENCY type="xsd:string"> EUR </DS_MERCHANT_CURRENCY>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_PRODUCTDESCRIPTION type="xsd:string"> Product description </DS_MERCHANT_PRODUCTDESCRIPTION>
        <DS_MERCHANT_OWNER type="xsd:string"> Card Owner  </DS_MERCHANT_OWNER>
        <DS_MERCHANT_SCORING" type="xsd:integer>
        <DS_MERCHANT_DATA type="xsd:string"> Comerce Data </DS_MERCHANT_DATA>
        <DS_MERCHANT_MERCHANTDESCRIPTOR type="xsd:string"> Commerce descriptor </DS_MERCHANT_MERCHANTDESCRIPTOR>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function createPreauthorization(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference,
    $currency,
    $productdescription = false,
    $owner = false,
    $scoring = null,
    $merchant_data = null,
    $merchant_description = null
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $amount
        . $transreference
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->create_preauthorization(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $currency,
            $signature,
            $ip,
            $productdescription,
            $owner,
            $scoring,
            $merchant_data,
            $merchant_description
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse create_preauthorization(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String merchantamount = args[6];
    String transferenceid = args[7];
    String merchantcurrency = args[8];
    String merchantproductdescription = args[9];
    String merchantowner = args[10];
    String merchantscoring = args[11];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + merchantamount + transferenceid + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("create_preauthorization");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", merchantamount);
    soapReq.addProperty("DS_MERCHANT_ORDER", transferenceid);
    soapReq.addProperty("DS_MERCHANT_CURRENCY", merchantcurrency);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);
    soapReq.addProperty("DS_MERCHANT_PRODUCTDESCRIPTION", merchantproductdescription);
    soapReq.addProperty("DS_MERCHANT_OWNER", merchantowner);
    soapReq.addProperty("DS_MERCHANT_SCORING", merchantscoring);

    return callSoap(result, soapReq);
}

Confirmation of a user preauthorization in the system

Function: (preauthorization_confirm)

Once a preauthorization operation has been performed and authorized, it can be confirmed to make the cash payment within 7 days; after that date, preauthorizations become invalid. The amount of the preauthorization confirmation can be less than, equal to or greater than 15% of the original preauthorization.

The variables required to confirm the preauthorization are:

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_IDUSER [0-9]{1,13} Mandatory. Unique identifier of the user registered in the system.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Mandatory. Token code associated with the DS_IDUSER.
DS_MERCHANT_AMOUNT [0-9]{1,8} Mandatory. Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Mandatory. Reference operation. Should be that identified the original preauthorization.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authorization bank code of the transaction (required to execute a return).
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.
Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:preauthorization_confirm xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>
        <DS_MERCHANT_MERCHANTDESCRIPTOR type="xsd:string"> Commerce descriptor </DS_MERCHANT_MERCHANTDESCRIPTOR>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function preauthorizationConfirm(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference,
    $merchant_description = null
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $transreference
        . $amount
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->preauthorization_confirm(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $signature,
            $ip,
            $merchant_description
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse preauthorization_confirm(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String merchantamount = args[6];
    String merchantorder = args[7];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + this.terminal + merchantorder + merchantamount + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("preauthorization_confirm");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", dS_TOKEN_UtokenuserSER);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", merchantamount);
    soapReq.addProperty("DS_MERCHANT_ORDER", merchantorder);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Cancelation of a user preauthorization in the system

Function: (preauthorization_cancel)

Once a preauthorization has been performed, it can be canceled within 7 days.

The variables required to cancel the preauthorization and the response elements are the same as for the preauthorization confirmation.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:preauthorization_cancel xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function preauthorizationCancel(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $transreference
        . $amount
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->preauthorization_cancel(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $signature,
            $ip
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse preauthorization_cancel(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String merchantamount = args[6];
    String merchantorder = args[7];

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + this.terminal + merchantorder + merchantamount + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("preauthorization_cancel");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", merchantamount);
    soapReq.addProperty("DS_MERCHANT_ORDER", merchantorder);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Confirmation of a user defered preauthorization in the system

Function: (deferred_preauthorization_confirm)

Once a deferred pre-authorisation operation has been carried out and authorised, it can be confirmed to carry out the effective payment within the following 72 hours; after this time, the deferred pre-authorisations lose their validity. The amount of the deferred pre-authorisation must be exactly equal to that of the original deferred pre-authorisation.

The variables required to confirm the deferred pre-authorisation are the same as for confirming the pre-authorisation.

The response of the service will have the same elements as the pre-authorisation response

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:deferred_preauthorization_confirm xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function deferredPreauthorizationConfirm(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $transreference
        . $amount
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->deferred_preauthorization_confirm(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $signature,
            $ip
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse deferred_preauthorization_confirm(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String merchantamount = args[6];
    String merchantorder = args[7];
    
    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + this.terminal + merchantorder + merchantamount + password);
    
    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("deferred_preauthorization_confirm");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", merchantamount);
    soapReq.addProperty("DS_MERCHANT_ORDER", merchantorder);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Cancelation of a user defered preauthorization in the system

Function: (deferred_preauthorization_cancel)

Once a deferred pre-authorisation has been carried out, it can be cancelled within the following 72 hours.

The variables required for cancelling the deferred pre-authorisation and the response elements are the same as for the confirmation of the deferred pre-authorisation.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:deferred_preauthorization_cancel xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_IDUSER type="xsd:string"> paycometuserid  </DS_IDUSER>
        <DS_TOKEN_USER type="xsd:string"> paycometusertoken  </DS_TOKEN_USER>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function deferredPreauthorizationCancel(
    $idpayuser,
    $tokenpayuser,
    $amount,
    $transreference
) {
    $signature = sha1(
        $merchantCode
        . $idpayuser
        . $tokenpayuser
        . $terminal
        . $transreference
        . $amount
        . $password
    );
    $ip = $_SERVER["REMOTE_ADDR"];
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->deferred_preauthorization_cancel(
            $merchantCode,
            $terminal,
            $idpayuser,
            $tokenpayuser,
            $amount,
            $transreference,
            $signature,
            $ip
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse deferred_preauthorization_cancel(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String iduser = args[4];
    String tokenuser = args[5];
    String merchantamount = args[6];
    String merchantorder = args[7];

    ServiceResponse result = new ServiceResponse();

    merchantsignature = makeSHA1hash(merchantcode + iduser + tokenuser + terminal + merchantorder + merchantamount + password);

    SoapObject soapReq = new SoapObject("deferred_preauthorization_cancel");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_IDUSER", iduser);
    soapReq.addProperty("DS_TOKEN_USER", tokenuser);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", merchantamount);
    soapReq.addProperty("DS_MERCHANT_ORDER", merchantorder);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Execution of a user registration in the system by Token

Function: (add_user_token)

This method allows a user to register based on a token previously obtained through the solution BankStore JET

The variables required for registering a user are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_MERCHANT_JETTOKEN [a-z0-9]{64} Mandatory. Token obtenido mediante javascript.
DS_MERCHANT_JETID [a-z0-9]{32} Mandatory. Identifier for JET encryption.
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION
DS_ORIGINAL_IP A.B.C.D Mandatory. IP Address of the customer that initiated the payment transaction

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_IDUSER [0-9]{1,13} Unique identifier of the user registered in the system. It will come back empty in the case of error.
DS_TOKEN_USER [A-Za-z0-9]{1,20} Token code associated with the DS_IDUSER.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.
Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:add_user_token xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_MERCHANT_JETTOKEN type="xsd:string"> paycomettoken  </DS_MERCHANT_JETTOKEN>
        <DS_MERCHANT_JETID type="xsd:string"> yourjetid  </DS_MERCHANT_JETID>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_ORIGINAL_IP type="xsd:string"> 1.2.3.4  </DS_ORIGINAL_IP>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function addUserToken($jettoken)
{
    $signature 
        = sha1(
             $merchantCode
            .$jettoken
            .$jetid
            .$terminal
            .$password
    );
    $ip	= $_SERVER["REMOTE_ADDR"];
    try{
        $clientSOAP = new SoapClient($endpoint);
        $ans 
            = $clientSOAP
                ->add_user_token(
                    $merchantCode,
                    $terminal,
                    $jettoken,
                    $jetid,
                    $signature,
                    $ip
                );
    } catch(SoapFault $e){
        var_dump($e);
        return false;
    }
    var_dump($ans);
    return $ans;
}

public ServiceResponse add_user_token(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String ipaddr = args[3];
    String jetid = args[4];
    String jettoken = args[5];

    merchantsignature = makeSHA1hash(merchantcode + jettoken + jetid + terminal + password);

    ServiceResponse result = new ServiceResponse();
    
    SoapObject soapReq = new SoapObject("add_user_token");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_MERCHANT_JETTOKEN", jettoken);
    soapReq.addProperty("DS_MERCHANT_JETID", jetid);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_ORIGINAL_IP", ipaddr);

    return callSoap(result, soapReq);
}

Execution of Charges to a user by Reference

Function: execute_purchase_rtoken

This method allows you to run a charge based on a token previously obtained by Payment by Reference

The variables required for registering a user are (in this order):

Element Content Description
DS_MERCHANT_MERCHANTCODE [A-Za-z0-9]{1,8} Mandatory. Customer code
DS_MERCHANT_TERMINAL [0-9]{1,4} Mandatory. Terminal number
DS_MERCHANT_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,70} Mandatory. Reference of the operation. Must be unique on every valid transaction.
DS_MERCHANT_IDENTIFIER [a-z0-9]{40} Identifier obtained by previous Payment by Reference
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in CURRENCY
DS_MERCHANT_MERCHANTSIGNATURE [a-zA-Z0-9]{40} Mandatory. See SIGNATURE CALCULATION

The response of the service to the request is performed by the return of an array formatted in XML with the various elements described in the following table:

Element Content Description
DS_MERCHANT_AMOUNT [0-9]{1,8} Amount of the operation in integer format. 1.00 EURO = 100, 4.50 EUROS = 450...
DS_MERCHANT_ORDER [A-Za-z0-9]{1,20} Reference of the operation.
DS_MERCHANT_CURRENCY [EUR][USD][GBP][JPY] Currency of the transaction. See more information in MONEDAS
DS_MERCHANT_AUTHCODE [a-zA-Z0-9]{1,40} Authorization bank code of the transaction (required to execute a return).
DS_MERCHANT_CARDCOUNTRY [0-9]{1,3} Country of the issuer of the card in ISO3 Code (ex.: 724 = Spain). May be left empty.
DS_RESPONSE [0-1]{1} Result of operation. 0 or empty will be erroneous operation and 1 operation completed.
DS_ERROR_ID [0-9]{1,5} In the case of error, the error code generated will be here. If there is no error it will be 0 or empty. The error codes are specified in the document ERROR CODES.

If the request generates an error of some kind (incorrect signature, user not found, etc) all fields will be delivered empty, except “DS_ERROR_ID” which will contain the error code.

If the transaction is correct, the service will return the field DS_RESPONSE the value of which will be 0 or empty in case of error and 1 in case of successful removal.

Different languages usage:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:Paytpv_bankStoreGateway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
        <mns:execute_purchase_rtoken xmlns:mns="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
        <DS_MERCHANT_MERCHANTCODE type="xsd:string"> yourmerchantcode  </DS_MERCHANT_MERCHANTCODE>
        <DS_MERCHANT_TERMINAL type="xsd:string"> yourterminal  </DS_MERCHANT_TERMINAL>
        <DS_MERCHANT_AMOUNT type="xsd:string"> 1234 </DS_MERCHANT_AMOUNT>
        <DS_MERCHANT_ORDER type="xsd:string"> unique_operation_reference </DS_MERCHANT_ORDER>
        <DS_MERCHANT_IDENTIFIER type="xsd:string"> merchantidentifier </DS_MERCHANT_IDENTIFIER>
        <DS_MERCHANT_CURRENCY type="xsd:string"> EUR </DS_MERCHANT_CURRENCY>
        <DS_MERCHANT_MERCHANTSIGNATURE type="xsd:string"> yourgeneratedsignature12345  </DS_MERCHANT_MERCHANTSIGNATURE>
        <DS_MERCHANT_PRODUCTDESCRIPTION type="xsd:string"> Product description </DS_MERCHANT_PRODUCTDESCRIPTION>
        <DS_MERCHANT_MERCHANTDESCRIPTOR type="xsd:string"> Commerce descriptor </DS_MERCHANT_MERCHANTDESCRIPTOR>    
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

function executePurchaseRToken(
    $amount,
    $transreference,
    $rtoken,
    $currency,
    $productdescription = false,
    $merchant_description = null
) {
    $signature = sha1(
        $terminal
        . $amount
        . $transreference
        . $rtoken
        . $password
    );
    try {
        $clientSOAP = new SoapClient($endpoint);
        $ans = $clientSOAP->execute_purchase_rtoken(
            $merchantCode,
            $terminal,
            $amount,
            $transreference,
            $rtoken,
            $currency,
            $signature,
            $productdescription,
            $merchant_description
        );
    } catch (SoapFault $e) {
        var_dump($e);
    }
    var_dump($ans);
}

public ServiceResponse execute_purchase_rtoken(String[] args) {

    String merchantcode = args[0];
    String terminal = args[1];
    String password = args[2];
    String merchantamount = args[3];
    String merchantorder = args[4];
    String merchantidentifier = args[5];
    String merchantcurrency = args[6];
    String merchantaproductdescription = args[7];

    merchantsignature = makeSHA1hash(merchantcode + this.terminal + merchantamount + merchantorder + merchantidentifier + password);

    ServiceResponse result = new ServiceResponse();

    SoapObject soapReq = new SoapObject("execute_purchase_rtoken");
    soapReq.addProperty("DS_MERCHANT_MERCHANTCODE", merchantcode);
    soapReq.addProperty("DS_MERCHANT_TERMINAL", terminal);
    soapReq.addProperty("DS_MERCHANT_AMOUNT", merchantamount);
    soapReq.addProperty("DS_MERCHANT_ORDER", merchantorder);
    soapReq.addProperty("DS_MERCHANT_IDENTIFIER", merchantidentifier);
    soapReq.addProperty("DS_MERCHANT_CURRENCY", merchantcurrency);
    soapReq.addProperty("DS_MERCHANT_MERCHANTSIGNATURE", merchantsignature);
    soapReq.addProperty("DS_MERCHANT_PRODUCTDESCRIPTION", merchantaproductdescription);

    return callSoap(result, soapReq);
}

Card Expiration Notification

For users registered in the Bankstore system, there is the possibility of receiving an informative notification to alert them of the upcoming expiration of the card for this user/token.

Notification (Request to URL)

The notification parameters are passed to the target URL using the POST method according to the following table:

TransactionType Numerical Operation type (108) See OPERATION TYPES.
TransactionName Alphanumerical Description of operation.
IdUser Numerical Id of the user registered in the system.
Terminal Numerical Terminal Identifier.
Name Alphanumerical Name of the product.
Domain Alphanumerical Domain of the product.
MonthsToExpire Numerical Months to expiration.

In order to receive such notifications it must be specifically enabled by PAYCOMET. You can contact us through of the customer portal on the menu “Support Notification of incidence”.

APPENDIX I – Business signature calculation

The signature will be calculated on the server of the business and shall cover the main parameters of the request to verify the integrity of the data over the Internet and the browser of the buyer.

The SHA1 encryption algorithm will be used for this purpose, which enables us to encrypt a text string. These types of one direction algorithms prevent the initial parameter from being obtained using the result.

The signature will be calculated differently depending on the function used to verify the integrity of data sent to the platform.

To facilitate the generation of the signature in languages without the necessary tools for the calculation of SHA1 algorithms, a series of libraries have been included. These files can be downloaded from the section Support->Documentation of the customer control panel.

Some of these libraries have been created by persons or entities not related to PAYCOMET. Consult the content of each file for further information.

Signature calculation depending on the function used

The signature that the business will send to the gateway will be calculated in the following manner (in pseudocode):

Function: (add_user)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_MERCHANT_PAN + DS_MERCHANT_CVV2 + DS_MERCHANT_TERMINAL + PASSWORD)

 

Function: (info_user)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + PASSWORD)

 

Function: (remove_user)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + PASSWORD)

 

Function: (execute_purchase)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_AMOUNT + DS_MERCHANT_ORDER + PASSWORD)

 

Function: (execute_purchase_dcc)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_AMOUNT + DS_MERCHANT_ORDER + PASSWORD)

 

Function: (confirm_purchase_dcc)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_MERCHANT_TERMINAL + DS_MERCHANT_ORDER + DS_MERCHANT_DCC_CURRENCY + DS_MERCHANT_DCC_SESSION + PASSWORD)

 

Function: (execute_refund)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_AUTHCODE + DS_MERCHANT_ORDER + PASSWORD)

 

Function: (create_subscription)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_MERCHANT_PAN + DS_MERCHANT_CVV2 + DS_MERCHANT_TERMINAL + DS_SUBSCRIPTION_AMOUNT + DS_SUBSCRIPTION_CURRENCY + PASSWORD)

 

Function: (edit_subscription)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_SUBSCRIPTION_AMOUNT + PASSWORD)

 

Function: (remove_subscription)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + PASSWORD)

 

Function: (create_subscription_token)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_SUBSCRIPTION_AMOUNT + DS_SUBSCRIPTION_CURRENCY + PASSWORD)

 

Function: (create_preauthorization)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_AMOUNT + DS_MERCHANT_ORDER + PASSWORD)

 

Function: (preauthorization_confirm)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_ORDER + DS_MERCHANT_AMOUNT + PASSWORD)

 

Function: (preauthorization_cancel)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_ORDER + DS_MERCHANT_AMOUNT + PASSWORD)

 

Function: (deferred_preauthorization_confirm)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_ORDER + DS_MERCHANT_AMOUNT + PASSWORD)

 

Function: (deferred_preauthorization_cancel)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_IDUSER + DS_TOKEN_USER + DS_MERCHANT_TERMINAL + DS_MERCHANT_ORDER + DS_MERCHANT_AMOUNT + PASSWORD)

 

Function: (add_user_token)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_MERCHANT_JETTOKEN + DS_MERCHANT_JETID + DS_MERCHANT_TERMINAL + PASSWORD)

 

Function: (execute_purchase_rtoken)

SHA1(DS_MERCHANT_MERCHANTCODE + DS_MERCHANT_TERMINAL + DS_MERCHANT_AMOUNT + DS_MERCHANT_ORDER + DS_MERCHANT_IDENTIFIER + PASSWORD)

 

APPENDIX II – OPERATION TYPES

The operation types that will be notified are detailed in the following table:

ID Operation
1 Authorization
2 Refund
3 Preauthorization
4 Preauthorization cancellation
6 Preauthorization confirmation
9 Subscription
13 Defered Preauthorization Registration
14 Defered Preauthorization Confirmation
16 Defered Preauthorization Cancellation
106 Chargeback
107 Bankstore user registration
108 Card Expiration