AsyncStatus Polling (Lane)

AsyncStatus Polling

function pollResult($ref, $max = 30) {
    for ($i = 0; $i < $max; $i++) {
        $r = gateway_post('https://secure.cyogate.net/api/cpca/v1/asyncstatus',
                          ['security_key' => KEY, 'transaction_ref' => $ref]);
        if ($r['status'] === 'complete') return $r;
        if ($r['status'] === 'error')    throw new Exception($r['message']);
        sleep(2);
    }
    throw new Exception('Timed out');
}
statusMeaning
pendingWaiting for customer
processingBeing authorized
completeDone — check response field
cancelledCancelled at terminal
errorTerminal/network error
See the Lane/Series overview for the full topic list.

Take Your Business to the Next Level

Find out how our innovative payment solutions can benefit your business. Reach out to us for more information or to get started!

Let's Get Started