PreAuthorizationStatus Class

The PreAuthorizationStatus class handles the IPCPreAuthorizationStatus method. It is used to check the current state of a pre-authorization transaction by providing the order ID.

Perfect for monitoring, debugging, or automating decision logic after a pre-auth is triggered.

Class Overview

  • Namespace: Mypos\IPC
  • Located at: PreAuthorizationStatus.php
  • Extends: Mypos\IPC\Base
  • Purpose: Query and retrieve the status of a specific pre-authorization by Order ID

Method Summary

MethodReturn TypeDescription
__construct(Config $cnf)-Initializes the status checker with IPC configuration.
setOrderID(string $orderID)PreAuthorizationStatusSets the unique Order ID from the original pre-auth.
getOrderID()stringReturns the currently set Order ID.
validate()boolEnsures all required parameters are correctly set.
process()ResponseExecutes the API request to retrieve the current pre-auth status.

Inherited from Base

Includes all core methods:

  • _addPostParam()
  • _processPost(), _processHtmlPost()
  • getCnf(), setCnf()
  • getOutputFormat(), setOutputFormat()
  • isValidSignature()

Example Usage

use Mypos\IPC\Config;
use Mypos\IPC\PreAuthorizationStatus;

$config = new Config();
// Set your SID, API keys, etc.

$statusChecker = new PreAuthorizationStatus($config);
$statusChecker->setOrderID('AUTH-20250410-XYZ');

if ($statusChecker->validate()) {
    $response = $statusChecker->process();
    $status = $response->getData()['Status'];

    echo "Pre-auth Status: " . $status;
} else {
    echo "Invalid or missing Order ID.";
}

Use cases

Use the PreAuthorizationStatus class when:

  • You want to confirm whether a pre-auth was captured, reversed, or is still pending
  • You’re building an automated order management or payment reconciliation system
  • You want to delay capture or cancellation logic until you're sure of the transaction's current state
  • You need a clean, API-driven way to monitor pre-auth transactions in real time