When using the iframe client portal solution on my own website, there is a problem when you use the buy now button.
The option “Landing Page” under “Buy Now Buttons” has two options:
- Invoice
- Payment
The payment option does not work, it will always show the invoice page first.
I can see the iframe code is not setup to show this properly:
<center>
<iframe id="invoiceIFrame" width="100%" height="1200" style="max-width:1000px"></iframe>
<center>
<script language="javascript">
var iframe = document.getElementById('invoiceIFrame');
iframe.src = 'https://app.invoiceninja.com/view/'
+ window.location.search.substring(1, 33);
</script>
It should be something like this:
<center>
<iframe id="invoiceIFrame" width="100%" height="1200" style="max-width:1000px"></iframe>
<center>
<script language="javascript">
var iframe = document.getElementById('invoiceIFrame');
var ninja_hash = window.location.search.substring(1, 33);
iframe.src = (window.location.search.substring(1).search('credit_card') != -1 ? 'https://app.invoiceninja.com/payment/' + ninja_hash + '/credit_card' : 'https://app.invoiceninja.com/view/' + ninja_hash);
</script>
Now the invoice options works, you are redirected to that page, but there is a small problem. For some reason the white button that takes you back to the invoice page from the payment page has the wrong URL, it has the same URL as the current page (the payment page).
Is there something I can do to make this work?
Thanks.