Repository navigation
Fix the WLB redirection issue for stage - #550
pratik-bharodiya wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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
Open (3)
What changed in this PR
Adds configurable sandbox installment descriptions to correct WLB stage redirection.
Changes:
- Injects
DeploymentConfigintoAPMBuilder. - 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.
| RequestHelper $requestHelper, | ||
| DeploymentConfig $deploymentConfig |
| if ($this->config->isSandboxEnabled()) { | ||
| $paymentInfo[self::DESCRIPTION] = 'Magento 2 Order id ' . $order->getOrderIncrementId(); |
| 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()) { |
There was a problem hiding this comment.
question: Not sure why should it be only sandbox. Should this also work for live keys on staging as well? 💡
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| if ($this->config->isSandboxEnabled()) { | ||
| $paymentInfo[self::DESCRIPTION] = 'Magento 2 Order id ' . $order->getOrderIncrementId(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yes, I create one function for generate the description. so we can use this function anywhere. Currently implemented in PaymentDataBuilder, APMBuilder, and. UPAPaymentDataBuilder.
| public function __construct( | ||
| Cc $ccConfig, | ||
| OmiseMoney $money, | ||
| Capability $capability | ||
| Capability $capability, | ||
| OmiseHelper $omiseHelper |



Description
Rollback procedure
default rollback procedure