Authentication and card data

Certification cases for bearer-token and Basic authentication, tokenization, and direct card data.

Part of the Certification guide. Mark your scope on that page before you run these cases. Base payloads and test cards are on the Reference page.


1. Connectivity and authentication

Two authentication methods exist. The bearer-token flow in 1.1 is the default and applies to every integration. Basic Authentication in 1.2 is an alternative that FlexFactor must enable on your account.

1.1 Bearer token

Applies to: CORE. Tokens live for 10 minutes. Cache the token and request a new one only after a 401. One token request for many API calls is the expected pattern; the Solutions engineer can see the token-request rate on the sandbox side.

Reference: Authentication, /health, Workflows §1.

IDScenarioSetup / actionExpected resultEvidence
AUTH-01Health checkGET /v1/health with no authenticationHTTP 200 with an empty bodyHTTP status
AUTH-02Token issuedPOST /v1/oauth2/token with valid appKey and appSecretHTTP 200; accessToken and expires present; expires is a Unix-epoch timestamp in milliseconds 10 minutes after issueResponse without the token value
AUTH-03Invalid credentialsPOST /v1/oauth2/token with a wrong appSecretHTTP 401; no token issuedHTTP status, traceId
AUTH-04Invalid bearer, then refresh and retryPOST /v1/evaluate with the base CIT payload and a malformed bearer token. Request a new token and resend the same request one timeThe first response is HTTP 401. The resend returns HTTP 200 with status APPROVEDBoth HTTP statuses, orderId

1.2 Basic Authentication

Applies to: BASIC-AUTH. The credential is the API Key and API Secret joined by a single period, Base64-encoded, and sent as Authorization: Basic {credential} on every request. No call to /oauth2/token is made. The credential does not expire, so a 401 is a credential defect; log it and raise an alert rather than retrying. Build the header on the server. The encoding is not encryption, so the header must travel over HTTPS only.

Reference: Basic Authentication.

IDScenarioSetup / actionExpected resultEvidence
BASIC-AUTH-01Request authenticated with the Basic headerPOST /v1/evaluate with the base CIT payload and Authorization: Basic base64({API Key}.{API Secret})HTTP 200; status APPROVED; orderId presentorderId
BASIC-AUTH-02Wrong secretRepeat BASIC-AUTH-01 with an incorrect API SecretHTTP 401; no order createdHTTP status, traceId
BASIC-AUTH-03Malformed credentialRepeat BASIC-AUTH-01 twice: once with the API Key and API Secret joined by a colon, once with the plain {API Key}.{API Secret} string after Basic with no Base64 encodingHTTP 401 both times; no order createdHTTP statuses, traceId
BASIC-AUTH-04Basic header on every endpointRun the in-scope cases in Sections 8 to 11 with the Basic header on /capture, /cancel, /refund, and GET /v1/orders/{id}Each call returns the same result as it does with a bearer tokenHTTP statuses

2. Tokenization and card data

2.1 Tokenized path

Applies to: TOKENIZE. /tokenize is authenticated by the mid and environment query parameters, not by a bearer token. Store the token with the BIN, last 4 digits, expiry month and year, and holder name, because the /evaluate payload requires those fields alongside the token.

Reference: /tokenize, Sandbox Test Cards, Appendix B.

IDScenarioSetup / actionExpected resultEvidence
TOKENIZE-01Tokenize a cardPOST /v1/tokenize?mid={mid}&environment={tokenizationKey} with card 4000002760003184, any future expiry, first and last nameHTTP 200; transaction.payment_method.token is a GUID; last_four_digits is 3184; first_six_digits is 400000Token GUID
TOKENIZE-02Token used in evaluateBase CIT payload with paymentMethod.cardNumber = token from TOKENIZE-01 and token: trueHTTP 200; status is APPROVEDorderId
TOKENIZE-03Invalid card number/tokenize with number = 4000000000000000HTTP 400 with an errors objecttraceId
TOKENIZE-04Wrong tokenization key/tokenize with an incorrect environment valueHTTP 401 or 403; no token issuedHTTP status

2.2 Direct card data path

Applies to: DIRECT-CARD. Requires a PCI AOC on file and enablement by FlexFactor.

Reference: Workflows §4, Appendix A.1.

IDScenarioSetup / actionExpected resultEvidence
DIRECT-CARD-01Raw PAN acceptedBase CIT payload with paymentMethod.cardNumber = 4000002760003184, token: false, verificationValue omittedHTTP 200; status is APPROVEDorderId
DIRECT-CARD-02CVV sent on CITBase CIT payload with card 4111111111111111, token: false, verificationValue = 999, any name other than Cure TesterHTTP 200; status is APPROVEDorderId


Did this page help you?