0

In magento 1 paypal redirect message displayed on the page this way: /app/design/frontend/base/default/template/paypal/payment/ "getRedirectMessage() ?>" What function in magento 2 do the same? and which file is it in?

0

Like M1, M2 doesn't have this type of method. You can go to vendor/magento/module-paypal/view/frontend/web/template/payment/paypal-express.html

Now check following code snippet:


<fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
    <div class="payment-method-note">
        <!-- ko i18n: 'You will be redirected to the PayPal website.' --><!-- /ko -->
    </div>
    <!-- ko template: 'Magento_Paypal/payment/express/billing-agreement' --><!-- /ko -->
</fieldset>

Now open vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/paypal-express-abstract.js

Following method is responsible for redirect:


/** Redirect to paypal */
continueToPayPal: function () {
    if (additionalValidators.validate()) {
        //update payment method information if additional data was changed
        this.selectPaymentMethod();
        setPaymentMethodAction(this.messageContainer).done(
            function () {
                customerData.invalidate(['cart']);
                $.mage.redirect(
                    window.checkoutConfig.payment.paypalExpress.redirectUrl[quote.paymentMethod().method]
                );
            }
        );

        return false;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.