Skip to content

Conversation

@Ham1dRz
Copy link

@Ham1dRz Ham1dRz commented Sep 27, 2025

Fix: verify transactionId mismatch for Saman payment driver (Related to shetabit/payment#351)

Description

Changed the callback function in the Saman payment driver to use $this->invoice->getUuid() instead of $this->invoice->getTransactionId(). This ensures proper transaction verification after payment.

Motivation and context

The callback function was verifying transactions using getTransactionId(), which refers to the bank token of the invoice. However, this value is not returned in the bank's response after payment. Changing to getUuid() ensures proper verification of the transaction.

Related to shetabit/payment#351

How has this been tested?

Tested on the live project by performing multiple real payment attempts. Verified that transaction verification works correctly with getUuid() and that other parts of the system are unaffected.

Screenshots (if appropriate)

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature which would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

}

// set transaction id
$this->invoice->transactionId($response);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please set resnum in the transaction id if it is used to verify the payment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is not valid. you need to set transaction id and then return in in the purchase method and then user can rely on it to verify the payment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to fix the line 86 in the purchase method instead of this line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants