CyberSource
Quick Start
- Sign up at cybersource.com and obtain API credentials
- Create a terminal in the Admin Console with the parameters below
- Start processing — the adapter is pre-built and ready to use
Overview
Cybersource (Visa) — Payments (payment processor)
| Provider ID | cybersource |
| Category | Card Processors |
| Website | cybersource.com |
Supported operations: Authorize with Capture (payments_authorize) Status (payments_status)
Authentication
Method: HMAC SHA-256 Signature (Headers-based)
Complex scheme signing with multiple stages:
Step 1: Digest for POST requests
digest = "SHA-256=" + base64(sha256(request_body))
Step 2: Signature Base String
signature_string =
"host: {host}\n" +
"date: {rfc7231_date}\n" +
"(request-target): {method} {path}\n" + // lowercase method!
"digest: {digest}\n" + // only for POST
"v-c-merchant-id: {merchant_id}"
Step 3: HMAC Signature
signature = base64(hmac_sha256(signature_string, base64_decode(api_secret)))
Step 4: Authorization Header
Authorization: Signature
keyid="{api_key}",
algorithm="HmacSHA256",
headers="host date (request-target) digest v-c-merchant-id",
signature="{signature}"
Additional headers:
v-c-merchant-id: {merchant_account}
Date: {rfc7231_date}
Digest: SHA-256={digest}
Configuration
Required Parameters
| Parameter | Description |
|---|---|
base_url | Base API URL |
merchant_account | Merchant Account ID |
api_key | API Key ID |
api_secret | API Secret (Base64) |
Status Mapping
| Provider Status | 4pay Status | Description |
|---|---|---|
PAID | Charged | Payment completed |
AUTHORIZED | Charged (with capture) | Payment authorized |
SUCCEEDED | Charged | Successful transaction |
TRANSMITTED | Charged | Transmitted in bank |
DECLINED | Failure | Payment declined |
FAILED | Failure | Processing error |
REJECTED | Failure | Transaction declined |
INVALID_REQUEST | Failure | Invalid request |
SERVER_ERROR | Failure | Error server |
VOIDED | Failure | Payment annulled |
REVERSED | Failure | Payment returned |
CANCELLED | Failure | Payment cancelled |
Testing
Sandbox URL
https://apitest.cybersource.com
Test Cards
| Card | Number | CVV | Exp | Result |
|---|---|---|---|---|
| Visa | 4111 1111 1111 1111 | any 3 digits | 12/2028 | Successful payment |
| Mastercard | 5555 5555 5555 4444 | any 3 digits | 12/2028 | Successful payment |
| Mastercard (2-series) | 2222 4200 0000 1113 | any 3 digits | 12/2028 | Successful payment |
| Amex | 3782 8224 6310 005 | any 4 digits | 12/2028 | Successful payment |
| Discover | 6011 1111 1111 1117 | any 3 digits | 12/2028 | Successful payment |
| JCB | 3566 1111 1111 1113 | any 3 digits | 12/2028 | Successful payment |