Skip to main content

CyberSource

Quick Start
  1. Sign up at cybersource.com and obtain API credentials
  2. Create a terminal in the Admin Console with the parameters below
  3. Start processing — the adapter is pre-built and ready to use

Go to CyberSource →

Overview

Cybersource (Visa) — Payments (payment processor)

Provider IDcybersource
CategoryCard Processors
Websitecybersource.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

ParameterDescription
base_urlBase API URL
merchant_accountMerchant Account ID
api_keyAPI Key ID
api_secretAPI Secret (Base64)

Status Mapping

Provider Status4pay StatusDescription
PAIDChargedPayment completed
AUTHORIZEDCharged (with capture)Payment authorized
SUCCEEDEDChargedSuccessful transaction
TRANSMITTEDChargedTransmitted in bank
DECLINEDFailurePayment declined
FAILEDFailureProcessing error
REJECTEDFailureTransaction declined
INVALID_REQUESTFailureInvalid request
SERVER_ERRORFailureError server
VOIDEDFailurePayment annulled
REVERSEDFailurePayment returned
CANCELLEDFailurePayment cancelled

Testing

Sandbox URL

https://apitest.cybersource.com

Test Cards

CardNumberCVVExpResult
Visa4111 1111 1111 1111any 3 digits12/2028Successful payment
Mastercard5555 5555 5555 4444any 3 digits12/2028Successful payment
Mastercard (2-series)2222 4200 0000 1113any 3 digits12/2028Successful payment
Amex3782 8224 6310 005any 4 digits12/2028Successful payment
Discover6011 1111 1111 1117any 3 digits12/2028Successful payment
JCB3566 1111 1111 1113any 3 digits12/2028Successful payment

Resources