Skip to content

Mit 3440 - UPA Flow for offsite payment method.#529

Merged
pratik-bharodiya merged 39 commits into
feature-upafrom
MIT-3440
Jul 9, 2026
Merged

Mit 3440 - UPA Flow for offsite payment method.#529
pratik-bharodiya merged 39 commits into
feature-upafrom
MIT-3440

Conversation

@pratik-bharodiya

@pratik-bharodiya pratik-bharodiya commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

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

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.

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_feature gated flow for offline payment renderer to fetch /V1/orders/:order_id/omise-offsite and redirect to authorize_uri.
  • Tighten typing in CapabilityConfigProvider::isWlbEnabled() by adding an array parameter type.
  • Update UPAPaymentDetailsHandler to derive and store payment_type from the Omise method id mapping (via OmiseHelper).

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

  • UPAPaymentDetailsHandler now sets payment_type based on the method mapping. There are unit tests for the non-UPA PaymentDetailsHandler (e.g. Test/Unit/PaymentDetailsHandlerTest.php), but no equivalent coverage for this handler. Adding a unit test would help prevent regressions for payment_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
Comment thread Gateway/Response/UPAPaymentDetailsHandler.php Outdated
Comment thread view/frontend/web/js/view/payment/omise-offline-method-renderer.js Outdated
@pratik-bharodiya
pratik-bharodiya merged commit a199c87 into feature-upa Jul 9, 2026
1 check failed
@pratik-bharodiya
pratik-bharodiya deleted the MIT-3440 branch July 9, 2026 11:07
@pratik-bharodiya
pratik-bharodiya restored the MIT-3440 branch July 9, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants