diff --git a/composer.json b/composer.json index 5e29d6d4..fae353bf 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,11 @@ { "name": "bread/module-breadcheckout", - "description": "Offers the Bread financing and checkout tools for your Magento store", + "description": "Offers Bread Pay financing and checkout tools for your Magento store", "license": "MIT", "minimum-stability": "stable", - "version": "1.1.19", + "version": "2.0.1", "require": { - "php": "~7.0.13||~7.1.0||~7.1.3||~7.2.0||~7.3.0||~7.4.0" + "php": "~7.0.13||~7.1.0||~7.1.3||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0" }, "type": "magento2-module", "repositories": [{ diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index f002047f..acc784cc 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -3,15 +3,15 @@
- + complex Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group - Bread Payments by getbread.com - Onsite Consumer Financing. -
Developers API reference: Bread Developer API Reference + Bread Pay by payments.breadfinancial.com - Onsite Consumer Financing. +
Developers API reference: Bread Developer API Reference ]]>
diff --git a/view/adminhtml/templates/breadcheckout/css.phtml b/view/adminhtml/templates/breadcheckout/css.phtml index cc709290..4c35e3d0 100644 --- a/view/adminhtml/templates/breadcheckout/css.phtml +++ b/view/adminhtml/templates/breadcheckout/css.phtml @@ -9,7 +9,7 @@ height: 44px; margin-bottom: 10px; display: block; - background: url('getViewFileUrl('Bread_BreadCheckout/bread/images/bread-logo.png'); ?>'); + background: url('getViewFileUrl('Bread_BreadCheckout/bread/images/bread-financial.png'); ?>'); background-repeat: no-repeat; background-size: 155px 44px; } diff --git a/view/adminhtml/web/bread/images/bread-financial.png b/view/adminhtml/web/bread/images/bread-financial.png new file mode 100644 index 00000000..f3dead8e Binary files /dev/null and b/view/adminhtml/web/bread/images/bread-financial.png differ diff --git a/view/adminhtml/web/bread/images/bread-logo.png b/view/adminhtml/web/bread/images/bread-logo.png deleted file mode 100644 index dd69abfd..00000000 Binary files a/view/adminhtml/web/bread/images/bread-logo.png and /dev/null differ diff --git a/view/frontend/web/js/view/shipping.js b/view/frontend/web/js/view/shipping.js index 460b1828..85842443 100644 --- a/view/frontend/web/js/view/shipping.js +++ b/view/frontend/web/js/view/shipping.js @@ -7,85 +7,86 @@ */ /*global define*/ define( - [ - 'Magento_Checkout/js/view/shipping', - 'jquery', - 'Magento_Checkout/js/model/quote', - 'Magento_Checkout/js/model/full-screen-loader', - 'buttonConfig', - ], - function (Shipping, $, quote, fullScreenLoader, button) { - 'use strict'; - return Shipping.extend( - { - setShippingInformation: function () { - /** - * Call parent method - */ - Shipping.prototype.setShippingInformation.call(this); + [ + 'Magento_Checkout/js/view/shipping', + 'jquery', + 'Magento_Checkout/js/model/quote', + 'Magento_Checkout/js/model/full-screen-loader', + 'buttonConfig' + ], + function (Shipping, $, quote, fullScreenLoader, button) { + 'use strict'; + return Shipping.extend( + { + setShippingInformation: function () { + /** + * Call parent method + */ + Shipping.prototype.setShippingInformation.call(this); - this.updateConfigData(); - this.invalidateToken(); - this.refreshBreadPaymentMethod(); - }, + this.updateConfigData(); + this.invalidateToken(); + this.refreshBreadPaymentMethod(); + }, - /** - * Add updated shipping option data to window.checkoutConfig global variable - * - * @see Bread\BreadCheckout\Model\Ui\ConfigProvider - */ - updateConfigData: function () { - window.checkoutConfig.payment.breadcheckout.breadConfig.shippingOptions = { - type: quote.shippingMethod().carrier_title + ' - ' + quote.shippingMethod().method_title, - typeId: quote.shippingMethod().carrier_code + '_' + quote.shippingMethod().method_code, - cost: this.round(quote.shippingMethod().base_amount) - }; - }, + /** + * Add updated shipping option data to window.checkoutConfig global variable + * + * @see Bread\BreadCheckout\Model\Ui\ConfigProvider + */ + updateConfigData: function () { + window.checkoutConfig.payment.breadcheckout.breadConfig.shippingOptions = { + type: quote.shippingMethod().carrier_title + ' - ' + quote.shippingMethod().method_title, + typeId: quote.shippingMethod().carrier_code + '_' + quote.shippingMethod().method_code, + cost: this.round(quote.shippingMethod().base_amount) + }; + }, - /** - * Invalidate existing transaction ID (in case user filled out payment - * form and then went back a step) - */ - invalidateToken: function () { - if (window.checkoutConfig.payment.breadcheckout.transactionId !== null) { - window.checkoutConfig.payment.breadcheckout.transactionId = null; - } - }, - - /** - * - * Refresh the payment method section if transactionId is not set - */ - refreshBreadPaymentMethod: function () { - var paymentMethod = quote.paymentMethod(); - if (typeof paymentMethod !== 'undefined') { - if (typeof paymentMethod.method !== 'undefined') { - if (quote.paymentMethod().method === 'breadcheckout' - && window.checkoutConfig.payment.breadcheckout.transactionId === null) { - button.embeddedCheckout(); - } - } - - } - - }, - - /** - * Round float to 2 decimal plates and convert to integer - * - * @param value - * @returns {Number} - */ - round: function (value) { - if (isNaN(value)) { - return 0; + /** + * Invalidate existing transaction ID (in case user filled out payment + * form and then went back a step) + */ + invalidateToken: function () { + if (window.checkoutConfig.payment.breadcheckout.transactionId !== null) { + window.checkoutConfig.payment.breadcheckout.transactionId = null; + } + }, + + /** + * + * Refresh the payment method section if transactionId is not set + */ + refreshBreadPaymentMethod: function () { + var paymentMethod = quote.paymentMethod(); + if ( paymentMethod !== null && typeof paymentMethod.method !== 'undefined') { + if (quote.paymentMethod().method === 'breadcheckout' + && window.checkoutConfig.payment.breadcheckout.transactionId === null) { + //Check if embeddedCheckout is enabled + if(window.checkoutConfig.payment.breadcheckout.breadConfig.embeddedCheckout) { + button.embeddedCheckout(); + } else { + button.init(); } - return parseInt( - Number(Math.round(parseFloat(value) + 'e' + 2) + 'e-' + 2) - * 100 - ); } + } + }, + + /** + * Round float to 2 decimal plates and convert to integer + * + * @param value + * @returns {Number} + */ + round: function (value) { + if (isNaN(value)) { + return 0; } - ); - } + return parseInt( + Number(Math.round(parseFloat(value)+'e'+2)+'e-'+2) + * 100 + ); + } + } + ); + } );