3D Secure Parse PaRes

After a successful authentication with a 3D Secure call, this call allows to parse the PaRes field to retrieve the ECI, XID, CAVV and CAVVAlgorithm fields to be sent to the Sale function.


Note: The use of this method is discouraged and will be removed/restricted in future deployment. The PaRes parameter of Sale/Authorize calls must be used instead.


Endpoints

HTTP Method API URL API Version
POST https://api.payzone.ma/transaction/{transactionID}/3dsparse >= 002

Accepted parameters

Field Type Max Length Required Description
transactionID Integer 20 yes Reference transaction to S3Dcheck
PaRes String 8192 yes Payer Authentication Response

Code samples

Note: Gateway API transactions are done with a different library than payment-page API. See the code sample comments for more info:

   
    /*
    *   Transaction name is '3DSParse', once you create a new transaction passing this as parameter, 
    *   you need to set the mandatory data using the follow methods:
    *    setPaRes()
    */

    $client = new GatewayClient();

    $transaction = $client->newTransaction('3DSParse', 'testMerchant', 'testPassword');
    $transaction->setTransactionID(9567856);
    $transaction->setPaRes($PaRes);

    $response = $transaction->send();

    if ('000' === $response->errorCode) {
        $ECI  = $response->ECI;
        $XID  = $response->XID;
        $CAVV = $response->CAVV;
        $CAVVAlgorithm = $response->CAVVAlgorithm;

    } else {
        echo "Error {$response->errorCode} with message {$response->errorMessage}";
    }
                      
   
    PaymentGatewayConnector connector = new PaymentGatewayConnector(API_URL, ORIGINATOR, PASSWORD);

    ThreeDSParseResponse response = null;
    ThreeDSParseRequest request = new ThreeDSParseRequest();

    request.setTransactionId(9567856L).setPaRes("XXXXXX...");

    try {
        response = connector.doThreeDSParseTransaction(request);
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (response != null) {
        if (TransactionResultCode.TRANSACTION_SUCCESSFULLY.equals(response.getErrorCode()) {
        System.out.println("Success: " + response.getErrorMessage());
        } else {
        System.out.println("Failure: " + response.getErrorMessage());
        }
    }
                      
   
    const gateway = require("payxpert")("123456", "GreatP4ssw0rd").gateway;

    let PaRes = "..."; // you should already have this data. How to retrieve it you can take a look in "3D Secure Check" example
    let transactionId = "..."; // Also you should have transactionID from "3DS Check" transaction

    let parse3dsResult = await gateway.parse3dSecure(transactionId, PaRes);

    if (response.code == "000") {
        // Success
        // sale transaction could be performed

        const body = {
            customerIP: "8.8.4.4",
            amount: 1500,
            currency: "EUR",
            orderID: "HELLO NODEJS",

            cardNumber: "4111111111111111",
            cardSecurityCode: "000",
            cardHolderName: "CARDHOLDER NAME",
            cardExpireMonth: "10",
            cardExpireYear: "2024",

            shopperName: "NodeJS Test",
            shopperAddress: "NA",
            shopperZipcode: "NA",
            shopperCity: "NA",
            shopperState: "NA",
            shopperCountryCode: "NA",
            shopperPhone: "NA",
            shopperEmail: "NA",

            // 3DS values

            PaRes: parse3dsResult.PaRes,
            ECI: parse3dsResult.ECI,
            XID: parse3dsResult.XID,
            CAVV: parse3dsResult.CAVV,
            CAVVAlgorithm: parse3dsResult.CAVVAlgorithm
        };

        const responseCreatePayment = await gateway.creditCardSale(body);

        if (responseCreatePayment.code == "000") {
            // Success
            // ...
        }
    }

        
   
    var client = new GatewayClient(OriginatorConfig.ORIGINATOR_ID, OriginatorConfig.ORIGINATOR_PASSWORD);

    String PaRes = "..."; // you should already have this data. How to retrieve it you can take a look in "3D Secure Check" example
    String TransactionId = "..."; // Also you should have transactionID from "3DS Check" transaction

    var parse3ds = client.New3DSParseTransaction(TransactionId, PaRes);
    var parse3dsResult = await parse3ds.Send();

    vif (parse3dsResult.IsSuccessfull())
    {
        Console.WriteLine("3DS: success. Performing SALE operation");

        var transaction = client.NewSaleTransaction();

        transaction.SetTransactionInformation(amount3ds, "EUR", orderId3ds, customerIP);
        transaction.SetCardInformation("4111111111111111", "000", "CSHARP SDK", "10", "2024");
        transaction.SetShopperInformation("CSHARP SDK", "MICROSOFT CLIENT", "666", "REDMOND", "WA", "US", "12445", "x@x.rr");
        transaction.Set3DSInformation(PaRes, parse3dsResult);

        var response = await transaction.Send();

        if (response.IsSuccessfull())
        {
            Console.WriteLine("Sale operation ok. Transaction ID: " + response.transactionID);
        } else
        {
            Console.WriteLine("Error performing sale: " + response.errorMessage);
        }
    }
    else
    {
        Console.WriteLine("3DS parse: failure");
    }

                        

Response

The body of the response is in JSON format.

The following fields are present in the response :


Name Type Description
errorCode String See API Response Codes
errorMessage String See API Response Codes
ECI String Electronic Commerce Indicator
XID String Xid Transaction ID generated by the 3D Secure service that uniquely identifies a 3D Secure check request
CAVV String Cavv Cardholder Authentication Verification Value
CAVVAlgorithm String CAVVAlgorithm returned from 3D secure authentication

© Payzone | 2022