Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

omnipay capture

// after initial completeAuthorize()
// store $ref in your database with the payment
$ref = $response->getTransactionReference();

// then later, when you want to capture it
$data = array(
    'transactionReference' => $ref,
    'amount' => '10.00', // pass original amount, or can be less
);
$response = $gateway->capture($data)->send();
if ($response->isSuccessful()) {
    // success
} else {
    // error, maybe you took too long to capture the transaction
    echo $response->getMessage();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #omnipay #capture
ADD COMMENT
Topic
Name
5+8 =