1. Home
  2. Todito Cash Sale Transaction

Todito Cash Sale Transaction

Todito Cash is a pre-paid card in Mexico that works as an alternative payment method to buy goods, content and services online and offline.

API Url

Environment Url Method Version
Production https://api.payxpert.com/transaction/sale/todito POST >= 0200

Todito Sale Request

Field Type Max Length Requirement Description Version
customerIP IP 40 M Customer request IP
amount N 10 M Number in minor unit, e.g. cents; 100 dollar cent equals to 1 dollar
currency C 3 M ISO-4217 currency codes
orderID S 100 M Unique reference to current transaction request
Payment type fields (todito card)
Field Type Max Length Requirement Description Version
cardNumber S 40 M Todito card number
cardNIP D 4 M Todito Pin number
Optional Shopper fields
Field Type Max Length Requirement Description Version
shopperName S 35 M Use ‘NA’ if unavailable
shopperAddress S 255 M Use ‘NA’ if unavailable
shopperZipcode S 10 M Use ‘NA’ if unavailable
shopperCity S 50 M Use ‘NA’ if unavailable
shopperState C 30 M ISO 3166-2 country subdivision codes if exist; 2 letters in USA, 3 letters in Australia, etc. Use ‘NA’ if unavailable
shopperCountryCode C 2 M ISO-3166-1 country codes. Use “ZZ” if the country is unknown
shopperPhone S 20 M Use ‘NA’ if unavailable
shopperEmail E 100 M Use ‘NA’ if unavailable
Optional e-commerce fields
Field Type Max Length Requirement Description Version
orderAmount N 10 O Number in minor unit, e.g. cents; 100 dollar cent equals to 1 dollar
productID S 32 O
comment S 255 O Merchant comments
shipToName S 80 R Name of shipping address
shipToAddress S 255 R Address of shipping address
shipToZipcode S 10 R Zip code of shipping address
shipToCity S 50 R City of shipping address
shipToState C 30 R ISO 3166-2 country subdivision codes if exist; 2 letters in USA, 3 letters in Australia, etc
shipToCountryCode C 2 R ISO-3166-1 country codes.
shipToPhone S 20 R Phone of shipping address
orderDescription S 500 R Order description
Optional affiliate fields
Field Type Max Length Requirement Description Version
affiliateID D 16 R This is the affiliate id from your affiliate program. This variable help you and the Risk Management team to manage the transactions coming from your affiliates.
campaignName S 128 O Affiliate campaign name
Optional fraud fields
Field Type Max Length Requirement Description Version
threatmetrixSession S 100 R Threatmetrix session id generated on the payment page

Todito Sale Response

Field Type Max Length Requirement Description Version
transactionID N 20 M Transaction reference returned by the system
errorCode D 3 M See Messages and error codes
errorMessage S 100 M See Messages and error codes

PHP Gateway Client

Transaction name : ToditoSale

PHP Methods

Method name Requirement
setTransactionInformation M
setToditoCardInformation M
setShopperInformation M
setOrder O
setShippingAddress O
setAffiliate O

PHP Example

<?php
$client = new GatewayClient();

$transaction = $client->newTransaction('ToditoSale', 'testMerchant', 'testPassword');
$transaction->setTransactionInformation(2000, 'MXN', 'order1456', '10.10.254.10');
$transaction->setToditoCardInformation('1111111111', '0000');
$transaction->setShopperInformation('John Smith', '334 Some Drive', '90001', 'Los Angeles', 'CA', 'US', '+1 213-XXX-XXXX', 'test@mail.com');

$response = $transaction->send();

if ('000' === $response->errorCode) {
    $transactionID  = $response->transactionID;
} else {
    echo "Error {$response->errorCode} with message {$response->errorMessage}";
}
?>

Java Gateway Client

Java Methods

Connector method doToditoSaleTransaction
Request class ToditoSaleRequest
Response class ToditoSaleResponse

Java Examples

PaymentGatewayConnector connector = new PaymentGatewayConnector(API_URL, ORIGINATOR, PASSWORD);

ToditoSaleResponse response = null;
ToditoSaleRequest request = new ToditoSaleRequest();
request.setOrderId("order1456");
request.setCustomerIP("10.10.254.10");
request.setAmount(2000).setCurrency("MXN");
request.setShopperName("John Smith").setShopperAddress("334 Some Drive");
request.setShopperZipcode("90001").setShopperCity("Los Angeles").setShopperState("CA").setShopperCountryCode("US");
request.setShopperPhone("+1 213-XXX-XXXX");
request.setShopperEmail("test@mail.com");

request.setCardNumber("1111111111").setCardNIP("0000");

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

Was this article helpful?