Testing

Test your integration before going live

Testing Overview

Noxipay provides a comprehensive testing environment that allows you to test all payment flows without processing real transactions.

Test Environment

Test API Keys

Use test API keys that start with pk_test_ and sk_test_

pk_test_1234567890abcdef

Test Mode

All transactions are simulated and no real money is processed

Test Data

Use test card numbers and customer data for testing

Test Card Numbers

Successful Payment

4242 4242 4242 4242

Any future date, any 3-digit CVC

Declined Payment

4000 0000 0000 0002

Card will be declined

Insufficient Funds

4000 0000 0000 9995

Insufficient funds error

Authentication Required

4000 0025 0000 3155

Requires 3D Secure authentication

Test Scenarios

Successful Payment Flow

  1. Create payment with test card 4242 4242 4242 4242
  2. Payment should be approved immediately
  3. Check payment status via API
  4. Verify webhook notification received

Failed Payment Flow

  1. Create payment with test card 4000 0000 0000 0002
  2. Payment should be declined
  3. Check error response
  4. Verify webhook notification received

Refund Flow

  1. Create successful payment
  2. Create refund for the payment
  3. Verify refund status
  4. Check webhook notifications

Testing with SDKs

PHP SDK

PHP
<?php // Use test API key $noxipay = new Noxipay('pk_test_your_test_key_here'); // Create test payment $payment = $noxipay->payments()->create([ 'amount' => 2500, 'currency' => 'EUR', 'description' => 'Test payment', 'card' => [ 'number' => '4242424242424242', 'exp_month' => 12, 'exp_year' => 2025, 'cvc' => '123' ] ]); echo "Test payment created: " . $payment->id;

JavaScript SDK

JavaScript
// Use test API key const noxipay = require('noxipay-js'); const client = new noxipay('pk_test_your_test_key_here'); // Create test payment const payment = await client.payments.create({ amount: 2500, currency: 'EUR', description: 'Test payment', card: { number: '4242424242424242', exp_month: 12, exp_year: 2025, cvc: '123' } }); console.log('Test payment created:', payment.id);

Webhook Testing

Test webhook notifications using ngrok or similar tools:

Terminal
# Install ngrok npm install -g ngrok # Expose local server ngrok http 3000 # Use the ngrok URL as webhook endpoint # https://abc123.ngrok.io/webhooks/noxipay

Test Data Examples

Customer Data

Test Customer
{ "email": "test@example.com", "name": "Test Customer", "phone": "+1234567890", "address": { "line1": "123 Test Street", "city": "Test City", "postal_code": "12345", "country": "US" } }

Going Live

Pre-Launch Checklist

  • ✅ All test scenarios pass
  • ✅ Error handling implemented
  • ✅ Webhook endpoints tested
  • ✅ SSL certificate installed
  • ✅ Live API keys configured
  • ✅ Payment methods enabled
  • ✅ Compliance requirements met