-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #453 from FatchipRobert/MAG2-250-Ratepay-allowed-m…
…onths MAG2-250 - Fixed problem with installment runtimes in guest mode
- Loading branch information
Showing
9 changed files
with
196 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2017 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
/*jshint browser:true jquery:true*/ | ||
/*global alert*/ | ||
define([ | ||
'jquery', | ||
'Magento_Checkout/js/model/url-builder', | ||
'mage/storage', | ||
'Magento_Checkout/js/model/full-screen-loader', | ||
'Magento_Checkout/js/model/quote', | ||
'Magento_Customer/js/model/customer' | ||
], function ($, urlBuilder, storage, fullScreenLoader, quote, customer) { | ||
'use strict'; | ||
|
||
/** Override default place order action and add agreement_ids to request */ | ||
return function (baseView) { | ||
var serviceUrl; | ||
|
||
var request = { | ||
cartId: quote.getQuoteId() | ||
}; | ||
if (!customer.isLoggedIn()) { | ||
serviceUrl = urlBuilder.createUrl('/guest-carts/:quoteId/payone-ratepayGetAllowedMonths', { | ||
quoteId: quote.getQuoteId() | ||
}); | ||
} else { | ||
serviceUrl = urlBuilder.createUrl('/carts/mine/payone-ratepayGetAllowedMonths', {}); | ||
} | ||
|
||
fullScreenLoader.startLoader(); | ||
|
||
return storage.post( | ||
serviceUrl, | ||
JSON.stringify(request) | ||
).done( | ||
function (response) { | ||
if (response.success === true && response.allowed_months !== undefined) { | ||
baseView.allowedMonths(JSON.parse(response.allowed_months)); | ||
} else { | ||
alert(response.errormessage); | ||
} | ||
fullScreenLoader.stopLoader(); | ||
} | ||
).fail( | ||
function (response) { | ||
//errorProcessor.process(response, messageContainer); | ||
alert('An error occured.'); | ||
fullScreenLoader.stopLoader(); | ||
} | ||
); | ||
}; | ||
}); |
This file contains 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