Skip to content

Test Bank Cards

Sangho uses Braintree to process bank card payments. In Sandbox, use the standard Braintree card numbers to simulate different scenarios — no real charge is ever made.

Test cards

NumberBrandBehaviorError Code
4111 1111 1111 1111Visa✅ Payment succeeds
5500 0000 0000 0004Mastercard✅ Payment succeeds
4000 0000 0000 0002Visa❌ Card declinedCARD_DECLINED
4000 0000 0000 9995Visa❌ Insufficient fundsINSUFFICIENT_FUNDS
4000 0000 0000 3220Visa🔐 Triggers 3DS
4000 0000 0000 0069Visa❌ Expired cardCARD_EXPIRED
4000 0000 0000 0127Visa❌ Incorrect CVVINCORRECT_CVC
Data common to all test cards

Expiration date: any future date, e.g. 12/28 · CVV: 123 · Postal code: 75001

3D Secure in Sandbox

Use card 4000 0000 0000 3220 to trigger the 3DS flow. In Sandbox, the authentication form is simulated and accepts any OTP code.

Card error codes

These card codes surface in the error’s code field, in the same format as the rest of the API.

Error CodeDescription
CARD_DECLINEDCard declined by the issuing bank.
INSUFFICIENT_FUNDSInsufficient funds in the account.
CARD_EXPIREDExpiration date has passed.
INCORRECT_CVCIncorrect CVV.

Card Form (Braintree Hosted Fields)

The @sanghosdk/js SDK is a server-side client — it does not expose a browser-side card widget. The Hosted Fields form is served directly by the Sangho-hosted checkout page (intent.url): your frontend has nothing to mount itself, it simply redirects the client to that URL as in the other integration guides.

3DS Flow

javascript
import Sangho from '@sanghosdk/js';


const sangho = new Sangho(process.env.SANGHO_TEST_KEY!);


// Card 4000 0000 0000 3220 automatically triggers 3DS
const intent = await sangho.paymentIntents.create({
  amount: 5000,
  currency: 'XAF',
  payment_method_types: ['card'],
});


// Redirect the client to intent.url: Sangho handles the card form
// and the 3DS flow on the hosted checkout page
const confirmed = await sangho.paymentIntents.confirm(intent.id, {
  payment_method: 'pm_card_threeDSecure2Required',
});


console.log(confirmed.status); // 'succeeded' after authentication