![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-checkout/view/frontend/web/js/action/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * @api */ define( [ 'jquery', 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/url-builder', 'mage/storage', 'Magento_Checkout/js/model/error-processor', 'Magento_Customer/js/model/customer', 'Magento_Checkout/js/model/full-screen-loader', 'Magento_Checkout/js/action/get-payment-information' ], function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader, getPaymentInformationAction ) { 'use strict'; return function (messageContainer) { var serviceUrl, payload; /** * Checkout for guest and registered customer. */ if (!customer.isLoggedIn()) { serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/billing-address', { cartId: quote.getQuoteId() }); payload = { cartId: quote.getQuoteId(), address: quote.billingAddress() }; } else { serviceUrl = urlBuilder.createUrl('/carts/mine/billing-address', {}); payload = { cartId: quote.getQuoteId(), address: quote.billingAddress() }; } fullScreenLoader.startLoader(); return storage.post( serviceUrl, JSON.stringify(payload) ).done( function () { var deferred = $.Deferred(); getPaymentInformationAction(deferred); $.when(deferred).done(function () { fullScreenLoader.stopLoader(); }); } ).fail( function (response) { errorProcessor.process(response, messageContainer); fullScreenLoader.stopLoader(); } ); }; } );