# booktics/1.0.27/core/payment/payment-methods/abstract-payment-method.php

Booktics – Appointment Booking Calendar for Service Businesses, version 1.0.27. 76 lines.

- Page: https://pluginprobe.com/plugins/booktics/1.0.27/code/core/payment/payment-methods/abstract-payment-method.php
- Raw: https://pluginprobe.com/plugins/booktics/1.0.27/raw/core/payment/payment-methods/abstract-payment-method.php
- Modified: 2026-09-28T15:21:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/booktics/1.0.27/code/core/payment/payment-methods/abstract-payment-method.php#L10-L20`.

```php
<?php

namespace Booktics\Payment\Payment_Methods;

use Booktics\Payment\Contracts\Payment_Method_Interface;
use Booktics\Payment\Payment_Status;
use Booktics\Models\Order_Model;

abstract class Abstract_Payment_Method implements Payment_Method_Interface {

	/**
	 * The unpaid order was actually paid — repair it, do not release the slot.
	 */
	const RESERVATION_REPAIR = 'repair';

	/**
	 * The customer never completed payment — release the held slot.
	 */
	const RESERVATION_RELEASE = 'release';

	/**
	 * Payment is still legitimately in progress — keep the slot and re-check later.
	 */
	const RESERVATION_WAIT = 'wait';

	protected $id;
	protected $name;
	private $order;

	/**
	 * Decide what to do with a slot held by an unpaid order that has passed the
	 * reservation timeout: repair (payment actually went through), release (free
	 * the slot), or wait (payment still genuinely in progress — check again later).
	 *
	 * Default implementation infers the action from get_payment_status(). Gateways
	 * with richer lifecycle states (e.g. Stripe's 3D-Secure flow) should override
	 * this to avoid canceling a customer who is mid-payment.
	 *
	 * @param Order_Model $order The order whose reservation is being evaluated.
	 *
	 * @return string One of the RESERVATION_* constants.
	 */
	public function resolve_reservation_action( $order ): string {
		return Payment_Status::COMPLETED === $this->get_payment_status( $order )
			? self::RESERVATION_REPAIR
			: self::RESERVATION_RELEASE;
	}

	/**
	 * Get the unique identifier for this payment method
	 *
	 * @return string
	 */
	public function get_id(): string {
		return $this->id;
	}

	/**
	 * Get the display name of the payment method
	 *
	 * @return string
	 */
	public function get_name(): string {
		return $this->name;
	}

    /**
     * Get Order
     *
     * @return Order_Model
     */
    protected function get_order() {
        return $this->order;
    }
}

```
