Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from manuelkleinert/master
Browse files Browse the repository at this point in the history
Fix Javascript load problem
  • Loading branch information
Manuel Kleinert authored Jan 20, 2017
2 parents 83ff7f4 + 2ede7d8 commit bc4c0d3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions views/scripts/datatrans-lightbox/payment.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//pilot.datatrans.biz/upp/payment/js/datatrans-1.0.2.js"></script>

<form id="paymentForm"
<?php foreach($this->params as $key => $value) : ?>
data-<?=$key?>="<?=$value?>"
<?php endforeach; ?>
</form>
<script type="text/javascript">
if(!window.jQuery){
var jq = document.createElement('script'); jq.type = 'text/javascript';
jq.src = '//code.jquery.com/jquery-1.11.2.min.js';
document.getElementsByTagName('head')[0].appendChild(jq);
}

$(document).ready(function() {
Datatrans.startPayment({'form': '#paymentForm'});
$.getScript('//pilot.datatrans.biz/upp/payment/js/datatrans-1.0.2.js', function () {
Datatrans.startPayment({
'form': '#paymentForm',
'closed': function() {
$(document).trigger("DatatransLightboxClose");
}
});
});
});
</script>
</script>

0 comments on commit bc4c0d3

Please sign in to comment.