Skip to content

Commit

Permalink
Release 4.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sauliususonis committed Sep 15, 2021
1 parent 5579317 commit 7e4b77e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.8
- Checkout form auto submission implemented when iFrame returns no input fields

# 4.0.7
- Fix Transaction Rollback error on unsupported languages

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.8
- Automatische Übermittlung des Checkout-Formulars implementiert, wenn iFrame keine Eingabefelder zurückgibt

# 4.0.7
- Behebung des Transaktions-Rollback-Fehlers in nicht unterstützten Sprachen

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tail -f var/log/wallee_payment*.log

## Documentation

[Documentation](https://plugin-documentation.wallee.com/wallee-payment/shopware-6/4.0.7/docs/en/documentation.html)
[Documentation](https://plugin-documentation.wallee.com/wallee-payment/shopware-6/4.0.8/docs/en/documentation.html)

## License

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"wallee/sdk": "3.0.1"
},
"type": "shopware-platform-plugin",
"version": "4.0.7"
"version": "4.0.8"
}
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/shopware-6/releases/tag/4.0.7/">
<a href="https://github.com/wallee-payment/shopware-6/releases/tag/4.0.8/">
Source
</a>
</li>
Expand Down
25 changes: 24 additions & 1 deletion src/Resources/public/storefront/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
getIframe: function () {
const paymentPanel = document.getElementById(WalleeCheckout.payment_panel_id);
const paymentMethodConfigurationId = paymentPanel.dataset.id;
const iframeContainer = document.getElementById(WalleeCheckout.payment_method_iframe_id);

if (!WalleeCheckout.handler) { // iframe has not been loaded yet
// noinspection JSUnresolvedFunction
WalleeCheckout.handler = window.IframeCheckoutHandler(paymentMethodConfigurationId);
Expand All @@ -99,17 +101,38 @@
let loader = document.getElementById(WalleeCheckout.loader_id);
loader.parentNode.removeChild(loader);
WalleeCheckout.activateLoader(false);
if (this.measureIframe(iframeContainer) < 1) {
WalleeCheckout.handler.submit();
}
});
WalleeCheckout.handler.setHeightChangeCallback((height)=>{
if(height < 1){ // iframe has no fields
WalleeCheckout.handler.submit();
}
});
const iframeContainer = document.getElementById(WalleeCheckout.payment_method_iframe_id);
WalleeCheckout.handler.create(iframeContainer);
}
},

/**
* pixel height of first iframe or 0
* @param iframeContainer
* @return {int}
*/
measureIframe: function (iframeContainer) {
if (iframeContainer.tagName.toLowerCase() === 'iframe') {
return iframeContainer.offsetHeight;
}

iframeContainer.childNodes.forEach( child => {
if (child.tagName.toLowerCase() === 'iframe') {
return child.offsetHeight;
}
})

return 0;
},

/**
* validation callback
* @param validationResult
Expand Down

0 comments on commit 7e4b77e

Please sign in to comment.