Payment Integration

WooCommerce Payment Gateway


This document explains how to configure and use the WooCommerce Payment Gateway within the KiviCare Clinic Management System. This integration allows KiviCare to leverage WooCommerce’s checkout and payment ecosystem for appointment payments.

Overview

The WooCommerce integration enables clinics to accept payments for KiviCare appointments using any payment gateway supported by WooCommerce.

When a patient books an appointment:

  • KiviCare dynamically creates a temporary WooCommerce product
  • The product is added to the cart
  • The patient is redirected to the WooCommerce checkout flow to complete payment

This approach provides maximum flexibility by supporting all WooCommerce-compatible payment gateways.

Prerequisites

Before enabling WooCommerce payments in KiviCare, ensure the following requirements are met:

  1. WooCommerce Plugin
    • WooCommerce must be installed and activated on your WordPress site.
  2. WooCommerce Payment Gateways
    • At least one payment method must be configured and enabled in WooCommerce (e.g., Stripe, PayPal, Razorpay, BACS, Cash on Delivery).

WooCommerce Configuration in KiviCare

Step 1: Navigate to Payment Settings

  1. Log in to the WordPress Admin Dashboard.
  2. Go to KiviCare > Settings > Payment Settings.

Step 2: Enable WooCommerce Gateway

  1. Locate WooCommerce in the list of available payment gateways.
  2. Toggle the Enable switch (Green).

Note: There are no additional configuration fields inside KiviCare for WooCommerce. All payment-related settings are managed directly from WooCommerce.


How the WooCommerce Payment Flow Works

Appointment Booking

  1. A patient selects a service and proceeds to payment.
  2. KiviCare automatically creates a hidden Simple Product in WooCommerce:
    • Product price = Appointment cost
    • Product type = Virtual
    • Catalog visibility = Hidden
  3. Applicable KiviCare taxes are added as Fees in the WooCommerce cart.

Checkout Process

  1. The patient is redirected to the WooCommerce Checkout page.
  2. The patient completes payment using any enabled WooCommerce payment method.

Order & Appointment Status Mapping

The appointment status in KiviCare is automatically updated based on the WooCommerce order status:

WooCommerce Order StatusKiviCare Appointment StatusStatus ID
CompletedBooked1
ProcessingPending2
Failed / CancelledCancelled0

Important: Appointments are Booked only when the WooCommerce order status becomes Completed.


Auto-Cancellation Mechanism

To avoid appointment slot blocking due to unpaid bookings, KiviCare includes an automatic cancellation feature:

If a patient is redirected to WooCommerce checkout but does not complete payment, the appointment is automatically cancelled.

Troubleshooting

Common Issues and Solutions
WooCommerce Not Active Error

Ensure the WooCommerce plugin is installed and activated.

Redirect Loop or 404 on Checkout
  • Verify WooCommerce pages:
    • Go to WooCommerce > Status > Tools
    • Click Create default WooCommerce pages
  • Confirm that a valid Checkout page is assigned.
Appointment Not Confirmed
  • Check the WooCommerce order status.
  • Appointments are confirmed only when the order status is Completed.
  • Some gateways keep orders in Processing status:
    • Manually complete the order, or
    • Use a plugin to auto-complete virtual orders.

Best Practices

  • Use Virtual + Auto-Complete Order settings for smoother confirmation.
  • Test the full booking flow after enabling a new WooCommerce payment gateway.
  • Regularly monitor WooCommerce orders linked to appointments.

Suggestions & Improvements

Your email address will not be published. Required fields are marked *