IAPreAuthorization Class

The IAPreAuthorization class processes the IPCIAPreAuthorization method. It allows you to perform a card-not-present pre-authorization using stored or directly provided card details — without redirecting the user.

Ideal for background transactions, subscription holds, or merchant-initiated holds on a saved card.

Class Overview

  • Namespace: Mypos\IPC
  • Located at: IAPreAuthorization.php
  • Extends: Mypos\IPC\Base
  • Purpose: Create a server-side (merchant-initiated) pre-authorization using direct card input.

Method Summary

MethodReturn TypeDescription
__construct(Config $cnf)-Initializes the class with IPC configuration.
setOrderID(string $orderID)IAPreAuthorizationUnique identifier for the transaction.
getOrderID()stringReturns the order ID.
setItemName(mixed $itemName)IAPreAuthorizationName of the item or service.
getItemName()mixedRetrieves the item name.
setAmount(mixed $amount)IAPreAuthorizationAmount to authorize (not yet captured).
getAmount()mixedReturns the pre-auth amount.
setCurrency(string $currency)IAPreAuthorizationISO 4217 currency code (e.g., EUR).
getCurrency()stringReturns the currency.
setNote(string $note)IAPreAuthorizationOptional text note for internal use.
getNote()stringReturns the note.
setCard(Card $card)IAPreAuthorizationPass a Card object with card details or token.
getCard()CardReturns the assigned Card object.
validate()boolValidates all required fields.
process()ResponseInitiates the IPC request and returns a response object.

Inherited from Base

Includes IPC SDK core helpers: _addPostParam() _processPost(), _processHtmlPost() getCnf(), setCnf() getOutputFormat(), setOutputFormat() isValidSignature()

Example Usage

use Mypos\IPC\Config;
use Mypos\IPC\IAPreAuthorization;
use Mypos\IPC\Card;

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

$card = new Card();
$card->setCardNumber('4111111111111111')
     ->setExpMM('12')
     ->setExpYY('26')
     ->setCvc('123')
     ->setCardHolder('John Doe');

$preAuth = new IAPreAuthorization($config);
$preAuth->setOrderID('PREAUTH-20250410-XYZ')
        ->setAmount(100.00)
        ->setCurrency('EUR')
        ->setItemName('Conference Booking')
        ->setNote('Hold for reservation')
        ->setCard($card);

if ($preAuth->validate()) {
    $response = $preAuth->process();
    echo "Pre-authorization successful!";
} else {
    echo "Validation failed.";
}

Use cases

Use the IAPreAuthorization class when:

  • You want to hold funds without capturing immediately
  • You're processing payments with stored cards or direct card entry
  • You need full control over the transaction server-side
  • The customer is not actively present during the transaction (MIT/CIT logic)