# Test stablecoin-backed cards

Connect a Stripe sandbox to a Bridge sandbox and simulate card purchases that move funds on testnets.

You test a Bridge integration in two connected environments: a Stripe [sandbox](https://docs.stripe.com/sandboxes.md) for cards and transactions, and a Bridge sandbox for customers, verification, and wallets. When you simulate a purchase in the Stripe sandbox, Bridge processes it against the card’s linked wallet. For non-custodial wallets, Bridge submits real onchain transactions on testnets.

If you fund cards from Stripe financial accounts, you only need a Stripe sandbox. See the [financial accounts guide](https://docs.stripe.com/issuing/stablecoin-cards-for-financial-accounts.md#testing).

## Connect your sandboxes

Connect one Stripe sandbox to one Bridge sandbox:

1. [Create a Stripe sandbox](https://dashboard.stripe.com/sandboxes). For commercial programs, enable Connect on the sandbox.
2. Install the [Bridge Cards Stripe App](https://marketplace.stripe.com/apps/install/link/com.stripe.bridge.cards?redirect_uri=https://dashboard.bridge.xyz/app/cards) on the sandbox.
3. Create a [Bridge sandbox API key](https://dashboard.bridge.xyz/app/keys?sandbox=true).
4. Call the Bridge sandbox `cards/enable` endpoint with your Stripe sandbox account ID and program type (`consumer` or `commercial`):

```shell
curl -X POST https://api.sandbox.bridge.xyz/v0/cards/enable \
  -H "Content-Type: application/json" \
  -H "Api-Key: {{BRIDGE_SANDBOX_API_KEY}}" \
  -H "Idempotency-Key: {{IDEMPOTENCY_KEY}}" \
  -d '{"stripe_account_id": "{{SANDBOX_ACCOUNT_ID}}", "program_type": "consumer"}'
```

Each Bridge user account has its own sandbox. Connect that sandbox to a Stripe sandbox that your team can share. After you connect them, Stripe enables stablecoin-backed Issuing in the Stripe sandbox.

## Create a test customer and card

Follow the steps in the [integration guide](https://docs.stripe.com/issuing/bridge-stablecoin-cards.md#create-customer) using your sandbox API keys:

- Create a customer with the [Bridge sandbox API](https://api.sandbox.bridge.xyz) and request the `cards` endorsement. Bridge processes most sandbox verification checks within seconds.
- For commercial programs, create cardholders on the connected account that Bridge creates. In a sandbox, you can record the sponsor bank’s terms acceptance with an IP address of `0.0.0.0` and any valid date.
- Create a card with `crypto_wallet` set to a Bridge wallet or to a non-custodial wallet on a testnet.

## Fund a test wallet

Fund the wallet that the card spends from:

- **Bridge wallet**: [Simulate a deposit](https://apidocs.bridge.xyz/platform/wallets/sandbox) into the wallet with the Bridge sandbox API.
- **Non-custodial wallet**: Get test tokens for a supported testnet, then submit an ERC-20 approval or Solana delegation using the values in the following sections. See [set up non-custodial wallet approvals](https://docs.stripe.com/issuing/bridge-stablecoin-cards/noncustodial-wallets.md) for example code.

### Testnets 

Bridge supports non-custodial wallets on these testnets. We recommend Tempo testnet for testing.

#### Tempo testnet (recommended)

- **Stripe card contract**: `0xafF6a11E3043060AA858197e5d976aE13D6fFF17`
- **Approval target**: Spender contract `0x1955a82a01E8c0A31371792b3045341eB8b938e2`
- **Test token**: PathUSD `0x20C0000000000000000000000000000000000000`, available from the [Tempo faucet](https://tempo.xyz/developers/docs/quickstart/faucet)

#### Base Sepolia

- **Stripe card contract**: `0xbeDC4920cC29e6be1F05f928C5d08144D6595ec0`
- **Approval target**: Spender contract `0x8CC0D9e8a157b73d1172a22f5066048Bda46c0e3`
- **Test token**: USDC `0x036CbD53842c5426634e7929541eC2318f3dCF7e`, available from the [Circle faucet](https://faucet.circle.com/)

#### Solana devnet

- **Stripe card program**: `cardWArqhdV5jeRXXjUti7cHAa4mj41Nj3Apc6RPZH2`
- **Approval target**: Program-derived address for merchant ID `1`
- **Test token**: USDC mint `4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU`

On EVM testnets, submit the approval to the spender contract, not the card contract. Program-specific issuer contracts are required only on mainnet, so you don’t need one for testing. For example, this [Foundry](https://getfoundry.sh/) command approves the Tempo testnet spender to pull up to 100 PathUSD, which uses 6 decimals:

```shell
cast send 0x20C0000000000000000000000000000000000000 \
  "approve(address,uint256)" \
  0x1955a82a01E8c0A31371792b3045341eB8b938e2 \
  100000000 \
  --rpc-url https://rpc.moderato.tempo.xyz \
  --private-key {{TEST_WALLET_PRIVATE_KEY}}
```

To approve on Base Sepolia, use the Base Sepolia USDC and spender addresses with `--rpc-url https://sepolia.base.org`.

On Solana devnet, use merchant ID `1` and the devnet USDC mint when you derive the delegate address. Bridge’s [sandbox guide](https://apidocs.bridge.xyz/platform/cards/sandbox/sandbox) includes a complete devnet approval script.

## Simulate purchases

Simulate authorizations, captures, refunds, and disputes with the [Issuing testing tools](https://docs.stripe.com/issuing/testing.md) in the Stripe Dashboard or the API. Bridge processes each simulated authorization against the card’s wallet.

For non-custodial wallets, confirm that each authorization’s `crypto_transactions` field lists the onchain transaction that Bridge submitted, and compare the transaction hash with a block explorer for the testnet:

```json
{
  "id": "iauth_1U3QKmDfQGJXhssyXpOg5EvL",
  "amount": 114,
  "crypto_transactions": [
    {
      "type": "crypto_transaction_confirmed",
      "crypto_transaction_confirmed": {
        "amount": "1.14",
        "chain": "tempo",
        "currency": "path_usd",
        "from_address": "0x1234567890abcdef1234567890abcdef12345678",
        "to_address": "0x1111111111111111111111111111111111111111",
        "transaction_hash": "0xc24fdeceeeefc580c57368fc0325f275ca48d498f584fa7f1454f01fc4f0544b",
        "confirmed_at": 1786495682
      },
      "crypto_transaction_failed": null
    }
  ]
}
```

## Test webhooks

To test webhooks locally, you can use the [Stripe CLI](https://docs.stripe.com/stripe-cli.md) to forward events to your server:

```shell
stripe listen --forward-to localhost:3000/webhooks/stripe
```

Learn more about [authorizations and webhooks](https://docs.stripe.com/issuing/stablecoin-cards/authorizations.md).
