Blacklist Value


Endpoints

HTTP Method API URL API Version
POST https://api.payzone.ma/blacklist >= 002

Accepted parameters

Field Type Max Length Required Description Version
valueType String 100 yes Define the value type to be inserted into the blacklist. Must be one of the following: creditCardNumber, toditoCardNumber, accountNumber, shopperEmail, customerIP >= 002
value String 100 yes Value to be inserted into the blacklist >= 002

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 'BlacklistValue', once you create a new transaction passing this as parameter, 
    *   you need to set the mandatory data using the following method:
    *    setBlacklistValue()
    */

    $client = new GatewayClient();

    $transaction = $client->newTransaction('BlacklistValue', 'testMerchant', 'testPassword');
    $transaction->setBlacklistValue('creditCardNumber', '4111111111111111');

    $response = $transaction->send();

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

    BlacklistValueResponse response = null;
    BlacklistValueRequest request = new BlacklistValueRequest();
    request.setValueType(BlacklistTypeValue.CREDITCARD_NUM);
    request.setValue("4111111111111111");

    try {
        response = connector.doBlacklistValue(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;

    // In this example we will perform blocking of CustomerIP

    let requestBody = {
        'valueType': 'customerIP',
        'value': '123.123.88.88'
    };

    let responseBlacklist = await gateway.blacklistValue(requestBody);

    if (responseBlacklist.code == "000") {
        // Success
    }
        
        
        
   
    // In this example we will perform blocking of CustomerIP

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

    Console.WriteLine("Performing blacklisting of customer IP: " + customerIP);

    var transaction = client.NewBlacklistValueTransaction();
    transaction.SetValue(BlacklistValueType.CUSTOMER_IP, customerIP);

    var blacklistResponse = await transaction.Send();

    if (blacklistResponse.IsSuccessfull())
    {
        Console.WriteLine("Blacklist is ok: " + blacklistResponse.errorMessage);
    }
    else
    {
        Console.WriteLine("Error blacklisting: " + blacklistResponse.errorMessage);
    }
                        
                        

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

© Payzone | 2023