You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user accidentally refreshes the browser at payment_complete, a new payment is created with all values set to zero, and state STATE_APPROVING.
The cause is this piece of code:
If the user accidentally refreshes the browser at payment_complete, a new payment is created with all values set to zero, and state STATE_APPROVING.
The cause is this piece of code:
$instruction = $order->getPaymentInstruction();
if (null === $pendingTransaction = $instruction->getPendingTransaction()) {
$payment = $this->ppc->createPayment($instruction->getId(), $instruction->getAmount() - $instruction->getDepositedAmount());
} else {
$payment = $pendingTransaction->getPayment();
}
Shouldn't a check be placed before?
Something like:
if (( $instruction->getAmount() - $instruction->getDepositedAmount() ) > 0) {
if (null === $pendingTransaction = $instruction->getPendingTransaction()) {
$payment = $this->ppc->createPayment($instruction->getId(), $instruction->getAmount() - $instruction->getDepositedAmount());
} else {
$payment = $pendingTransaction->getPayment();
}
..etc
}
The text was updated successfully, but these errors were encountered: