Payment Processors
Connect your payment processors to SkunkCRM to automatically create contacts and deals when customers make purchases. Perfect for e-commerce, SaaS, and service businesses.
Stripe Integration
Stripe has excellent webhook support for real-time payment notifications.
Setup Steps
-
Create Webhook Token in SkunkCRM:
- Go to SkunkCRM → Webhooks
- In the Incoming Webhook Tokens section, click "Create Token"
- Enter token name: "Stripe Integration"
- Copy the complete webhook URL provided
-
Configure Stripe Webhooks:
- Log into your Stripe Dashboard
- Go to Developers → Webhooks
- Click "Add endpoint"
- Endpoint URL:
https://yoursite.com/wp-json/skunkcrm/v1/webhook/{your-token} - Listen to: Select specific events (recommended)
-
Select Events:
customer.created- New customer accountspayment_intent.succeeded- Successful paymentsinvoice.payment_succeeded- Subscription paymentscustomer.subscription.created- New subscriptions
Webhook Data Processing
SkunkCRM automatically processes Stripe webhook data:
Customer Created:
json1{ 2 "action": "create_contact", 3 "data": { 4 "name": "Customer Name", 5 "email": "customer@example.com", 6 "stripe_customer_id": "cus_abc123", 7 "source": "stripe", 8 "status": "customer" 9 } 10}
Payment Succeeded:
json1{ 2 "action": "create_deal", 3 "data": { 4 "contact_email": "customer@example.com", 5 "title": "Stripe Payment", 6 "value": 99.00, 7 "status": "won", 8 "source": "stripe", 9 "payment_id": "pi_abc123" 10 } 11}
Custom Stripe Integration
For more control, process Stripe webhooks in your application first:
functions.phpphp1// Stripe webhook handler 2$payload = file_get_contents('php://input'); 3$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE']; 4$endpoint_secret = 'whsec_your_signing_secret'; 5 6try { 7 $event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); 8 9 switch ($event['type']) { 10 case 'customer.created': 11 $customer = $event['data']['object']; 12 13 // Send to SkunkCRM 14 $contact_data = [ 15 'contact' => [ 16 'name' => $customer['name'], 17 'email' => $customer['email'], 18 'phone' => $customer['phone'], 19 'source' => 'stripe', 20 'stripe_customer_id' => $customer['id'] 21 ] 22 ]; 23 24 sendToSkunkCRM($contact_data); 25 break; 26 27 case 'payment_intent.succeeded': 28 $payment = $event['data']['object']; 29 30 // Create deal in SkunkCRM 31 $deal_data = [ 32 'action' => 'create_deal', 33 'data' => [ 34 'title' => 'Stripe Payment - ' . $payment['id'], 35 'value' => $payment['amount'] / 100, // Convert cents 36 'status' => 'won', 37 'source' => 'stripe' 38 ] 39 ]; 40 41 sendToSkunkCRM($deal_data); 42 break; 43 } 44} catch(\Exception $e) { 45 http_response_code(400); 46 exit(); 47} 48 49function sendToSkunkCRM($data) { 50 $webhook_url = 'https://yoursite.com/wp-json/skunkcrm/v1/webhook/your-token'; 51 52 wp_remote_post($webhook_url, [ 53 'body' => json_encode($data), 54 'headers' => ['Content-Type' => 'application/json'] 55 ]); 56}
PayPal Integration
PayPal uses IPN (Instant Payment Notification) for webhook-style notifications.
Setup Steps
- Create Webhook Token in SkunkCRM
- Configure PayPal IPN:
- Log into PayPal account
- Go to Account Settings → Notifications
- Notification URL:
https://yoursite.com/wp-json/skunkcrm/v1/webhook/{your-token}
PayPal IPN Processing
PayPal sends form-encoded data, so you'll need a custom handler:
functions.phpphp1// PayPal IPN to SkunkCRM handler 2add_action('init', function() { 3 if (isset($_POST['txn_type']) && $_GET['paypal_ipn'] === 'true') { 4 // Verify IPN with PayPal 5 $raw_post_data = file_get_contents('php://input'); 6 $raw_post_array = explode('&', $raw_post_data); 7 8 // Process PayPal data 9 $contact_data = [ 10 'contact' => [ 11 'name' => $_POST['first_name'] . ' ' . $_POST['last_name'], 12 'email' => $_POST['payer_email'], 13 'source' => 'paypal', 14 'paypal_payer_id' => $_POST['payer_id'] 15 ] 16 ]; 17 18 // Send to SkunkCRM webhook 19 sendToSkunkCRM($contact_data); 20 } 21});
WooCommerce Integration
WooCommerce has built-in webhook support for order events.
Setup Steps
-
Enable WooCommerce Webhooks:
- Go to WooCommerce → Settings → Advanced → Webhooks
- Click "Create webhook"
-
Configure Webhook:
- Name: "SkunkCRM Integration"
- Status: Active
- Topic: Select events (order.created, customer.created)
- Delivery URL:
https://yoursite.com/wp-json/skunkcrm/v1/webhook/{your-token} - Secret: (optional, for verification)
Webhook Topics
Recommended Topics:
order.created- New orders placedorder.completed- Orders marked as completecustomer.created- New customer accounts
Processing WooCommerce Data
WooCommerce sends detailed order data:
json1{ 2 "action": "create_contact", 3 "data": { 4 "name": "John Doe", 5 "email": "john@example.com", 6 "phone": "+1234567890", 7 "company": "Acme Corp", 8 "source": "woocommerce", 9 "woocommerce_customer_id": 123, 10 "billing_address": { 11 "street": "123 Main St", 12 "city": "New York", 13 "state": "NY", 14 "zip": "10001" 15 } 16 } 17}
Custom WooCommerce Handler
For more control, use WooCommerce hooks:
functions.phpphp1// WooCommerce to SkunkCRM integration 2add_action('woocommerce_new_order', function($order_id) { 3 $order = wc_get_order($order_id); 4 5 $contact_data = [ 6 'contact' => [ 7 'name' => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(), 8 'email' => $order->get_billing_email(), 9 'phone' => $order->get_billing_phone(), 10 'company' => $order->get_billing_company(), 11 'source' => 'woocommerce', 12 'order_total' => $order->get_total(), 13 'woocommerce_order_id' => $order_id 14 ] 15 ]; 16 17 // Send to SkunkCRM 18 sendToSkunkCRM($contact_data); 19 20 // Also create a deal 21 $deal_data = [ 22 'action' => 'create_deal', 23 'data' => [ 24 'title' => 'WooCommerce Order #' . $order_id, 25 'value' => $order->get_total(), 26 'status' => 'won', 27 'source' => 'woocommerce', 28 'contact_email' => $order->get_billing_email() 29 ] 30 ]; 31 32 sendToSkunkCRM($deal_data); 33});
Easy Digital Downloads
EDD supports webhooks for digital product sales.
Configuration
- Install EDD Webhooks Extension (if available)
- Configure Webhook:
- URL:
https://yoursite.com/wp-json/skunkcrm/v1/webhook/{your-token} - Events: Payment complete, customer created
- URL:
Alternative: EDD Hooks
functions.phpphp1// EDD to SkunkCRM integration 2add_action('edd_complete_purchase', function($payment_id) { 3 $payment = new EDD_Payment($payment_id); 4 5 $contact_data = [ 6 'contact' => [ 7 'name' => $payment->first_name . ' ' . $payment->last_name, 8 'email' => $payment->email, 9 'source' => 'edd', 10 'edd_customer_id' => $payment->customer_id 11 ] 12 ]; 13 14 sendToSkunkCRM($contact_data); 15});
Subscription Management
Handling Recurring Payments
For subscription businesses, track subscription events:
functions.phpphp1// Stripe subscription webhook handler 2switch ($event['type']) { 3 case 'customer.subscription.created': 4 $subscription = $event['data']['object']; 5 6 $contact_data = [ 7 'action' => 'update_contact', 8 'data' => [ 9 'email' => $subscription['customer']['email'], 10 'status' => 'subscriber', 11 'subscription_status' => 'active', 12 'subscription_plan' => $subscription['items']['data'][0]['price']['nickname'] 13 ] 14 ]; 15 break; 16 17 case 'customer.subscription.deleted': 18 $subscription = $event['data']['object']; 19 20 $contact_data = [ 21 'action' => 'update_contact', 22 'data' => [ 23 'email' => $subscription['customer']['email'], 24 'subscription_status' => 'cancelled' 25 ] 26 ]; 27 break; 28}
Testing Payment Integrations
Stripe Test Mode
- Use Stripe test keys in your integration
- Test webhook endpoints with Stripe CLI:
terminalbash
1stripe listen --forward-to https://yoursite.com/wp-json/skunkcrm/v1/webhook/your-token
PayPal Sandbox
- Create PayPal Sandbox account
- Configure IPN simulator in PayPal developer tools
- Test with sandbox transactions
WooCommerce Testing
- Create test orders in WooCommerce
- Check webhook delivery logs
- Verify contacts created in SkunkCRM
Troubleshooting
Webhooks Not Firing
- Check payment processor logs - Most processors have webhook delivery logs
- Verify webhook URL - Ensure URL is correct and accessible
- Test manually - Use processor's webhook testing tools
Missing Customer Data
- Review field mapping - Check which fields the processor sends
- Handle missing fields - Use fallback values for optional fields
- Customer vs guest - Handle both registered and guest customers
Duplicate Contacts
- Email deduplication - Enable automatic duplicate prevention
- Update vs create - Use update actions for existing customers
- Unique identifiers - Store processor customer IDs for deduplication
Security Considerations
Webhook Verification
Stripe: Always verify webhook signatures:
functions.phpphp1$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE']; 2$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
PayPal: Verify IPN with PayPal servers WooCommerce: Use webhook secrets for verification
Data Protection
- HTTPS only - Never use HTTP for payment webhooks
- Validate data - Sanitize all incoming payment data
- Log securely - Don't log sensitive payment information
- Rate limiting - Implement rate limiting on webhook endpoints
Next Steps
- Test your integration - Process test payments to verify everything works
- Monitor webhook delivery - Set up alerts for failed webhooks
- Customer lifecycle - Use SkunkCRM automations to nurture payment customers
- Analytics - Track payment conversion rates and customer lifetime value
Powerful REST API Ready for Integration
SkunkCRM provides a comprehensive REST API designed for seamless integrations and external access. Build powerful integrations with full CRUD operations, secure authentication, and real-time webhook support.
Complete control over contacts, deals, and activities
WordPress Application Passwords with permission controls
Built-in protection and performance optimization
Clean, RESTful endpoints with consistent responses
Real-time integrations and event notifications
Get started with examples, authentication guides, and interactive endpoint testing.
Need to integrate a payment processor not covered here? Check our incoming webhooks guide for general webhook setup instructions.