DocsFirst Payment
Back to Quickstart

Your First Payment

This guide walks you through processing a test card payment from start to finish using the OpenPay dashboard and Hyperswitch API.

Step 1: Configure Your Payment Connector

Log into the Hyperswitch dashboard at localhost:8081 and add a payment connector.

  1. 1

    Navigate to Connectors

    Go to Settings → Connectors and click + Add Connector.

  2. 2

    Select Paystack

    Choose Paystack from the list of available connectors.

  3. 3

    Enter API Credentials

    Paste your Paystack Secret Key (from dashboard.paystack.co → Settings → API Keys).

  4. 4

    Enable the Connector

    Toggle the connector to Enabled and click Save.

Step 2: Create a Test Payment

You can create a payment via the dashboard or the API.

Option A: Via the Dashboard

  1. 1

    Go to Payments → Create Payment in the sidebar.

  2. 2

    Enter an amount (e.g., 1000 NGN) and select the currency.

  3. 3

    Click Generate Payment Link or click Confirm Payment to process immediately.

Option B: Via the API

Send a POST request to create a payment intent:

curl
curl -X POST http://localhost:8081/payments \
  -H "Content-Type: application/json" \
  -H "api-key: test_api_key_xxxx" \
  -d '{
    "amount": 1000,
    "currency": "NGN",
    "confirm": true,
    "capture_method": "automatic",
    "description": "Test payment from docs",
    "email": "test@example.com"
  }'

The response includes a payment_id and the current status.

Step 3: Test Card Numbers

Use these test card numbers in the Paystack test environment. No real money is charged.

Card NumberResultWhen to Use
4084 0840 8408 4081Successful paymentStandard happy path testing
4084 0840 8408 4040Insufficient fundsTest failure handling
5060 6666 6666 6666Successful (Verve)Test Nigerian local cards

Use any future expiry date, any 3-digit CVC, and any name.

Step 4: Check the Payment Status

After creating the payment, monitor it in the dashboard:

  1. 1

    Go to Payments in the sidebar. Your new payment appears at the top of the list.

  2. 2

    Click on the payment to see the full detail view — amount, connector response, timeline, and refund options.

  3. 3

    The payment status should be Succeeded if the test card was successful.

Production Checklist

Before going live with real payments, make sure you:

  • ✓ Switch to Paystack live API keys
  • ✓ Set up webhook endpoints in Paystack dashboard
  • ✓ Configure webhook signing secrets
  • ✓ Set up monitoring and alerts
  • ✓ Enable rate limiting
Full Accepting Payments Guide →