Last updated

Pre-Gateway Workflow

With a pre-gateway integration, you'll run the fraud check before any interaction with the gateway. Under this workflow, you can serve the customer an error and give them an opportunity to change any details if the fraud check fails.

Steps

Pre-Gateway Diagram

Step 1: Collect customer details

Customer arrives at the checkout page to enter their details. At a minimum, NoFraud requires the following for a pre-gateway integration:

  • Email
  • Credit card number with expiration and CVV
  • Billing Address
  • IP Address

The full list of possible fields is available in the Transaction documentation.

For fraud check purposes, the more data collected the better, but must be balanced with optimizing for checkout completion.

Step 2: Run NoFraud check

After the customer submits their details, send the customer details to NoFraud using the Create Transaction endpoint. NoFraud will respond with a pass, fail, or review decision.

If fraud check passes or requires additional review, you can proceed to the next step.

If fraud check fails, you should serve the customer an error. You can potentially give them an opportunity to change details and try again.

Step 3: Request payment authorization in the gateway

Assuming the customer passes the fraud check or requires a review, you can request payment via your credit card gateway.

It's recommended to update NoFraud with the gateway result using the Update Gateway Response endpoint.

Transactions in Review

Review transactions should still go to the gateway, but the order should be held while NoFraud is reviewing it.

You can receive transaction status updates through one or both of the following:

  1. Listen for transaction status webhooks
  2. Poll the Get Transaction Status endpoint

Step 4: Accept order

You can accept the order and serve a "Thank You" order confirmation to the customer. You can proceed with order fulfillment as soon as you're ready.

Sample API Calls

Samples use the test domain apitest.nofraud.com. Use api.nofraud.com for production calls.

Create Transaction

See Create transaction for full details on this API.

  curl --location 'https://apitest.nofraud.com/' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "nfToken": "YOUR_KEY_HERE",
      "customer": {
        "email": "example@email.com"
      },
      "payment": {
        "creditCard": {
          "cardNumber": "4111111111111111",
          "expirationDate": "0919",
          "cardCode": "999"
        }
      },
      "billTo": {
        "firstName": "John",
        "lastName": "Smith",
        "address": "123 Broadway Apt #1",
        "city": "New York",
        "state": "NY",
        "zip": "11001",
        "country": "US",
        "phoneNumber": "1112223333"
      },
      "customerIP": "127.0.0.1"
    }'

Response

{
    "id": "47042736-70ba-5618-86ac-14ef3728365e",
    "decision": "review"
}

Get Transaction Status

See Get transaction status for full details on this API.

curl --location 'https://apitest.nofraud.com/status/YOUR_KEY_HERE/6628666c-d198-5cfa-a892-18713a10a9cf'

Response

{
    "id": "47042736-70ba-5618-86ac-14ef3728365e",
    "decision": "pass"
}

Update Gateway Response

See Update gateway response for full details on this API.

  curl --location 'https://apitest.nofraud.com/gateway_response' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "nf-token": "YOUR_KEY_HERE",
      "nf-id": "47042736-70ba-5618-86ac-14ef3728365e",
      "gateway-response": {
        "result": "pass",
        "authcode": 0,
        "transaction-id": 10010234578
      }
    }'

Response

{
  "Status": "OK"
}