> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.swellsystem.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Payment Processing

# Payment Processing

Accept online payments for invoices and bookings using Stripe integration.

## Payment Overview

SWELLEnterprise integrates with **Stripe** to process payments:
- **Invoice Payments**: Clients pay invoices online
- **Booking Payments**: Require payment for appointments
- **Secure Processing**: PCI-compliant via Stripe
- **Automatic Recording**: Payments recorded automatically

## Setting Up Stripe

### Step 1: Get Stripe Account

1. **Sign Up**: Create account at stripe.com
2. **Verify Email**: Confirm your email
3. **Complete Setup**: Add business information
4. **Get API Keys**: From Stripe dashboard

### Step 2: Get API Keys

1. Go to **Stripe Dashboard** → **Developers** → **API Keys**
2. Copy **Publishable Key** (starts with `pk_`)
3. Copy **Secret Key** (starts with `sk_`)
4. **Important**: Keep secret key secure!

### Step 3: Configure in SWELL

1. Go to **Settings** → **Integrations** → **Stripe**
2. Enter **Publishable Key**
3. Enter **Secret Key**
4. Click **"Test Connection"**
5. If successful, click **"Save"**

### Step 4: Test Payment

1. Create test invoice
2. Enable payment
3. Use Stripe test card: `4242 4242 4242 4242`
4. Complete test payment
5. Verify payment recorded

## Payment Methods

### Credit/Debit Cards

Clients can pay with:
- Visa
- Mastercard
- American Express
- Discover
- Other major cards

### Other Methods (if enabled)

- **Bank Transfer**: ACH payments
- **Digital Wallets**: Apple Pay, Google Pay
- **Other**: Based on Stripe configuration

## Invoice Payments

### Enabling Payment on Invoice

1. **Create Invoice**: Go to Finance → Invoices → New Invoice
2. **Add Payment Link**: Payment link automatically included
3. **Send Invoice**: Email to client
4. **Client Pays**: Clicks link, enters payment info
5. **Payment Processed**: Stripe processes payment
6. **Invoice Updated**: Status changes to "Paid"

### Payment Link

Each invoice includes:
- **Payment URL**: Unique link for this invoice
- **Secure**: HTTPS encrypted
- **Mobile-Friendly**: Works on all devices
- **Auto-Expires**: Link expires after payment

### Payment Status

**Unpaid:**
- Invoice sent, awaiting payment
- Payment link active
- Reminders can be sent

**Paid:**
- Payment received
- Invoice marked paid
- Receipt sent to client
- Payment recorded

**Partially Paid:**
- Some payment received (if partial payments enabled)
- Remaining balance shown
- Can accept additional payments

**Failed:**
- Payment attempt failed
- Client notified
- Can retry payment

## Booking Payments

### Requiring Payment for Bookings

1. **Create Event Type**: Go to Scheduling → Settings → Event Types
2. **Enable Payment**: Toggle "Require Payment"
3. **Set Price**: Enter price or select product
4. **Save**

### Booking Payment Flow

1. **Client Books**: Selects time slot
2. **Payment Required**: Must pay before booking confirms
3. **Payment Page**: Stripe checkout page
4. **Payment Processed**: Payment completed
5. **Booking Confirmed**: Appointment confirmed
6. **Confirmation Sent**: Email with booking details

## Payment Notifications

### Automatic Notifications

System sends:
- **Payment Received**: Email when payment processes
- **Payment Failed**: Email if payment fails
- **Receipt**: Payment receipt to client
- **Invoice Paid**: Notification when invoice paid

### Notification Settings

Configure in **Settings** → **Notifications**:
- Email notifications for payments
- In-app notifications
- Receipt preferences

## Viewing Payments

### Payment History

1. Go to **Finance** → **Payments** (if available)
2. View all payments:
   - Date and time
   - Amount
   - Invoice/booking
   - Payment method
   - Status

### From Invoice

1. Open invoice
2. See **"Payments"** section
3. View payment details
4. See transaction ID

## Refunds

### Processing Refunds

1. **Open Invoice/Booking**: Find the payment
2. **Click Refund**: Refund button (if available)
3. **Enter Amount**: Full or partial refund
4. **Process**: Refund processed via Stripe
5. **Client Notified**: Refund confirmation sent

### Refund Policies

- **Full Refunds**: Return entire payment
- **Partial Refunds**: Return portion of payment
- **Automatic**: Some scenarios auto-refund
- **Manual**: Process manually when needed

## Security

### PCI Compliance

- **No Card Storage**: SWELL doesn't store card numbers
- **Stripe Handles**: All payment processing via Stripe
- **Encrypted**: All transactions encrypted
- **Secure**: PCI-compliant infrastructure

### Data Security

- **Token-Based**: Uses secure tokens
- **Encrypted Keys**: API keys stored encrypted
- **Secure Connection**: HTTPS only
- **Regular Audits**: Stripe security audits

## Troubleshooting

**Payment not processing?**
- Check Stripe API keys are correct
- Verify Stripe account is active
- Check payment method is valid
- Test with Stripe test card
- Check Stripe dashboard for errors

**Payment link not working?**
- Verify Stripe is configured
- Check invoice has payment enabled
- Try generating new link
- Check link hasn't expired

**Payment not recording?**
- Check webhook configuration
- Verify Stripe webhooks are set up
- Check payment status in Stripe
- Manually record if needed

**Refund not working?**
- Verify refund is allowed
- Check payment status
- Process via Stripe dashboard if needed
- Contact support

For more help, see [Common Issues](../troubleshooting/common-issues.md).

## Best Practices

1. **Test First**: Always test payments before going live
2. **Monitor Payments**: Check payment status regularly
3. **Send Receipts**: Ensure receipts are sent
4. **Handle Failures**: Follow up on failed payments
5. **Process Refunds**: Handle refunds promptly
6. **Keep Keys Secure**: Never share API keys
7. **Use Test Mode**: Test in Stripe test mode first

## Next Steps

- [Creating Invoices](https://help.swellsystem.com/en/article/creating-invoices-e045z0/) - Create billable invoices
- [Recurring Invoices](https://help.swellsystem.com/en/article/recurring-invoices-16ghcky/) - Set up subscriptions
- [Managing Products](https://help.swellsystem.com/en/article/managing-products-1gfwqpa/) - Build product catalog
