Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dispatch : function(callback) {
var payObj = {};
_gaq.push(['_trackEvent','Checkout','App Event','Attempting to create order']);
// initially, was serializing the payment panel only. Issues here with safari.
// then, when loading .val(), field was not reliably present.
// cc info is saved in memory so that if payment panel is reloaded, cc# is available. so that reference is used for cc and cv.
// exp alone is less valuable, so it's stored in data.cart obj and referenced there.
payObj['payment.cc'] = myControl.ext.convertSessionToOrder.vars["payment.cc"];
payObj['payment.cv'] = myControl.ext.convertSessionToOrder.vars["payment.cv"];
payObj['payment.yy'] = myControl.ext.convertSessionToOrder.vars["payment.yy"];
payObj['payment.mm'] = myControl.ext.convertSessionToOrder.vars["payment.mm"];
payObj['_cmd'] = 'cartOrderCreate';
payObj['_tag'] = {"callback":callback,"extension":"convertSessionToOrder","datapointer":"cartOrderCreate"}
myControl.util.dump("PayObj to follow:");
myControl.util.dump(payObj);
myControl.model.addDispatchToQ(payObj,'immutable');
}
},//cartOrderCreate
dispatch : function(callback) {
var payObj = {};
_gaq.push(['_trackEvent','Checkout','App Event','Attempting to create order']);
// initially, was serializing the payment panel only. Issues here with safari.
// then, when loading .val(), field was not reliably present.
// cc info is saved in memory so that if payment panel is reloaded, cc# is available. so that reference is used for cc and cv.
// exp alone is less valuable, so it's stored in data.cart obj and referenced there.
payObj['payment.cc'] = myControl.ext.convertSessionToOrder.vars["payment.cc"];
payObj['payment.cv'] = myControl.ext.convertSessionToOrder.vars["payment.cv"];
payObj['payment.yy'] = myControl.ext.convertSessionToOrder.vars["payment.yy"];
payObj['payment.mm'] = myControl.ext.convertSessionToOrder.vars["payment.mm"];
payObj['_cmd'] = 'cartOrderCreate';
payObj['_tag'] = {"callback":callback,"extension":"convertSessionToOrder","datapointer":"cartOrderCreate"}
// myControl.util.dump("PayObj to follow:");
// myControl.util.dump(payObj);
myControl.model.addDispatchToQ(payObj,'immutable');
}
},//cartOrderCreate
if($selectedPayment.length == 0) {
$selectedPayment = $("<ul>").attr("id","paybySupplemental_"+paymentID).addClass("paybySupplemental noPadOrMargin noListStyle ui-widget-content ui-corner-bottom");
$('#payby_'+paymentID).append($selectedPayment);
var o = '';
var safeid;
switch(paymentID) {
//for credit cards, we can't store the # or cid in local storage. Save it in memory so it is discarded on close, reload, etc
//expiration is less of a concern
case 'CREDIT':
o = "<li><label for="payment-cc">Credit Card #<\/label><input value="";
if(myControl.ext.convertSessionToOrder.vars[" class="creditCard" id="payment-cc" name="payment.cc" size="20" type="text"><\/li>";
o += "</label></li><li><label>Expiration<\/label><select class="creditCardMonthExp" id="payment-mm" name="payment.mm"><option><\/option>";
o += myControl.util.getCCExpMonths(myControl.data.cartItemsList.cart['payment.mm']);
o += "<\/select>";
o += "</option></select><option value=""><\/option>"+myControl.util.getCCExpYears(myControl.data.cartItemsList.cart['payment.yy'])+"<\/select><\/li>";
o += "</option></label></li><li><label for="payment.cv">CVV/CID<\/label><input value="";
if(myControl.ext.convertSessionToOrder.vars[" class="creditCardCVV" id="payment-cv" name="payment.cv" size="8" type="text"> <span class="ui-icon ui-icon-help"></span><\/li>";
break;
case 'PO':
o = "</label></li><li><label for="payment-po">PO #<\/label></label></li></ul>
if($selectedPayment.length == 0) {
$selectedPayment = $("<ul>").attr("id","paybySupplemental_"+paymentID).addClass("paybySupplemental noPadOrMargin noListStyle ui-widget-content ui-corner-bottom");
$('#payby_'+paymentID).append($selectedPayment);
var o = '';
var safeid;
switch(paymentID) {
//for credit cards, we can't store the # or cid in local storage. Save it in memory so it is discarded on close, reload, etc
//expiration is less of a concern
case 'CREDIT':
o = "<li><label for="payment-cc">Credit Card #<\/label><input value="";
if(myControl.ext.convertSessionToOrder.vars[" class="creditCard" id="payment-cc" name="payment.cc" size="20" type="text"><\/li>";
o += "</label></li><li><label>Expiration<\/label><select class="creditCardMonthExp" id="payment-mm" name="payment.mm"><option><\/option>";
o += myControl.util.getCCExpMonths(myControl.data.cartItemsList.cart['payment.mm']);
o += "<\/select>";
o += "</option></select><option value=""><\/option>"+myControl.util.getCCExpYears(myControl.data.cartItemsList.cart['payment.yy'])+"<\/select><\/li>";
o += "</option></label></li><li><label for="payment.cv">CVV/CID<\/label><input value="";
if(myControl.ext.convertSessionToOrder.vars[" class="creditCardCVV" id="payment-cv" name="payment.cv" size="8" type="text"> <span class="ui-icon ui-icon-help"></span><\/li>";
break;
case 'PO':
o = "</label></li><li><label for="payment-po">PO #<\/label></label></li></ul>