← Back to Home

✅ Verification SDK Demo

Verify transactions and confirm payment status with PayChangu

Test Mode Active: Using PayChangu test credentials. Verifying test transactions only.
Secret Key: sec-test-rTvJ...K32 | Environment: Test/Sandbox
API Credentials (Test)
Test Secret Key (required for transaction verification)

Quick Verification

Enter the transaction reference you want to verify

Test with Sample Data

Click on any sample transaction reference below to test verification:

Code Example

// Import the Verification SDK
import { VerificationSDK } from 'paychangu-js';

// Get transaction reference from input
const txRef = document.getElementById('txRefInput').value;

// Verify the transaction
const verificationResponse = await VerificationSDK.verifyTransaction(txRef);

// Handle the response
if (verificationResponse.status === 'success') {
    console.log('Transaction verified:', verificationResponse.data);
    // Update UI to show verified status
} else {
    console.error('Verification failed:', verificationResponse.message);
}

Expected Response Structure

{
  "status": "success",
  "message": "Transaction verified successfully",
  "data": {
    "tx_ref": "PC-LZ9K2X-A3F8B2M1",
    "amount": 1000,
    "currency": "MWK",
    "customer": {
      "email": "customer@example.com",
      "first_name": "John",
      "last_name": "Doe"
    },
    "payment_status": "success", // success, pending, failed
    "payment_date": "2024-01-15T10:30:00Z",
    "payment_method": "mobile_money",
    "transaction_id": "TXN_1234567890"
  }
}

// Error Response:
{
  "status": "error",
  "message": "Transaction not found",
  "error_code": "TX_NOT_FOUND"
}

Understanding Verification Responses

Status Description Action
success Payment completed successfully Deliver goods/service
pending Payment is being processed Wait for webhook or retry verification
failed Payment failed Notify customer, offer retry
not_found Transaction reference doesn't exist Check TX Ref for errors