Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check, is there any other transaction for this order
<?php
// ...
// todo: Check, is there any other transaction for this order/service
$transaction = new Transaction();
$found = $transaction->find(['account' => $this->request->params['account']]);
if ($found) {
if (($found->state == Transaction::STATE_CREATED || $found->state == Transaction::STATE_COMPLETED)
&& $found->paycom_transaction_id !== $this->request->params['id']) {
$this->response->error(
PaycomException::ERROR_COULD_NOT_PERFORM,
'There is other active/completed transaction for this order.'
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment