Skip to content

Fix the WLB redirection issue for stage - #550

Open
pratik-bharodiya wants to merge 4 commits into
developfrom
Stag-WLB-Issue
Open

pratik-bharodiya wants to merge 4 commits into
developfrom
Stag-WLB-Issue

Conversation

@pratik-bharodiya

Copy link
Copy Markdown
Collaborator

Description

  • Resolve the Issue (Issue : On Stage env while place the order using the instalment method in sandbox mode. Redirect to production url instead of redirect to stage URL)

Rollback procedure

default rollback procedure

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Existing test construction breaks, and the WLB-specific override needs gating and coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds configurable sandbox installment descriptions to correct WLB stage redirection.

Changes:

  • Injects DeploymentConfig into APMBuilder.
  • Applies configurable description templates in sandbox mode.
File Summary Review notes
Gateway/​Request/​APMBuilder.php Adds sandbox WLB description generation. Critical: update existing constructor calls for DeploymentConfig. Moderate: gate the override to WLB flows. Nit: add focused unit coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +170 to +171
RequestHelper $requestHelper,
DeploymentConfig $deploymentConfig
Comment thread Gateway/Request/APMBuilder.php Outdated
Comment on lines +220 to +221
if ($this->config->isSandboxEnabled()) {
$paymentInfo[self::DESCRIPTION] = 'Magento 2 Order id ' . $order->getOrderIncrementId();
Comment on lines +220 to +228
if ($this->config->isSandboxEnabled()) {
$paymentInfo[self::DESCRIPTION] = 'Magento 2 Order id ' . $order->getOrderIncrementId();
$customWlbDescription = $this->deploymentConfig->get(self::OMISE_CUSTOM_WLB_DESCRIPTION);
if (!empty($customWlbDescription) && !empty($paymentInfo[self::DESCRIPTION])) {
$paymentInfo[self::DESCRIPTION] = str_replace(
'{original_description}',
$paymentInfo[self::DESCRIPTION],
$customWlbDescription
);
$paymentInfo[self::SOURCE] = $source;
}

if ($this->config->isSandboxEnabled()) {

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.

question: ‏Not sure why should it be only sandbox. Should this also work for live keys on staging as well? 💡

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I add this condition because we face the issue only on sandbox mode. So for production/live mode no need to get env variable value and manipulate description.

Comment thread Gateway/Request/APMBuilder.php Outdated
}

if ($this->config->isSandboxEnabled()) {
$paymentInfo[self::DESCRIPTION] = 'Magento 2 Order id ' . $order->getOrderIncrementId();

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.

question: The description Magento 2 Order id xx is now on both APMBuilder and PaymentDataBuilder. Can we somehow put it at one place. So later if we have to update the description, we can update it in one place.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I create one function for generate the description. so we can use this function anywhere. Currently implemented in PaymentDataBuilder, APMBuilder, and. UPAPaymentDataBuilder.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Required constructor updates, behavior safeguards, and test coverage remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity · 1 Low severity

Open (4)

Comment on lines 73 to +77
public function __construct(
Cc $ccConfig,
OmiseMoney $money,
Capability $capability
Capability $capability,
OmiseHelper $omiseHelper
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