Setup Guide for The Trade In Trainer Corner

Payment Integration Setup

To enable payment processing with Visa/Mastercard, you'll need to set up Stripe:

1. Create a Stripe Account

  1. Go to stripe.com and create an account
  2. Complete the account verification process
  3. Navigate to the Dashboard

2. Get Your API Keys

  1. In the Stripe Dashboard, go to DevelopersAPI keys
  2. Copy your Publishable key (starts with pk_)
  3. Copy your Secret key (starts with sk_)

3. Set Environment Variables in Val Town

  1. Go to your Val Town settings
  2. Add these environment variables:
    • STRIPE_PUBLISHABLE_KEY: Your Stripe publishable key
    • STRIPE_SECRET_KEY: Your Stripe secret key
  1. In Stripe Dashboard, go to DevelopersWebhooks
  2. Add endpoint: https://your-val-town-url.web.val.run/api/payments/webhook
  3. Select events: payment_intent.succeeded
  4. This ensures trainers are marked as sold when payments complete

Bank Account Setup

For Receiving Payments

  1. In your Stripe Dashboard, go to SettingsPayouts
  2. Add your bank account details where you want to receive payments
  3. Stripe will handle the transfer of funds to your account

Supported Countries

Stripe supports many countries. Check Stripe's supported countries to ensure your location is supported.

Testing

Test Mode

  • Stripe starts in test mode by default
  • Use test card numbers like 4242 4242 4242 4242
  • No real money is processed in test mode

Going Live

  1. Complete Stripe's verification process
  2. Switch to live mode in your Stripe Dashboard
  3. Update your environment variables with live keys (they'll start with pk_live_ and sk_live_)

Security Notes

  • Never expose your secret key in client-side code
  • The current implementation uses a simplified payment flow
  • For production, consider implementing additional security measures like webhook signature verification

Support

If you need help with Stripe integration: