Skip to content

Commit

Permalink
Release 0.9.1: Clearpay Messaging Bugfix
Browse files Browse the repository at this point in the history
0a7d5a91ac1bd9699f31604da548c7bcbd63e3f3
  • Loading branch information
jay-rvvup committed Jan 16, 2023
1 parent 7dfec6b commit 8b015d6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ var config = {
"Magento_Bundle/js/price-bundle": {
'Rvvup_Payments/js/bundle/price-bundle-mixin' : true
},
"Magento_Checkout/js/model/cart/totals-processor/default": {
'Rvvup_Payments/js/clearpay/clearpay-price-mixin' : true
},
}
}
};
17 changes: 17 additions & 0 deletions view/frontend/web/js/clearpay/clearpay-price-mixin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
define(['mage/utils/wrapper'],
function (wrapper) {
'use strict';

return function (superEstimateTotals) {
superEstimateTotals.estimateTotals = wrapper.wrapSuper(superEstimateTotals.estimateTotals, function (address) {
this._super(address).done(function (result) {
let clearpaySummaryElement = document.getElementById('clearpay-summary');

if (clearpaySummaryElement !== null && clearpaySummaryElement.length !== 0) {
clearpaySummaryElement.dataset.amount = result['base_grand_total'];
}
});
});
return superEstimateTotals;
};
});

0 comments on commit 8b015d6

Please sign in to comment.