# Stripe Quick Setup (5 Minutes) ⚡

## Why Use Stripe for Subscriptions?

**PayPal subscriptions aren't implemented yet**, but Stripe is fully working!

### ✅ Stripe Benefits:
- Automatic recurring billing
- Trial periods supported
- Instant activation
- Credit/debit cards
- No manual activation needed
- Better customer experience

---

## Quick Setup Steps

### 1. Create Stripe Account (2 minutes)
1. Visit: https://stripe.com
2. Click "Sign Up" or "Start Now"
3. Enter email and create password
4. Complete basic info

### 2. Get Test API Keys (1 minute)
1. Login to: https://dashboard.stripe.com
2. You'll be in **Test Mode** by default (perfect!)
3. Click **Developers** (left sidebar)
4. Click **API Keys**
5. Copy your keys:
   - **Publishable key**: `pk_test_51ABC123...`
   - **Secret key**: Click "Reveal" then copy `sk_test_51ABC123...`

### 3. Configure in Website (2 minutes)
1. Go to your website dashboard
2. Navigate to: **Websites → [Select Website] → Settings**
3. Click the **Payment** tab
4. Find **Stripe Payment Gateway**
5. Toggle **Enable Stripe** to ON
6. Enter your keys:
   ```
   Publishable Key: pk_test_51ABC123...xyz789
   Secret Key: sk_test_51ABC123...xyz789
   Environment: Test Mode
   ```
7. Click **Test Stripe Connection** → Should show ✅ Success
8. Scroll down and click **Save Settings**

---

## Test Your First Subscription

### Step 1: Make Test Booking
1. Go to: `https://mbi.neosolvix.test/book-resource/10`
2. Click **Subscribe & Save**
3. Select a subscription package
4. **Select Payment Method:** Choose **Stripe** ✅
5. Fill in customer info
6. Click **Subscribe Now**

### Step 2: Complete Payment
1. You'll be redirected to Stripe Checkout
2. Use test card: `4242 4242 4242 4242`
3. Expiry: Any future date (e.g., `12/25`)
4. CVC: Any 3 digits (e.g., `123`)
5. ZIP: Any 5 digits (e.g., `12345`)
6. Click **Subscribe**

### Step 3: Verify
1. Check your customer portal: `/account/subscriptions`
2. Should see active subscription ✅
3. Credits should be available ✅
4. Next billing date shown ✅

---

## More Test Cards

**Successful Payment:**
```
Card: 4242 4242 4242 4242
Expiry: 12/25
CVC: 123
```

**Requires 3D Secure:**
```
Card: 4000 0027 6000 3184
(Follow authentication prompts)
```

**Declined Card:**
```
Card: 4000 0000 0000 0002
(Will show payment failed)
```

**Insufficient Funds:**
```
Card: 4000 0000 0000 9995
```

[Full list of test cards](https://stripe.com/docs/testing#cards)

---

## Going Live

When ready for real payments:

### 1. Activate Stripe Account
1. Complete business verification
2. Add bank account for payouts
3. Review payout schedule

### 2. Switch to Live Keys
1. In Stripe Dashboard, toggle to **Live Mode**
2. Get live keys from: Developers → API Keys
3. Copy:
   - Publishable key: `pk_live_...`
   - Secret key: `sk_live_...`

### 3. Update Website Settings
1. Website Settings → Payment Tab
2. Update Stripe keys with live keys
3. Change Environment to: **Live Mode**
4. Test connection ✅
5. Save settings

### 4. Test Small Transaction
1. Make a real subscription (small amount)
2. Verify payment appears in Stripe Dashboard
3. Check payout schedule
4. Confirm subscription renews correctly

---

## Why Stripe Over PayPal for Subscriptions?

| Feature | Stripe | PayPal |
|---------|--------|--------|
| **Recurring Billing** | ✅ Automatic | ❌ Not implemented |
| **Credit Cards** | ✅ Yes | ❌ Only PayPal accounts |
| **Setup Time** | ⚡ 5 minutes | ❌ Needs development |
| **Trial Periods** | ✅ Built-in | ❌ Complex |
| **Webhooks** | ✅ Real-time | ⚠️ Needs setup |
| **Developer Experience** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
| **PHP 8 Support** | ✅ Perfect | ⚠️ Issues |
| **Modern UI** | ✅ Beautiful | ⚠️ Redirect-heavy |

---

## Summary

**For subscriptions, use Stripe!**

✅ 5-minute setup
✅ Works perfectly right now
✅ No development needed
✅ Better customer experience
✅ More payment methods
✅ Automatic renewals

**PayPal is great for:**
- ❌ ~~Subscriptions~~ (not implemented)
- ✅ One-time payments only

---

## Need Help?

If you need PayPal subscriptions specifically:
- Let me know and I'll implement it
- Requires PayPal Billing Agreements API
- Takes about 1-2 hours to develop

Otherwise, **stick with Stripe** - it's the best option! 🎯
