AuthorizationList Class
The AuthorizationList class processes the IPCAuthorizationList method, allowing you to fetch a list of all pending or completed authorizations tied to your myPOS merchant account.
Great for monitoring outstanding holds, auditing transactions, or building admin panels for pre-auth lifecycle management.
Class Overview
- Namespace:
Mypos\IPC - Located at:
AuthorizationList.php - Extends:
Mypos\IPC\Base - Purpose: Retrieve a list of all authorizations, optionally filtered by time or status (depending on implementation)
Method Summary
| Method | Return Type | Description |
|---|---|---|
__construct(Config $cnf) | - | Initializes the AuthorizationList object with IPC configuration. |
setOrderID(string $orderID) | AuthorizationList | Sets an order ID to filter the authorization list. |
getOrderID() | string | Returns the currently set order ID filter. |
setStatus(int $status) | AuthorizationList | Sets a status filter (e.g., pending, completed). |
getStatus() | int | Returns the current status filter. |
setDateFrom(string $dateFrom) | AuthorizationList | Sets the start date for filtering (YYYY-MM-DD). |
getDateFrom() | string | Returns the start date filter. |
setDateTo(string $dateTo) | AuthorizationList | Sets the end date for filtering (YYYY-MM-DD). |
getDateTo() | string | Returns the end date filter. |
validate() | bool | Ensures required fields and filters are set correctly. |
process() | Response | Sends the request and returns the IPC response object with the authorization list. |
Inherited from Base
Provides access to these common SDK utilities:
_addPostParam()_processPost(), _processHtmlPost()getCnf(), setCnf()getOutputFormat(), setOutputFormat()isValidSignature()
Example Usage
use Mypos\IPC\Config;
use Mypos\IPC\AuthorizationList;
$config = new Config();
// Set SID, wallet number, keys, etc.
$authList = new AuthorizationList($config);
if ($authList->validate()) {
$response = $authList->process();
$authorizations = $response->getData();
foreach ($authorizations as $auth) {
echo "Order ID: " . $auth['OrderID'] . " | Status: " . $auth['Status'] . PHP_EOL;
}
} else {
echo " Authorization list request failed validation.";
}
Use cases
Use the AuthorizationList class when:
- You want to track all active or completed authorizations
- You need a reporting endpoint for a merchant control panel or back office
- You want to sync your app’s state with the current authorization records from myPOS
- You're implementing automated reconciling or transaction audits