Last active
February 6, 2018 11:25
-
-
Save umidjons/671cb7564486111ddf1803757334625a to your computer and use it in GitHub Desktop.
Check, is there any other transaction for this order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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