Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions assets/js/dintero-checkout-express.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ jQuery( function ( $ ) {
return
}

const gatewayParams = dinteroCheckoutParams

const dinteroCheckoutForWooCommerce = {
bodyEl: $( "body" ),
checkoutFormSelector: "form.checkout",
Expand Down Expand Up @@ -81,7 +79,13 @@ jQuery( function ( $ ) {
* Render the iframe and register callback functionality.
*/
async renderIframe() {
const container = $( "#dintero-checkout-iframe" )[ 0 ]
const iframeElement = $( "#dintero-checkout-iframe" )
const container = iframeElement.length ? iframeElement[ 0 ] : null

if ( ! container ) {
console.error( "Dintero Checkout: Could not find the container for the iframe." )
return
}

dintero
.embed( {
Expand Down
Loading