Verify cardholder names match registered address information.
Name verification checks whether the cardholder's name matches the name associated with the registered address on file. This feature helps reduce fraud by validating the identity of the person making the payment.
To enable name verification, you need to:
- Configure your backend to request name verification during session creation.
- Implement the
onGetShoppercallback in your SDK configuration to provide shopper details. - Retrieve the verification result from the Get transaction details API after payment.
When creating a checkout session on your backend, include the identityVerification object in your API request:
{
"merchant": "merchant-01",
"site": "site-01",
"merchantTransactionId": "txn-001",
"amounts": {
"currencyCode": "USD",
"transactionValue": 100.00
},
"transactionMethod": {
"intent": {
"card": "authorisation"
}
},
"identityVerification": {
"nameVerification": true
}
}| Parameter | Description |
|---|---|
identityVerification.nameVerificationboolean | Set to true to enable name verification for the transaction. |
Implement the onGetShopper callback in your SDK configuration to provide the cardholder's first and last name:
import { PxpCheckout } from "@pxpio/web-components-sdk";
const pxpCheckout = PxpCheckout.initialize({
environment: "test",
session: sessionData,
ownerId: "your-owner-id",
ownerType: "MerchantGroup",
transactionData: {
amount: 100.00,
currency: "USD",
entryType: "Ecom",
intent: {
card: "authorisation"
},
merchantTransactionId: crypto.randomUUID(),
merchantTransactionDate: () => new Date().toISOString()
},
onGetShopper: async () => {
return {
firstName: "John",
lastName: "Doe",
};
},
});The firstName and lastName fields are required for name verification to work. Learn more about the onGetShopper callback.
| Parameter | Description |
|---|---|
firstNamestring required | The cardholder's first name. |
lastNamestring required | The cardholder's last name. |
After a transaction is completed, retrieve the name verification result by calling the Get transaction details API on your backend.
The name verification result isn't returned in the SDK transaction response. You must retrieve it from the API using the merchantTransactionId and systemTransactionId received in the SDK's onPostAuthorisation callback.
To get a transaction's details, you'll need to supply the merchant and site associated with the transaction, and either its merchantTransactionId or its systemTransactionId.
Use the following request example to get a transaction's details using a merchant transaction ID.
curl --request GET \
--url https://api-services.pxp.io/api/v1/transactions/MERCHANT-1/SITE-1?merchantTransactionId=ECOM-001 \
--header 'accept: application/json'| Parameter | Description |
|---|---|
merchantstring (≤ 10 characters) required | The unique merchant identifier associated with this transaction, as assigned by PXP. |
sitestring (≤ 10 characters) required | The unique site identifier associated with this transaction, as assigned by PXP. |
| Parameter | Description |
|---|---|
merchantTransactionIdstring (≤ 50 characters) required | The unique identifier that you assigned to this transaction. |
systemTransactionIdstring (≤ 40 characters) required | The unique identifier assigned to this transaction by PXP. |
If your request is successful, you'll receive a 200 response containing an array of transaction records. The last element of the array contains the most recent transaction state. The name verification result is returned in the fundingData.providerResponse.nameVerificationResult field.
[
{
"systemTransactionId": "1ed768bb-e88a-4636-91ae-67927ccbb02b",
"state": "Authorised",
"stateMessage": "Transaction Authorised",
"transactionMethod": {
"intent": "Authorisation",
"fundingType": "Card",
"entryType": "Ecom"
},
"merchant": "MERCHANT-1",
"site": "SITE-1",
"merchantTransactionId": "ECOM-001",
"merchantTransactionDate": "2024-01-27T08:51:02.826Z",
"amounts": {
"transactionValue": 50.05,
"currencyCode": "EUR"
},
"fundingData": {
"providerResponse": {
"nameVerificationResult": "NoInformationAvailable" // The name verification result
}
}
}
}
]The following table describes the possible verification result values and their meaning.
| Value | Description |
|---|---|
NoInformationAvailable | No verification information was available from the card issuer. |
FirstNameMatchedLastNameMatched | Both first and last names matched the registered information. |
FirstNameMatchedLastNameNotMatched | First name matched, but last name did not match. |
FirstNameMatchedLastNameNotChecked | First name matched, but last name was not checked. |
FirstNameMatchedLastNamePartialMatch | First name matched, last name partially matched. |
FirstNameNotMatchedLastNameMatched | First name did not match, but last name matched. |
FirstNameNotMatchedLastNameNotMatched | Neither first name nor last name matched. |
FirstNameNotMatchedLastNameNotChecked | First name did not match, last name was not checked. |
FirstNameNotMatchedLastNamePartialMatch | First name did not match, last name partially matched. |
FirstNameNotCheckedLastNameMatched | First name was not checked, but last name matched. |
FirstNameNotCheckedLastNameNotMatched | First name was not checked, last name did not match. |
FirstNameNotCheckedLastNameNotChecked | Neither first name nor last name was checked. |
FirstNameNotCheckedLastNamePartialMatch | First name was not checked, last name partially matched. |
FirstNamePartialMatchLastNameMatched | First name partially matched, last name matched. |
FirstNamePartialMatchLastNameNotMatched | First name partially matched, last name did not match. |
FirstNamePartialMatchLastNameNotChecked | First name partially matched, last name was not checked. |
FirstNamePartialMatchLastNamePartialMatch | Both first and last names partially matched. |
Here's a complete example showing how to implement name verification:
// Backend: Create session with name verification enabled
const sessionResponse = await fetch('/api/sessions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
merchant: 'merchant-01',
site: 'site-01',
merchantTransactionId: crypto.randomUUID(),
amounts: {
currencyCode: 'USD',
transactionValue: 100.00
},
transactionMethod: {
intent: {
card: 'authorisation'
}
},
identityVerification: {
nameVerification: true
}
})
});
const sessionData = await sessionResponse.json();
// Frontend: Initialize SDK with onGetShopper callback
const pxpCheckout = PxpCheckout.initialize({
environment: 'test',
session: sessionData,
ownerId: 'owner-123',
ownerType: 'MerchantGroup',
transactionData: {
amount: 100.00,
currency: 'USD',
entryType: 'Ecom',
intent: {
card: 'authorisation'
},
merchantTransactionId: crypto.randomUUID(),
merchantTransactionDate: () => new Date().toISOString()
},
onGetShopper: async () => {
// Return shopper details from your system
const shopper = await fetchShopperDetails();
return {
firstName: shopper.firstName,
lastName: shopper.lastName
};
}
});
// Create and mount the new card component
const newCard = pxpCheckout.create('new-card', {
onPostAuthorisation: async (data) => {
console.log('Transaction completed:', data.merchantTransactionId);
// Backend: Retrieve transaction details including name verification result
const transactionDetails = await fetch(
`/api/v1/transactions/merchant-01/site-01?merchantTransactionId=${data.merchantTransactionId}&systemTransactionId=${data.systemTransactionId}`
);
const transactions = await transactionDetails.json();
const latestTransaction = transactions[transactions.length - 1];
const verificationResult = latestTransaction.fundingData?.providerResponse?.nameVerificationResult;
console.log('Name verification result:', verificationResult);
// Handle the verification result
if (verificationResult === 'FirstNameMatchedLastNameMatched') {
console.log('Name verification successful');
} else if (verificationResult === 'NoInformationAvailable') {
console.log('Name verification information not available');
} else {
console.log('Name verification failed or partially matched');
}
}
});
newCard.mount('new-card-container');