Skip to content

Include new parameters in session and authorize to support MarketPay integration - #158

Open
BushraAsif wants to merge 9 commits into
mainfrom
support-marketpay-applepay
Open

Include new parameters in session and authorize to support MarketPay integration#158
BushraAsif wants to merge 9 commits into
mainfrom
support-marketpay-applepay

Conversation

@BushraAsif

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread controllers/front/cardwalletsession.php Outdated
{
$db = Db::getInstance();

$uniqueId = $db->getValue('SELECT unique_id FROM `' . _DB_PREFIX_ . 'altapay_transaction` WHERE id_cart = ' . $cartId);

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.

Remember to cast, you can't guarantee that the layer using the method will do the casting for you

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.

Fixed

@@ -17,23 +19,112 @@ public function postProcess()
{
$currentShopId = $this->context->shop->id;
$validationUrl = Tools::getValue('validationUrl');

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.

Shouldn't we validate this is a valid url ?

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.

Good catch — I’ve added a check for this now.

Comment thread controllers/front/cardwalletsession.php Outdated
->setDomain($domain);

if (!$terminal->applepay_legacy_flow) {
$requestedAmount = (float) Tools::getValue('amount');

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.

Casting can return valid numeric values for bad input such as "", boolean, etc.

This can caause the requested amount to be an unexpected value

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.

Fixed

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.

3 participants