Mit 3440 - UPA Flow for offsite payment method.#529
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for the UPA (Omise Checkout Session) flow in the Magento checkout integration by conditionally redirecting shoppers to an authorization URL after order placement, and by persisting the appropriate UPA metadata on the order payment.
Changes:
- Add an
omise_upa_featuregated flow for offline payment renderer to fetch/V1/orders/:order_id/omise-offsiteand redirect toauthorize_uri. - Tighten typing in
CapabilityConfigProvider::isWlbEnabled()by adding anarrayparameter type. - Update
UPAPaymentDetailsHandlerto derive and storepayment_typefrom the Omise method id mapping (viaOmiseHelper).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| view/frontend/web/js/view/payment/omise-offline-method-renderer.js | Adds UPA-feature conditional redirect flow using Magento Web API response. |
| Model/Ui/CapabilityConfigProvider.php | Improves type-safety for WLB-enabled detection helper. |
| Gateway/Response/UPAPaymentDetailsHandler.php | Stores UPA redirect/session details and sets payment_type based on mapped method id. |
Comments suppressed due to low confidence (1)
Gateway/Response/UPAPaymentDetailsHandler.php:48
UPAPaymentDetailsHandlernow setspayment_typebased on the method mapping. There are unit tests for the non-UPAPaymentDetailsHandler(e.g.Test/Unit/PaymentDetailsHandlerTest.php), but no equivalent coverage for this handler. Adding a unit test would help prevent regressions forpayment_type/additional-information behavior in the UPA flow.
public function handle(array $handlingSubject, array $response)
{
$payment = SubjectReader::readPayment($handlingSubject);
$payment = $payment->getPayment();
$methodId = $this->helper->getMethodId($payment->getMethod());
$paymentType = ($response['session']->object == "checkout_session") ? $methodId : null;
$order = $payment->getOrder();
$payment->setAdditionalInformation('upa_redirect_uri', $response['session']->redirect_url);
$payment->setAdditionalInformation('session_id', $response['session']->id);
$payment->setAdditionalInformation('payment_type', $paymentType);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+37
| .done(function (order_id) { | ||
| const storageFailHandler = buildFailHandler(this), | ||
| serviceUrl = self.getMagentoReturnUrl(order_id); |
Comment on lines
+41
to
+45
| if (response) { | ||
| $.mage.redirect(response.authorize_uri); | ||
| } else { | ||
| storageFailHandler(response); | ||
| } |
Comment on lines
81
to
83
| * Check the Wlb active or not | ||
| * @var array | ||
| * @return bool |
rosle
reviewed
Jul 9, 2026
rosle
approved these changes
Jul 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Implement UPA flow for offsite payment (proptpay,Paynow,etc..) methods. Redirect customer to UPA page when UPA feature is enable from admin configuration instead of normal payment flow.
Rollback procedure
default rollback procedure