Having a problem with the one page checkout. I am creating a new payment plugin for Paij payment solution. Their API uses an externally hosted js file at their site. When I click the button to go from shipping info to payment info I get the error "Uncaught Reference Error: paij is not defined"
It appears as though it doesn't recognize the external js file. Any help/ideas would be appreciated.
Here's the code for my plugin's PaymentInfo.cshtml file
@{
Layout = "";
}
@model Nop.Plugin.Payments.Paij.Models.PaymentInfoModel
@using Nop.Web.Framework;
<script src="https://api.montypay.de/assets/checkout-sdk/checkout.js" type="text/javascript"></script>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<p>@Html.Raw(Model.DescriptionText)</p>
<p>
<script type="text/javascript">
$(document).ready(function() {
$(".payment-info-next-step-button").hide();
checkout = new paij.Checkout({
web_hook: '@ViewBag.callbackurl',
api_key: '@ViewBag.user_key',
transaction: {
amount: @ViewBag.amount,
currency_code: '@ViewBag.currency',
description: '@ViewBag.storedescription'
}
}).writeButton().onSuccess(function (event) {
//figure out if this is one page or regular and go to next step;
if (document.location.href.indexOf('onepagecheckout') > -1) {
PaymentInfo.init('#co-payment-info-form', '@Request.Url.GetLeftPart(UriPartial.Authority)/checkout/OpcSavePaymentInfo/');
PaymentInfo.save();
}
else {
$(".payment-info-next-step-button").click();
//form.get(0).submit();
//this.form.submit();
}
console.log("onSuccess");
console.log(event.transaction);
}).onFail(function (event) {
console.log("onFail with %s fired!", event.error);
}).onCancel(function () {
console.log("onCancel fired!");
});
});
</script>
<input type="hidden" id="paijform" name="paijform" value="0" />
</p>
</td>
</tr>
</table>