Overview
Your server calls the API; your customer's browser only ever visits your checkout, the 3-D Secure page we host, and your return URL. A card payment takes four steps.
- Get credentials. Finish onboarding, then generate test credentials on your application page: an API key, an API secret and your store identifier.
- Create the payment. Your server sends the order, customer and card to
POST /payments. - Complete 3-D Secure. If the response has
serverAuthentication: true, redirect the customer's browser toredirectUrl. Their bank may ask them to confirm; then we send them back to yourreturnUrl. - Confirm the result. Check the payment from your server with
GET /payments/{transactionReference}or wait for the webhook. Never rely on the browser redirect alone.
Card numbers and security codes pass through our servers to the card network and are never stored. Because your server handles card data, your business must meet the PCI DSS requirements that apply to you.
Authentication
Send these headers with every request. Credentials are issued per business from your application page in the dashboard; the secret is shown once, when you generate it.
| Header | Required | Description |
|---|---|---|
X-Api-Key | Required | Your key ID. Test keys start ok_test_, live keys ok_live_. |
X-Api-Secret | Required | The secret issued with the key (sk_test_… or sk_live_…). |
X-Store-Identifier | Required | Your business's store identifier, e.g. MCH10234, shown with your credentials. |
Idempotency-Key | Optional | Same as the idempotencyKey body field. See Idempotency. |
Content-Type | For POST | application/json |
- Keep the secret on your server. Never put it in a mobile app, browser code or a public repository. The API doesn't allow calls from browsers.
- All requests must use HTTPS.
- Regenerating a key revokes the old one immediately.
IP whitelisting
You can ask us to accept API calls only from your servers' IP addresses. Our IT team adds them (single addresses or CIDR ranges) separately for test and live keys; you can see your list on the API keys page. Once a mode has addresses, calls from anywhere else are refused with 403 IP_NOT_ALLOWED, and the message shows the address we saw. If your servers sit behind a NAT gateway or load balancer, give us its outbound address.
To check your setup, call GET /ping. It returns which mode and gateway your keys use.
curl https://www.msiaoculus.com/api/v1/ping \
-H "X-Api-Key: ok_test_7Kq2mWn4Xc8Rb3Hd9Tf6Ys2Lp" \
-H "X-Api-Secret: $OCULUS_API_SECRET" \
-H "X-Store-Identifier: MCH10234"
{
"statusCode": 200,
"status": "SUCCESS",
"data": {
"mode": "TEST",
"storeIdentifier": "MCH10234",
"businessName": "Kola Foods",
"gateway": "MPGS"
}
}
Test and live
There is one base URL. Your key decides the mode.
| Mode | Key prefix | What happens |
|---|---|---|
| Test | ok_test_ | Payments go to a test processing account. No real money moves. Use the test cards. |
| Live | ok_live_ | Payments go to your business's live processing account. Available after IT approves your go-live. |
Base URL: https://www.msiaoculus.com/api/v1
Test and live payments are kept apart: a test key can't see live payments, and the other way round.
/api/v1/paymentsCreate payment
Creates a payment and, unless 3-D Secure is needed, authorizes it straight away. With useGatewayAuthentication: true the payment usually comes back as PENDING_AUTHENTICATION with a redirectUrl; see 3-D Secure.
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
orderId | string | Required | Your order ID, up to 40 characters. Shown to you in reports and webhooks. |
amount | decimal | Required | Amount in major units, e.g. 100.50. Most currencies allow two decimal places; JPY and XOF allow none. |
currency | string | Required | ISO 4217 three-letter code, e.g. NGN, USD. |
customer.firstName | string | Required | Customer's first name. |
customer.lastName | string | Required | Customer's last name. |
customer.email | string | Required | A valid email address. |
customer.address.street | string | Required | Billing street address. |
customer.address.city | string | Required | City. |
customer.address.state | string | Required | State or province. |
customer.address.country | string | Required | ISO 3166 alpha-3 code, e.g. NGA, SLE, USA. |
customer.address.phoneNumber | string | Required | International format: +, country code, a space, then the number, e.g. +234 8031234567. |
customer.address.zipPostalCode | string | Required | ZIP or postal code. |
customer.address.mobilePhone | string | Optional | Mobile number in the same format. |
card.cardNumber | string | Required | Card number. Never log or store it. |
card.expiryMonth | string | Required | Two digits, 01 to 12. |
card.expiryYear | string | Required | Four digits, e.g. 2029. |
card.cvv | string | Required | 3 or 4 digit security code. Never store it. |
card.nameOnCard | string | Optional | Defaults to the customer's first and last name. |
useGatewayAuthentication | boolean | Required | true to have us run 3-D Secure. Strongly recommended; many issuers decline cards without it. Not yet available for CyberSource accounts. |
captureOnAuthorization | boolean | Optional | Default true: take the money as soon as it's authorized. Send false to authorize only and capture later. |
returnUrl | string | Required | https URL the customer's browser returns to after 3-D Secure. In test mode, http://localhost is allowed. |
idempotencyKey | string | Required | Unique key for this payment, up to 64 characters. Or send the Idempotency-Key header. |
Request
curl -X POST https://www.msiaoculus.com/api/v1/payments \
-H "Content-Type: application/json" \
-H "X-Api-Key: $OCULUS_API_KEY" \
-H "X-Api-Secret: $OCULUS_API_SECRET" \
-H "X-Store-Identifier: MCH10234" \
-d '{
"orderId": "1646794917",
"amount": 100.50,
"currency": "USD",
"customer": {
"firstName": "Ada",
"lastName": "Okafor",
"email": "ada.okafor@example.com",
"address": {
"street": "12 Admiralty Way",
"city": "Lagos",
"state": "LA",
"country": "NGA",
"phoneNumber": "+234 8031234567",
"zipPostalCode": "106104"
}
},
"card": {
"cardNumber": "5123450000000008",
"expiryMonth": "01",
"expiryYear": "2039",
"cvv": "100",
"nameOnCard": "Ada Okafor"
},
"useGatewayAuthentication": true,
"captureOnAuthorization": true,
"returnUrl": "https://shop.example.com/checkout/complete",
"idempotencyKey": "1199679095"
}'
using System.Net.Http.Json;
var http = new HttpClient { BaseAddress = new Uri("https://www.msiaoculus.com/api/v1/") };
http.DefaultRequestHeaders.Add("X-Api-Key", Environment.GetEnvironmentVariable("OCULUS_API_KEY"));
http.DefaultRequestHeaders.Add("X-Api-Secret", Environment.GetEnvironmentVariable("OCULUS_API_SECRET"));
http.DefaultRequestHeaders.Add("X-Store-Identifier", "MCH10234");
var response = await http.PostAsJsonAsync("payments", new
{
orderId = "1646794917",
amount = 100.50m,
currency = "USD",
customer = new
{
firstName = "Ada",
lastName = "Okafor",
email = "ada.okafor@example.com",
address = new
{
street = "12 Admiralty Way",
city = "Lagos",
state = "LA",
country = "NGA",
phoneNumber = "+234 8031234567",
zipPostalCode = "106104"
}
},
card = new { cardNumber = "5123450000000008", expiryMonth = "01", expiryYear = "2039", cvv = "100" },
useGatewayAuthentication = true,
captureOnAuthorization = true,
returnUrl = "https://shop.example.com/checkout/complete",
idempotencyKey = Guid.NewGuid().ToString("N")
});
var result = await response.Content.ReadFromJsonAsync<System.Text.Json.JsonElement>();
if (result.TryGetProperty("serverAuthentication", out var sa) && sa.GetBoolean())
{
// Redirect the customer's browser to result.redirectUrl (see 3-D Secure).
}
// Node.js 18+ (server side only: never call the API from a browser)
const res = await fetch("https://www.msiaoculus.com/api/v1/payments", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": process.env.OCULUS_API_KEY,
"X-Api-Secret": process.env.OCULUS_API_SECRET,
"X-Store-Identifier": "MCH10234"
},
body: JSON.stringify({
orderId: "1646794917",
amount: 100.50,
currency: "USD",
customer: {
firstName: "Ada",
lastName: "Okafor",
email: "ada.okafor@example.com",
address: {
street: "12 Admiralty Way", city: "Lagos", state: "LA", country: "NGA",
phoneNumber: "+234 8031234567", zipPostalCode: "106104"
}
},
card: { cardNumber: "5123450000000008", expiryMonth: "01", expiryYear: "2039", cvv: "100" },
useGatewayAuthentication: true,
captureOnAuthorization: true,
returnUrl: "https://shop.example.com/checkout/complete",
idempotencyKey: crypto.randomUUID()
})
});
const result = await res.json();
if (result.serverAuthentication) {
// Redirect the customer's browser to result.redirectUrl
}
{
"orderId": "1646794917",
"amount": 100.50,
"currency": "USD",
"customer": {
"firstName": "Ada",
"lastName": "Okafor",
"email": "ada.okafor@example.com",
"address": {
"street": "12 Admiralty Way",
"city": "Lagos",
"state": "LA",
"country": "NGA",
"phoneNumber": "+234 8031234567",
"zipPostalCode": "106104",
"mobilePhone": "+234 8031234567"
}
},
"card": {
"nameOnCard": "Ada Okafor",
"cardNumber": "5123450000000008",
"expiryMonth": "01",
"expiryYear": "2039",
"cvv": "100"
},
"useGatewayAuthentication": true,
"captureOnAuthorization": true,
"returnUrl": "https://shop.example.com/checkout/complete",
"idempotencyKey": "1199679095"
}
Response: 3-D Secure needed
{
"statusCode": 201,
"status": "SUCCESS",
"serverAuthentication": true,
"redirectUrl": "https://www.msiaoculus.com/pay/v1/authenticate/Qm7vX2cK9pLr4sT8wYb3nZ6hJd5fGa2eR",
"authenticationTransactionId": "auth-1",
"payment": {
"reference": "pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J",
"orderId": "1646794917",
"mode": "TEST",
"gateway": "MPGS",
"amount": 100.50,
"currency": "USD",
"status": "PENDING_AUTHENTICATION",
"capturedAmount": 0,
"refundedAmount": 0,
"card": { "brand": "MASTERCARD", "bin": "512345", "last4": "0008" },
"customer": { "firstName": "Ada", "lastName": "Okafor", "email": "ada.okafor@example.com" },
"response": {},
"authentication": { "transactionId": "auth-1", "status": "AUTHENTICATION_AVAILABLE" },
"transactions": [
{ "id": "auth-1", "type": "AUTHENTICATION", "result": "SUCCESS", "gatewayCode": "AUTHENTICATION_AVAILABLE", "createdAt": "2026-11-18T14:15:09.112Z" }
],
"createdAt": "2026-11-18T14:15:08.904Z",
"updatedAt": "2026-11-18T14:15:09.512Z"
}
}
Response: authorized without a redirect
When useGatewayAuthentication is false, or the card isn't enrolled in 3-D Secure and the gateway allows paying without it, the result comes back straight away. A decline is still 201: read payment.status.
{
"statusCode": 201,
"status": "SUCCESS",
"serverAuthentication": false,
"payment": {
"reference": "pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J",
"orderId": "1646794917",
"mode": "TEST",
"gateway": "MPGS",
"amount": 100.50,
"currency": "USD",
"status": "CAPTURED",
"capturedAmount": 100.50,
"refundedAmount": 0,
"authorizationCode": "295526",
"card": { "brand": "MASTERCARD", "bin": "512345", "last4": "0008" },
"customer": { "firstName": "Ada", "lastName": "Okafor", "email": "ada.okafor@example.com" },
"response": { "gatewayCode": "APPROVED", "acquirerCode": "00", "acquirerMessage": "Approved" },
"transactions": [
{ "id": "pay-1", "type": "PAY", "amount": 100.50, "currency": "USD", "result": "SUCCESS", "gatewayCode": "APPROVED", "createdAt": "2026-11-18T14:15:09.733Z" }
],
"createdAt": "2026-11-18T14:15:08.904Z",
"updatedAt": "2026-11-18T14:15:09.733Z"
}
}
Error response
{
"statusCode": 400,
"status": "ERROR",
"error": {
"cause": "INVALID_REQUEST",
"explanation": "customer.address.phoneNumber must be in international format: +, country code, a space, then the number, e.g. +234 8031234567.",
"field": "customer.address.phoneNumber",
"validationType": "INVALID"
}
}
redirectUrl3-D Secure
When the create response has serverAuthentication: true, send the customer's browser to redirectUrl with a normal redirect (HTTP 302/303 or window.location). Don't open it in an iframe.
- Our page collects the browser details the bank needs and runs the bank's device check.
- The bank decides: approve without a challenge, or ask the customer to confirm (one-time code, banking app, etc.).
- We check the result with the gateway, authorize the payment if authentication passed, and send a webhook.
- The browser returns to your
returnUrl. Confirm the outcome from your server before fulfilling the order.
| Response field | Description |
|---|---|
serverAuthentication | true when the customer must be redirected to complete 3-D Secure. |
redirectUrl | Single-use link to our 3-D Secure page. Valid for 30 minutes; after that the payment becomes EXPIRED. |
authenticationTransactionId | ID of the authentication transaction on the payment. |
// ASP.NET Core: after creating the payment on the server
if (result.GetProperty("serverAuthentication").GetBoolean())
return Redirect(result.GetProperty("redirectUrl").GetString()!);
return RedirectToAction("Complete", new { reference = result.GetProperty("payment").GetProperty("reference").GetString() });
// Express: after creating the payment on the server
if (result.serverAuthentication) {
return res.redirect(303, result.redirectUrl);
}
return res.redirect(303, `/checkout/complete?reference=${result.payment.reference}`);
For CyberSource accounts, gateway-managed 3-D Secure isn't available in v1 yet: send useGatewayAuthentication: false, or the API answers 422 NOT_SUPPORTED.
/api/v1/payments/{transactionReference}Retrieve payment
Returns the payment as it is now. transactionReference is the reference we returned (pay_…) or your orderId.
curl https://www.msiaoculus.com/api/v1/payments/pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J \
-H "X-Api-Key: $OCULUS_API_KEY" \
-H "X-Api-Secret: $OCULUS_API_SECRET" \
-H "X-Store-Identifier: MCH10234"
A successful response is 200 with the same payment object as above. An unknown reference returns:
{
"statusCode": 404,
"status": "ERROR",
"error": {
"cause": "NOT_FOUND",
"explanation": "No payment with reference or orderId 'pay_unknown' for this store and mode.",
"field": "transactionReference",
"validationType": "INVALID"
}
}
/api/v1/payments/{transactionReference}/captureCapture
Takes the money for a payment created with captureOnAuthorization: false. Only AUTHORIZED payments can be captured. Authorizations usually expire after about 7 days, depending on the card issuer.
| Field | Type | Required | Description |
|---|---|---|---|
amount | decimal | Optional | Up to the authorized amount. Defaults to the full amount. |
idempotencyKey | string | Optional | Recommended, so a retry can't capture twice. |
{ "amount": 100.50, "idempotencyKey": "cap-1646794917" }
Returns 200 with the payment, now CAPTURED.
/api/v1/payments/{transactionReference}/refundRefund
Refunds all or part of a captured payment. You can refund several times until the captured amount is used up.
| Field | Type | Required | Description |
|---|---|---|---|
amount | decimal | Required | Amount to refund, up to what hasn't been refunded yet. |
currency | string | Required | Must match the payment's currency. |
reason | string | Optional | Your note, up to 200 characters. |
idempotencyKey | string | Required | Unique per refund. Or send the Idempotency-Key header. |
{
"amount": 50.00,
"currency": "USD",
"reason": "Customer returned one item",
"idempotencyKey": "rf-1646794917-1"
}
{
"statusCode": 200,
"status": "SUCCESS",
"payment": {
"reference": "pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J",
"orderId": "1646794917",
"status": "PARTIALLY_REFUNDED",
"amount": 100.50,
"currency": "USD",
"capturedAmount": 100.50,
"refundedAmount": 50.00,
"transactions": [
{ "id": "pay-1", "type": "PAY", "amount": 100.50, "currency": "USD", "result": "SUCCESS", "gatewayCode": "APPROVED", "createdAt": "2026-11-18T14:15:09.733Z" },
{ "id": "refund-1", "type": "REFUND", "amount": 50.00, "currency": "USD", "result": "SUCCESS", "gatewayCode": "APPROVED", "createdAt": "2026-11-19T09:02:41.207Z" }
]
}
}
The payment object is abbreviated here; the full object is returned.
/api/v1/payments/{transactionReference}/voidVoid
Cancels an authorization, or a capture before it settles (usually the same day). After settlement, use a refund instead. Voiding a payment's PAY or AUTHORIZE transaction makes it VOIDED; voiding a separate CAPTURE returns it to AUTHORIZED.
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Optional | The approved transaction to void (from payment.transactions). Defaults to the latest approved one. |
idempotencyKey | string | Required | Unique per void. Or send the Idempotency-Key header. |
{ "transactionId": "pay-1", "idempotencyKey": "void-1646794917" }
Returns 200 with the payment. A void the gateway refuses (for example, already settled) returns 402 with cause: "DECLINED".
Return URL
After 3-D Secure we redirect the customer's browser to your returnUrl with these query parameters:
https://shop.example.com/checkout/complete?reference=pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J&orderId=1646794917&status=CAPTURED
The return URL is for the customer's browser only. Anyone can type a URL with status=CAPTURED, so never fulfil an order from these parameters. Call Retrieve payment from your server, or use the webhook.
Webhooks
Add a webhook URL under API and webhooks on your application page. We then send a signed POST when something happens to a payment:
| notificationType | Sent when |
|---|---|
PAYMENT | A payment is authorized, captured, declined, fails, expires or is voided. |
AUTHENTICATION | 3-D Secure finishes, whether it passed or failed. |
REFUND | A full or partial refund is approved. |
TEST | You select Send test notification in the dashboard. |
Delivery and retries
Reply with any 2xx status within 15 seconds. Otherwise we retry after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, then stop. Notifications can arrive more than once or out of order: use notificationId to ignore duplicates, and treat the payment status from Retrieve payment as the final word. Your URL must be https and reachable on the public internet.
Headers
| Header | Description |
|---|---|
X-Oculus-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256>. See below. |
X-Oculus-Notification-Id | Same as notificationId in the body. |
X-Oculus-Notification-Type | PAYMENT, AUTHENTICATION, REFUND or TEST. |
X-Oculus-Attempt | 1 for the first try, then 2, 3 and so on. |
Verify the signature
Compute HMAC-SHA256 of {t}.{raw request body} using your webhook signing secret (whsec_…, shown once in the dashboard), hex-encode it, and compare it with v1 in constant time. Reject the request if they differ or if t is more than 5 minutes old. Use the raw body exactly as received, before any JSON parsing.
using System.Security.Cryptography;
using System.Text;
static bool IsValidOculusSignature(string header, string rawBody, string secret)
{
var parts = header.Split(',').Select(p => p.Split('=', 2)).Where(p => p.Length == 2)
.ToDictionary(p => p[0].Trim(), p => p[1].Trim());
if (!parts.TryGetValue("t", out var t) || !parts.TryGetValue("v1", out var v1)) return false;
if (!long.TryParse(t, out var ts) || Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - ts) > 300) return false;
var expected = Convert.ToHexString(HMACSHA256.HashData(
Encoding.UTF8.GetBytes(secret), Encoding.UTF8.GetBytes($"{t}.{rawBody}"))).ToLowerInvariant();
return CryptographicOperations.FixedTimeEquals(Encoding.ASCII.GetBytes(expected), Encoding.ASCII.GetBytes(v1));
}
// Express: use express.raw({ type: "application/json" }) on this route so req.body is the raw Buffer
const crypto = require("crypto");
function isValidOculusSignature(header, rawBody, secret) {
const parts = Object.fromEntries(header.split(",").map(p => p.trim().split("=", 2)));
const t = Number(parts.t);
if (!t || !parts.v1 || Math.abs(Date.now() / 1000 - t) > 300) return false;
const expected = crypto.createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
const a = Buffer.from(expected), b = Buffer.from(parts.v1);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
Payloads
{
"notificationId": "ntf_V7nq2KxR8mLw3Tb9Hc5Yd4Jf",
"notificationType": "PAYMENT",
"mode": "TEST",
"storeIdentifier": "MCH10234",
"order": {
"id": "1646794917",
"reference": "pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J",
"amount": 100.50,
"currency": "USD",
"status": "CAPTURED",
"totalCapturedAmount": 100.50,
"totalRefundedAmount": 0
},
"transaction": {
"id": "pay-1",
"type": "PAY",
"amount": 100.50,
"currency": "USD",
"authorizationCode": "295526"
},
"result": "SUCCESS",
"response": {
"gatewayCode": "APPROVED",
"acquirerCode": "00",
"acquirerMessage": "Approved"
},
"timeOfRecord": "2026-11-18T14:15:14.415Z"
}
{
"notificationId": "ntf_Kd3mP8wQ2xRn7Lv4Tb9Yc5Hj",
"notificationType": "AUTHENTICATION",
"mode": "TEST",
"storeIdentifier": "MCH10234",
"order": {
"id": "1646794917",
"reference": "pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J",
"amount": 100.50,
"currency": "USD",
"status": "PENDING_AUTHENTICATION",
"totalCapturedAmount": 0,
"totalRefundedAmount": 0
},
"authentication": {
"transactionId": "auth-1",
"status": "AUTHENTICATION_SUCCESSFUL"
},
"result": "SUCCESS",
"response": {},
"timeOfRecord": "2026-11-18T14:15:13.902Z"
}
{
"notificationId": "ntf_Wb6nK2xQ9mRt3Lp7Vc4Hy8Jd",
"notificationType": "REFUND",
"mode": "TEST",
"storeIdentifier": "MCH10234",
"order": {
"id": "1646794917",
"reference": "pay_8fK2mQx7Lw3Rn9Tb5Vc4Hy6J",
"amount": 100.50,
"currency": "USD",
"status": "PARTIALLY_REFUNDED",
"totalCapturedAmount": 100.50,
"totalRefundedAmount": 50.00
},
"transaction": {
"id": "refund-1",
"type": "REFUND",
"amount": 50.00,
"currency": "USD",
"reason": "Customer returned one item"
},
"result": "SUCCESS",
"response": {
"gatewayCode": "APPROVED",
"acquirerCode": "00",
"acquirerMessage": "Approved"
},
"timeOfRecord": "2026-11-19T09:02:41.512Z"
}
Idempotency
Networks fail. If you don't get a response, send the same request again with the same idempotency key: you get the original result instead of a second charge.
- Keys are scoped to your store and mode, and to the operation (create, capture, refund, void).
- Reusing a key with different values (a different amount, say) returns
409 IDEMPOTENCY_MISMATCH. - If the first request is still running, a repeat returns
409 CONFLICT; wait a moment and check the payment. - If the gateway couldn't be reached (
502 GATEWAY_UNAVAILABLE) on a capture, refund or void, retrying with the same key tries again. For a new payment, check it with Retrieve payment first.
Testing
Use your test key with these cards. On MPGS test accounts, the expiry date chooses the outcome and the CVV chooses the security code result. The exact behaviour comes from the gateway's test simulator, so results can vary slightly between acquirers.
| Card | Number |
|---|---|
| Mastercard | 5123 4500 0000 0008 |
| Mastercard (2-series) | 2223 0000 0000 0007 |
| Visa | 4508 7500 1574 1019 |
| Expiry | Result |
|---|---|
01/2039 | APPROVED |
05/2039 | DECLINED |
04/2027 | EXPIRED_CARD |
08/2028 | TIMED_OUT |
01/2037 | ACQUIRER_SYSTEM_ERROR |
02/2037 | UNSPECIFIED_FAILURE |
05/2037 | UNKNOWN |
| CVV | Result |
|---|---|
100 | MATCH |
101 | NOT_PROCESSED |
102 | NO_MATCH |
With useGatewayAuthentication: true, test cards go through Mastercard's 3-D Secure test environment, where the challenge page is simulated.
CyberSource test accounts: use 4111 1111 1111 1111 with any future expiry date and any 3-digit CVV for an approval.
Statuses and codes
Payment status
| status | Meaning |
|---|---|
PENDING_AUTHENTICATION | Waiting for the customer to complete 3-D Secure. |
AUTHORIZED | Approved and reserved on the card, not yet captured. |
CAPTURED | Approved and captured. The money will settle to you. |
PARTIALLY_REFUNDED | Part of the captured amount has been refunded. |
REFUNDED | The whole captured amount has been refunded. |
VOIDED | Cancelled before settlement. |
DECLINED | The issuer or acquirer declined it. See response.gatewayCode. |
AUTHENTICATION_FAILED | 3-D Secure failed or wasn't allowed for this card. |
FAILED | The gateway rejected the request or couldn't be reached. |
EXPIRED | The customer didn't finish 3-D Secure within 30 minutes. |
Gateway response codes
response.gatewayCode explains the outcome; response.acquirerCode is the raw code from the acquirer, when there is one.
| gatewayCode | Status | Meaning |
|---|---|---|
APPROVED | AUTHORIZED / CAPTURED | Approved. |
DECLINED | DECLINED | Declined by the issuer. |
INSUFFICIENT_FUNDS | DECLINED | Not enough funds. |
EXPIRED_CARD | DECLINED | The card has expired. |
DECLINED_INVALID_CSC | DECLINED | The security code was wrong (CyberSource). |
TIMED_OUT | DECLINED | The issuer didn't answer in time. Safe to try again. |
ACQUIRER_SYSTEM_ERROR | DECLINED / FAILED | The acquirer had a problem. Try again later. |
UNSPECIFIED_FAILURE | DECLINED / FAILED | The payment failed for an unspecified reason. |
UNKNOWN | FAILED | The outcome couldn't be confirmed. Check the payment before retrying. |
EXPIRED | EXPIRED | 3-D Secure wasn't completed in time. |
API errors
| HTTP | cause | Meaning |
|---|---|---|
| 400 | INVALID_REQUEST | A field is missing or invalid. error.field names it; validationType is MISSING or INVALID. |
| 401 | UNAUTHORIZED | Wrong or expired key, secret or store identifier. |
| 402 | DECLINED | A capture, refund or void was declined by the gateway. |
| 403 | FORBIDDEN | Your business or processing account isn't active for this mode. |
| 403 | IP_NOT_ALLOWED | The request came from an address that isn't on your IP whitelist. |
| 404 | NOT_FOUND | No payment with that reference for this store and mode. |
| 409 | INVALID_STATE | The payment's status doesn't allow this (e.g. refunding an authorization). |
| 409 | IDEMPOTENCY_MISMATCH / CONFLICT | See Idempotency. |
| 422 | NOT_SUPPORTED | The feature isn't available for your account (e.g. 3-D Secure on CyberSource). |
| 429 | — | Too many requests. Slow down and retry. |
| 502 | GATEWAY_UNAVAILABLE | The card gateway couldn't be reached or didn't confirm the outcome. |
| 503 | SANDBOX_UNAVAILABLE | No test processing account is available. Contact support. |
Going live
- Run test payments that approve, decline and go through 3-D Secure, plus a refund and a void.
- Check that your server confirms each result with Retrieve payment or a verified webhook before fulfilling orders.
- On your application page, select Request go-live. IT reviews your test payments and switches you to live.
- Generate live credentials, put them in your server's secret store, and swap them in. Nothing else changes.
Questions? Email info@msiaoculus.com with your store identifier and the payment reference. Never send API secrets or full card numbers.