Skip to content
Code-Schnipsel Gruppen Projekte
Commit b7fc6c94 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

fix: re-render Amazon Pay button

Übergeordneter 5c3ce209
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -78,6 +78,9 @@ define('package/quiqqer/payment-amazon/bin/controls/PaymentDisplay', [
this.$AuthBtnElm = Elm.getElement('#quiqqer-payment-amazon-btn');
this.$WalletElm = Elm.getElement('#quiqqer-payment-amazon-wallet');
// set random id for AuthBtn to enable re-rending of Amazon Btn Widget
this.$AuthBtnElm.set('id', this.$AuthBtnElm.get('id') + '-' + Math.floor((Math.random() * 1000000) + 1));
this.$showMsg(
QUILocale.get(pkg, 'controls.PaymentDisplay.info')
);
......@@ -112,12 +115,8 @@ define('package/quiqqer/payment-amazon/bin/controls/PaymentDisplay', [
window.onAmazonLoginReady = this.$onAmazonLoginReady;
if (typeof amazon !== 'undefined') {
var ScriptElm = document.getElement('script[src="' + widgetUrl + '"]');
if (ScriptElm) {
amazon = null;
ScriptElm.destroy();
}
this.$showAmazonPayBtn();
return;
}
new Element('script', {
......@@ -171,14 +170,6 @@ define('package/quiqqer/payment-amazon/bin/controls/PaymentDisplay', [
});
},
onFinish: function() {
console.log("Amazon onFinish");
},
onSuccess: function() {
console.log("Amazon onSuccess");
},
onError: function (Error) {
switch (Error.getErrorCode()) {
// handle errors on the shop side (most likely misconfiguration)
......@@ -209,7 +200,7 @@ define('package/quiqqer/payment-amazon/bin/controls/PaymentDisplay', [
this.$OrderProcess.Loader.show();
var waitForBtnElm = setInterval(function() {
var waitForBtnElm = setInterval(function () {
var AmazonBtnImg = self.$AuthBtnElm.getElement('img');
if (!AmazonBtnImg) {
......
......@@ -3,12 +3,12 @@
width: 100%;
}
#quiqqer-payment-amazon-btn {
.quiqqer-payment-amazon-btn-elm {
margin-top: 35px;
text-align: center;
}
#quiqqer-payment-amazon-btn img {
.quiqqer-payment-amazon-btn-elm img {
max-width: 100% !important;
}
......
......@@ -9,7 +9,7 @@
{else}
<div class="quiqqer-payment-amazon-message"></div>
<div class="quiqqer-payment-amazon-content">
<div id="quiqqer-payment-amazon-btn" data-size="{$btn_size}" data-color="{$btn_color}"></div>
<div id="quiqqer-payment-amazon-btn" class="quiqqer-payment-amazon-btn-elm" data-size="{$btn_size}" data-color="{$btn_color}"></div>
<div id="quiqqer-payment-amazon-wallet" class="quiqqer-payment-amazon__hidden"></div>
<div id="quiqqer-payment-amazon-btn-pay" data-price="{$display_price}"></div>
</div>
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren