Skip to main content

Testing Overview

Card2Crypto operates in production mode only. All payments are real transactions that will be charged to credit cards. For testing, use:
  • Small payment amounts (minimum $0.50)
  • Your own credit cards
  • Real API keys from your shop

Testing Strategy

1. Development Testing

Test basic integration with minimal costs:

2. Staging Environment

Set up a staging environment that mirrors production:

3. Production Testing

Before going live:
  1. Test with real small payments (0.500.50-1.00)
  2. Verify all payment flows
  3. Test webhook delivery
  4. Check refund process

Test Scenarios

Basic Payment Flow

Payment Retrieval

Webhook Handling

Error Handling

Manual Testing Checklist

Payment Creation

  • Create payment with minimum amount ($0.50)
  • Create payment with metadata
  • Create payment with customer email and name
  • Verify checkout URL is generated
  • Verify payment shows in dashboard

Checkout Flow

  • Access checkout URL
  • Verify shop name is displayed
  • Enter credit card details
  • Complete payment successfully
  • Verify redirect to return URL
  • Check payment ID in URL parameters

Payment Status

  • Retrieve payment after creation (status: pending)
  • Retrieve payment after completion (status: completed)
  • Verify payment details match

Webhook Delivery

  • Configure webhook URL in dashboard
  • Complete a test payment
  • Verify webhook is received
  • Check webhook signature is valid
  • Verify webhook payload is correct
  • Test webhook retry (return non-200 status)

Dashboard

  • View payments in dashboard
  • Check payment details
  • Verify balance is credited
  • Request withdrawal (minimum $10)

Automated Testing

Unit Tests

Integration Tests

Webhook Tests

Browser Testing

Use Playwright or Puppeteer to test checkout flow:

Local Development Setup

1. Use ngrok for Webhooks

2. Test Webhook Delivery

Test Data

Test Payment Amounts

Test Metadata

Common Testing Issues

Issue: Webhook Not Received

Causes:
  • Webhook URL not publicly accessible
  • Server not running
  • Firewall blocking requests
Solutions:

Issue: Signature Verification Fails

Causes:
  • Using wrong webhook secret
  • Body parsing modifies payload
  • Incorrect signature algorithm
Solutions:

Issue: Payment Not Completing

Causes:
  • Card declined
  • Network timeout
  • Incorrect card details
Solutions:
  • Use your own valid credit card
  • Check card details are entered correctly
  • Verify network connection
  • Check Card2Crypto dashboard for errors

Pre-Launch Checklist

Before going live:
  • Test complete payment flow end-to-end
  • Verify webhook delivery and signature verification
  • Test refund process (if applicable)
  • Check error handling for all scenarios
  • Verify API keys are correct
  • Test with multiple payment amounts
  • Verify balance calculations (amount - 15% fee)
  • Test return URL handling
  • Check database updates correctly
  • Review logs for errors
  • Test on mobile devices
  • Verify HTTPS is used in production
  • Check rate limiting behavior
  • Test concurrent payments
  • Verify dashboard shows correct data

Continuous Testing

Set up monitoring to catch issues:

Next Steps

Error Reference

Handle errors in your tests

Webhook Testing

Comprehensive webhook testing guide

Node.js Guide

See testing examples

FAQ

Common testing questions