Skip to content

Name verification

Verify cardholder names match registered address information.

Overview

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:

  1. Configure your backend to request name verification during session creation.
  2. Implement the onGetShopper callback in your SDK configuration to provide shopper details.
  3. Retrieve the verification result from the Get transaction details API after payment.

Step 1: Enable name verification in your session

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.nameVerification
boolean
Set to true to enable name verification for the transaction.

Step 2: Provide shopper details

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.

Shopper type reference

ParameterDescription
firstName
string
required
The cardholder's first name.
lastName
string
required
The cardholder's last name.

Step 3: Retrieve the verification result

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.

GET
/v1/transactions/{merchant}/{site}

Request example

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'

Path parameters

ParameterDescription
merchant
string (≤ 10 characters)
required
The unique merchant identifier associated with this transaction, as assigned by PXP.
site
string (≤ 10 characters)
required
The unique site identifier associated with this transaction, as assigned by PXP.

Query parameters

ParameterDescription
merchantTransactionId
string (≤ 50 characters)
required
The unique identifier that you assigned to this transaction.
systemTransactionId
string (≤ 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
        }
      }
    }
  }
]

Verification result values

The following table describes the possible verification result values and their meaning.

ValueDescription
NoInformationAvailableNo verification information was available from the card issuer.
FirstNameMatchedLastNameMatchedBoth first and last names matched the registered information.
FirstNameMatchedLastNameNotMatchedFirst name matched, but last name did not match.
FirstNameMatchedLastNameNotCheckedFirst name matched, but last name was not checked.
FirstNameMatchedLastNamePartialMatchFirst name matched, last name partially matched.
FirstNameNotMatchedLastNameMatchedFirst name did not match, but last name matched.
FirstNameNotMatchedLastNameNotMatchedNeither first name nor last name matched.
FirstNameNotMatchedLastNameNotCheckedFirst name did not match, last name was not checked.
FirstNameNotMatchedLastNamePartialMatchFirst name did not match, last name partially matched.
FirstNameNotCheckedLastNameMatchedFirst name was not checked, but last name matched.
FirstNameNotCheckedLastNameNotMatchedFirst name was not checked, last name did not match.
FirstNameNotCheckedLastNameNotCheckedNeither first name nor last name was checked.
FirstNameNotCheckedLastNamePartialMatchFirst name was not checked, last name partially matched.
FirstNamePartialMatchLastNameMatchedFirst name partially matched, last name matched.
FirstNamePartialMatchLastNameNotMatchedFirst name partially matched, last name did not match.
FirstNamePartialMatchLastNameNotCheckedFirst name partially matched, last name was not checked.
FirstNamePartialMatchLastNamePartialMatchBoth first and last names partially matched.

Complete example

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');