If you're capturing data in your application or website, you can send it to our API in an Authorization request to be processed. You can also manage the full transaction lifecycle using the API, from initial payment through to settlement and additional actions like refunds.
Merchants processing captured card data through the API can attest to their PCI compliance by completing the PCI DSS Self-Assessment Questionnaire (SAQ) D.
To test using the API, first register for a developer account if you don't already have one. Once logged in, you can request Sandbox credentials from your account.
Select the applicable validation resource you need by using the tabs below.
We provide a simple JavaScript library that you can tailor to fit your solution. The latest release is available on GitHub.
<!DOCTYPE html>
<html>
<head>
<title>Basic Validation Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="rxp-js.js"></script> <!-- Available at https://github.com/realexpayments -->
<!-- Basic form styling given as an example -->
<style type="text/css">
label{display:block; font-size:12px; font-family:arial;}
input{width:200px;}
input.small{width:50px;}
.twoColumn{float:left;margin:0 30px 20px 0;}
.clearAll{clear:both;}
</style>
</head>
<body><!-- Basic HTML form given as an example -->
<form name="myForm" method="POST" autocomplete="off" action="https://serverSdkEndpoint">
<label for="cardNumber">Card Number</label>
<input type="tel" id="cardNumber" name="card-number" /><br><br>
<label for="cardholderName">Cardholder Name</label>
<input type="text" id="cardholderName" name="cardholder-name" /><br><br>
<p class="twoColumn">
<label>Expiry Date</label>
<input type="tel" id="expiryDateMM" name="expiry-date-mm" placeholder="MM" class="small" />
<input type="tel" id="expiryDateYY" name="expiry-date-yy" placeholder="YY" class="small" /></p>
<p class="twoColumn">
<label for="cvn">Security Code</label>
<input type="tel" id="cvn" name="cvn" class="small" /></p>
<p class="clearAll">
<input value="Pay Now" type="submit" name="submit" onclick="validate();" /></p>
</form>
</body>
</html>function validate() { // Basic form validation using the JS Library given as an example
var cardNumberCheck = RealexRemote.validateCardNumber(document.getElementById('cardNumber').value);
var cardHolderNameCheck = RealexRemote.validateCardHolderName(document.getElementById('cardholderName').value);
var expiryDate = document.getElementById('expiryDateMM').value.concat(document.getElementById('expiryDateYY').value);
var expiryDateFormatCheck = RealexRemote.validateExpiryDateFormat(expiryDate);
var expiryDatePastCheck = RealexRemote.validateExpiryDateNotInPast(expiryDate);
if (document.getElementById('cardNumber').value.charAt(0) == "3") {
cvnCheck = RealexRemote.validateAmexCvn(document.getElementById('cvn').value);
} else {
cvnCheck = RealexRemote.validateCvn(document.getElementById('cvn').value);
}
if (cardNumberCheck == false || cardHolderNameCheck == false || expiryDateFormatCheck == false || expiryDatePastCheck == false || cvnCheck == false) {
// code here to inform the cardholder of an input error and prevent the form submitting
return false;
} else {
return true;
}
}The library contains the following methods.
| Element/Field | Description |
| validateCardNumber | Validates card number format and performs a Luhn check. |
| validateCardHolderName | Validates cardholder name according to ISO/IEC 8859-1:1998. |
| validateCvn | Validates non-Amex CVN. |
| validateAmexCvn | Validates Amex CVN. |
| validateExpiryDateFormat | Validates expiry date format. |
| validateExpiryDateNotInPast | Checks that the expiry date is not in the past. |
An Authorization is a standard payment request or charge processed by Global Payments. First, create a card object with your captured cardholder data and add this to your request. The SDK handles generating the secure hash, transmission of data and creation of the response object. Using the response object methods you can obtain all the data you need from the outcome of the transaction.
Always keep your shared secret on the server-side to avoid exposing it to the public.
Testing is available in our free Sandbox environment for registered users of this developer portal. Use our resources below to start testing.
Test different transaction outcomes with simulated cards or banks.
View what messages can be returned for both hosted and API integrations.
For the detailed API specification and a full list of features, see the API Reference section.