Repository navigation
fix: third parties checkout #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6ea8431
chore: sync version on configure page
vachmara df659a9
fix: create and use `actionValidateOrderBefore` for PS8
vachmara 8e719c4
chore: lint
vachmara d20daf5
chore: lint
vachmara bc8eded
Update pskyc.php
vachmara 0fc7911
Update pskyc.php
vachmara d160e74
chore: add index php for security
vachmara 92f46a7
chore: update FR translations
vachmara 87fa231
docs: update documentation
vachmara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| <?php | ||
|
vachmara marked this conversation as resolved.
Resolved
|
||
|
|
||
| /** | ||
| * MIT License | ||
| * Copyright (c) 2025 Valentin Chmara | ||
| * | ||
| * @author Valentin Chmara | ||
| * @copyright Valentin Chmara | ||
| * @license MIT | ||
| */ | ||
| if (!defined('_PS_VERSION_')) { | ||
| exit; | ||
| } | ||
| class PaymentModule extends PaymentModuleCore | ||
| { | ||
| /** | ||
| * Validate an order in database | ||
| * Function called from a payment module. | ||
| * | ||
| * @param int $id_cart | ||
| * @param int $id_order_state | ||
| * @param float $amount_paid Amount really paid by customer (in the default currency) | ||
| * @param string $payment_method Payment method (eg. 'Credit card') | ||
| * @param string|null $message Message to attach to order | ||
| * @param array $extra_vars | ||
| * @param int|null $currency_special | ||
| * @param bool $dont_touch_amount | ||
| * @param string|bool $secure_key | ||
| * @param Shop $shop | ||
| * @param string|null $order_reference if this parameter is not provided, a random order reference will be generated | ||
| * | ||
| * @return bool | ||
| * | ||
| * @throws PrestaShopException | ||
| */ | ||
| public function validateOrder( | ||
| $id_cart, | ||
| $id_order_state, | ||
| $amount_paid, | ||
| $payment_method = 'Unknown', | ||
| $message = null, | ||
| $extra_vars = [], | ||
| $currency_special = null, | ||
| $dont_touch_amount = false, | ||
| $secure_key = false, | ||
| ?Shop $shop = null, | ||
| ?string $order_reference = null, | ||
|
vachmara marked this conversation as resolved.
Resolved
|
||
| ) { | ||
| // Only for Prestashop 8: execute the pre-order validation hook | ||
| if (version_compare(_PS_VERSION_, '9.0.0', '<')) { | ||
| Hook::exec('actionValidateOrderBefore', [ | ||
| 'cart' => $this->context->cart, | ||
| 'customer' => $this->context->customer, | ||
| 'currency' => $this->context->currency, | ||
| 'id_order_state' => &$id_order_state, | ||
| 'payment_method' => $payment_method, | ||
| ]); | ||
| } | ||
|
vachmara marked this conversation as resolved.
Resolved
|
||
|
|
||
| return parent::validateOrder( | ||
| $id_cart, | ||
| $id_order_state, | ||
| $amount_paid, | ||
| $payment_method, | ||
| $message, | ||
| $extra_vars, | ||
| $currency_special, | ||
| $dont_touch_amount, | ||
| $secure_key, | ||
| $shop, | ||
| $order_reference | ||
| ); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| } | ||
| } | ||
|
vachmara marked this conversation as resolved.
Resolved
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * MIT License | ||
| * Copyright (c) 2025 Valentin Chmara | ||
| * | ||
| * @author Valentin Chmara | ||
| * @copyright Valentin Chmara | ||
| * @license MIT | ||
| */ | ||
| header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
| header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
|
||
| header('Cache-Control: no-store, no-cache, must-revalidate'); | ||
| header('Cache-Control: post-check=0, pre-check=0', false); | ||
| header('Pragma: no-cache'); | ||
|
|
||
| header('Location: ../'); | ||
| exit; |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.