🧪 Testing

Testing Your Integration

Safely test your PayFlow integration with test mode and sandbox credentials.

Test Mode vs Live Mode
Understanding the difference between testing and production

Test Mode

  • Use pk_test_ API keys
  • No real money is processed
  • Perfect for development and testing
  • Use test payment methods

Live Mode

  • Use pk_live_ API keys
  • Real money will be processed
  • Only use when ready for production
  • Real payment methods required
Test Payment Methods
Use these test credentials to simulate payments

PayFast Test Cards

Test Credit Card

Card Number: 4111 1111 1111 1111

Expiry: Any future date

CVV: Any 3 digits

Test Bank Account

Account: 1234567890

Routing: 123456789

Webhook Testing
Test webhook delivery to your endpoints

Use the webhook testing tool in your PayFlow dashboard to send test webhooks:

1
Go to Settings → Webhooks
2
Select your webhook endpoint
3
Click "Send Test Webhook"
Local Development
Test webhooks on your local machine

For local development, use ngrok to expose your local server:

# Install ngrok
npm install -g ngrok

# Expose your local server
ngrok http 3000

# Use the HTTPS URL provided by ngrok in your webhook endpoint

Note: The free version of ngrok will generate a new URL each time you restart it. For production testing, consider using a paid ngrok plan or deploying to a staging environment.