KSA-ORACLE/README_WISE.md
Nyavokevin 83ed2ba44c fix
2025-10-14 17:50:12 +03:00

144 lines
3.5 KiB
Markdown

# Wise Payment Integration - README
## 🎉 Implementation Complete!
Your Wise payment integration is **ready to use** with the payment link your client provided.
## 📋 What You Have
A **simplified Wise integration** that:
- ✅ Redirects users to Wise payment links
- ✅ Tracks payment status in database
- ✅ Verifies payments before allowing card access
- ✅ Supports webhook notifications (optional)
- ✅ Works alongside existing Stripe integration
## 🚀 Quick Start
### 1. Add to `.env`:
```bash
WISE_PAYMENT_LINK_6_CARDS=https://wise.com/pay/r/W2k1NqQySdc9HW8
WISE_PAYMENT_LINK_18_CARDS=https://wise.com/pay/r/YOUR_OTHER_LINK
WISE_WEBHOOK_SECRET=
```
### 2. That's It!
Users can now:
1. Select a paid card option
2. Click "Wise" button (dark blue)
3. Pay on Wise
4. Return and verify payment
## 📚 Documentation
- **WISE_SIMPLE_SETUP.md** ← **START HERE** for step-by-step guide
- **WISE_SETUP.md** - Detailed technical setup
- **WISE_FLOW_DIAGRAM.md** - Visual flow diagrams
- **WISE_IMPLEMENTATION_SUMMARY.md** - What was built
## 🎯 Key Features
### For Users
- Dual payment buttons: Stripe or Wise
- Seamless redirect to Wise
- Payment verification page
- Access to card drawing after payment
### For You
- Simple configuration (just payment links)
- Database tracking of all payments
- Webhook support for automatic verification
- Easy testing without real payments
## 🔧 Technical Details
### Routes
- `POST /create-wise-payment` - Create payment & redirect
- `GET /wise/verify` - Verification page
- `POST /wise/webhook` - Webhook handler
- `GET /wise/validate-payment` - Check payment status
### Database
All payments stored in `payments` table with:
- `payment_provider` = 'wise'
- `status` = 'pending' | 'succeeded' | 'failed'
- `client_session_id` = unique identifier
### Security
- Payment verification before card access
- Webhook signature validation
- CSRF protection disabled for webhooks only
## 🧪 Testing
### Without Real Payment
```bash
php artisan tinker
# Get latest Wise payment
$payment = App\Models\Payment::where('payment_provider', 'wise')
->latest()->first();
# Mark as succeeded
$payment->update(['status' => 'succeeded']);
```
### With Real Payment
1. Click "Wise" button
2. Complete payment on Wise
3. Visit `/wise/verify`
4. System checks and confirms payment
## 📱 User Flow
```
Card Selection → Click Wise → Redirect to Wise → Complete Payment
Payment Record Created (status: pending)
User Returns → /wise/verify → Status Check
If Paid → Success → Draw Cards!
```
## 🛠 Configuration
### Required
- `WISE_PAYMENT_LINK_6_CARDS` - Link for 6-card option
- `WISE_PAYMENT_LINK_18_CARDS` - Link for 18-card option
### Optional (for automatic verification)
- `WISE_WEBHOOK_SECRET` - Webhook signature verification
## 💡 Tips
1. **Ask your client** for the 18-card payment link
2. **Set up webhooks** in production for automatic verification
3. **Test manually** first with the simulated payment method
4. **Check logs** if something doesn't work: `storage/logs/laravel.log`
## 🆘 Common Issues
### "Payment link not configured"
→ Add `WISE_PAYMENT_LINK_6_CARDS` to `.env`
### Payment stuck on pending
→ Use `php artisan tinker` to manually mark as succeeded (for testing)
### Webhook not firing
→ Check webhook URL is publicly accessible and secret is configured
## ✨ Next Steps
1. ✅ Code is ready
2. 📝 Add payment links to `.env`
3. 🧪 Test the flow
4. 🔗 Set up webhooks (production)
5. 🎉 Go live!
---
**Read WISE_SIMPLE_SETUP.md for the complete guide!**