📅  最后修改于: 2022-03-11 14:53:42.751000             🧑  作者: Mango
// 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();
}