Skip to content

Support checkout session - #241

Open
BushraAsif wants to merge 24 commits into
mainfrom
support-checkoutSession
Open

Support checkout session#241
BushraAsif wants to merge 24 commits into
mainfrom
support-checkoutSession

Conversation

@BushraAsif

Copy link
Copy Markdown
Contributor

No description provided.

dependabot Bot and others added 7 commits April 22, 2026 07:57
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…egration-tests/lodash-4.18.1

Bump lodash from 4.17.23 to 4.18.1 in /Test/integration-tests
…egration-tests/max/minimatch-3.1.5

Bump minimatch from 3.1.2 to 3.1.5 in /Test/integration-tests/max

@shahbaz-mehar shahbaz-mehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes have been reviewed.

BushraAsif and others added 7 commits May 21, 2026 07:05
Removes [uuid](https://github.com/uuidjs/uuid). It's no longer used after updating ancestor dependency [cypress](https://github.com/cypress-io/cypress). These dependencies need to be updated together.


Removes `uuid`

Updates `cypress` from 13.1.0 to 15.15.0
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v13.1.0...v15.15.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version:
  dependency-type: indirect
- dependency-name: cypress
  dependency-version: 15.15.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
…egration-tests/multi-abfde44b12

Bump uuid and cypress in /Test/integration-tests
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.1 to 0.2.6.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](raszi/node-tmp@v0.2.1...v0.2.6)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…egration-tests/min/tmp-0.2.6

Bump tmp from 0.2.1 to 0.2.6 in /Test/integration-tests/min
Comment thread Model/Gateway.php Outdated

if (empty($sessionId)) {
try {
$sessionId = 'session-' . $order->getQuoteId() . '-' . $order->getIncrementId();

@emicha emicha Jun 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In Magento, Quote IDs and Increment IDs are predictable, sequential integers.

An attacker understands the sequential nature of Magento Order Increment IDs and Quote IDs. The attacker can predict the sessionId generated for other customers' checkout sessions. the attacker could potentially hijack another user's active checkout session, access sensitive payment details, or manipulate the payment state.

I think the right approach will be to hash the value with a salt, so it can't be guessed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@emicha I have updated this to use protect code (a unique alphanumeric token).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@emicha , I have adjusted the session ID handling. Since Magento protect_code is generated per order and changes when a new order is created after a failed payment attempt, we now use a separate AltaPay session token linked to the quote/checkout flow.

Comment thread Model/Gateway.php
$storeCode = $order->getStore()->getCode();
$activeTerminals = $this->getActiveTerminals($request, $storeScope, $storeCode);

$sessionKey = 'altapay_checkout_session_id_' . $order->getQuoteId();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You are using the quoteId directly, instead of a hash.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@emicha, the quoteID here is only used to build the internal Magento checkout-session key and is not sent to AltaPay. The value passed as AltaPay’s session_id is $sessionToken, which is generated from the SHA-256 hash of the quote ID and encoded as base64url.

…egration-tests/min/form-data-4.0.6

Bump form-data from 4.0.5 to 4.0.6 in /Test/integration-tests/min
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.

4 participants