<script>
var wpwlOptions = {
style: "card"
}
/* change label */
var wpwlOptions = {
onReady: function() {
$('.wpwl-label-brand').html('Card Brand');
}
}
function prepareOrder() {
var data = "authentication.userId=8a8294184f45ce7e014f4b1d16cc12df" + "&authentication.password=j3zCJ2ENaD" + "&authentication.entityId=8a8294184f45ce7e014f4b1d16bd12db" + "&amount=222.00" + "¤cy=RSD" + "&paymentType=PA";
var getOrderIdPromise = $.post(url, data);
return getOrderIdPromise;
}
$.ajaxSetup({
"cache": true
});
function getPaymenentWidgets(data) {
var getPaymentWidgetsPromise = $.getScript(src);
return getPaymentWidgetsPromise;
}
function initWidgets() {
// step 1 - get token
var getOrderIdPromise = prepareOrder();
getOrderIdPromise.done(function(data) {
// step 2 (include javascript)
var getPaymentWidgetsPromise = getPaymenentWidgets(data);
getPaymentWidgetsPromise.done(widgetsDone);
});
}
function widgetsDone() {
// nothing to do here
}
initWidgets();
</script>