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

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, 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.

Transactions in Review

Transactions in review should be held until a final decision is made. There are two options for receiving transaction status updates:

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

Step 3: Request payment via gateway

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

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.

Step 5: Send gateway response to NoFraud

Finally, update NoFraud with the gateway result using the Update Gateway Response endpoint.

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"
}