How to use the payment.cv function in payment

To help you get started, we’ve selected a few payment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CommerceRack / anycommerce / extensions / checkout_passive.js View on Github external
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
github CommerceRack / anycommerce / extensions / checkout_nice.js View on Github external
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
github CommerceRack / anycommerce / extensions / checkout_passive.js View on Github external
$('#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 #&lt;\/label&gt;<input value="&quot;;
							if(myControl.ext.convertSessionToOrder.vars[" class="creditCard" id="payment-cc" name="payment.cc" size="20" type="text">&lt;\/li&gt;";
							o += "</label></li><li><label>Expiration&lt;\/label&gt;<select class="creditCardMonthExp" id="payment-mm" name="payment.mm"><option>&lt;\/option&gt;";
							o += myControl.util.getCCExpMonths(myControl.data.cartItemsList.cart['payment.mm']);
							o += "&lt;\/select&gt;";
							o += "</option></select><option value="">&lt;\/option&gt;"+myControl.util.getCCExpYears(myControl.data.cartItemsList.cart['payment.yy'])+"&lt;\/select&gt;&lt;\/li&gt;";
							o += "</option></label></li><li><label for="payment.cv">CVV/CID&lt;\/label&gt;<input value="&quot;;
							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>&lt;\/li&gt;";
							break;
	
						case 'PO':
							o = "</label></li><li><label for="payment-po">PO #&lt;\/label&gt;<input low="" is="" in="" value="&quot;;
							if(myControl.data.cartItemsList.cart[" class="purchaseOrder" id="payment-po" name="payment.po" size="2" type="text">"+myControl.ext.convertSessionToOrder.vars.echeck[key]+"&lt;\/label&gt;</label></li>
github CommerceRack / anycommerce / extensions / checkout_nice.js View on Github external
$('#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 #&lt;\/label&gt;<input value="&quot;;
							if(myControl.ext.convertSessionToOrder.vars[" class="creditCard" id="payment-cc" name="payment.cc" size="20" type="text">&lt;\/li&gt;";
							o += "</label></li><li><label>Expiration&lt;\/label&gt;<select class="creditCardMonthExp" id="payment-mm" name="payment.mm"><option>&lt;\/option&gt;";
							o += myControl.util.getCCExpMonths(myControl.data.cartItemsList.cart['payment.mm']);
							o += "&lt;\/select&gt;";
							o += "</option></select><option value="">&lt;\/option&gt;"+myControl.util.getCCExpYears(myControl.data.cartItemsList.cart['payment.yy'])+"&lt;\/select&gt;&lt;\/li&gt;";
							o += "</option></label></li><li><label for="payment.cv">CVV/CID&lt;\/label&gt;<input value="&quot;;
							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>&lt;\/li&gt;";
							break;
	
						case 'PO':
							o = "</label></li><li><label for="payment-po">PO #&lt;\/label&gt;<input low="" is="" in="" value="&quot;;
							if(myControl.data.cartItemsList.cart[" class="purchaseOrder" id="payment-po" name="payment.po" size="2" type="text">"+myControl.ext.convertSessionToOrder.vars.echeck[key]+"&lt;\/label&gt;</label></li>
github CommerceRack / anycommerce / extensions / checkout_passive.js View on Github external
myControl.util.dump('BEGIN myControl.ext.convertSessionToOrder.calls.processCheckout.init');

				$('#chkoutSummaryErrors').empty(); //clear any existing global errors. //blank out any existing global errors so that only new error appear.
				$('#chkoutPlaceOrderBtn').attr('disabled','disabled').addClass('ui-state-disabled loadingButtonBg'); //disable the button to avoid double-click.
//				return; //die here to test
				var checkoutIsValid = myControl.ext.convertSessionToOrder.validate.isValid();
				
			
				myControl.util.dump(' -> checkoutIsValid = '+checkoutIsValid);
//adds dispatches regardless of validation.
				var serializedCheckout = $('#zCheckoutFrm').serializeJSON()
//for security reasons, cc info is removed from cart/session update if the local validation isn't successful.
//they are saved in memory for panel updates. if a user leaves checkout and comes back, cc info will have to be re-entered.
				if(!checkoutIsValid)	{
					serializedCheckout['payment.cc'] = '';
					serializedCheckout['payment.cv'] = '';
					}
//				myControl.util.dump(' -> SANITIZED serialized checkout object: ');
//				myControl.util.dump(serializedCheckout);
				myControl.calls.cartSet.init(serializedCheckout);
				if(checkoutIsValid)	{
					this.dispatch(callback);
					myControl.util.dump(" -> Got to valid checkout and adding to dispatchQ.");
					}
				else	{
//					myControl.util.dump(' -> validation failed.');
//originally, instead of attr(disabled,false) i removed the disabled attribute. This didn't work in ios 5 safari.					
					$('#chkoutPlaceOrderBtn').attr('disabled',false).removeClass('ui-state-disabled').removeClass('loadingButtonBg');
					
//without this jump, the create order button jumps up slightly. 
//this needs to be at the end so all the content above is manipulated BEFORE jumping to the id. otherwise, the up-jump still occurs.
				myControl.util.jumpToAnchor('chkoutSummaryErrors');
github CommerceRack / anycommerce / extensions / checkout_nice.js View on Github external
myControl.util.dump('BEGIN myControl.ext.convertSessionToOrder.calls.processCheckout.init');

				$('#chkoutSummaryErrors').empty(); //clear any existing global errors. //blank out any existing global errors so that only new error appear.
				$('#chkoutPlaceOrderBtn').attr('disabled','disabled').addClass('ui-state-disabled loadingButtonBg'); //disable the button to avoid double-click.
//				return; //die here to test
				var checkoutIsValid = myControl.ext.convertSessionToOrder.validate.isValid();
				
			
				myControl.util.dump(' -> checkoutIsValid = '+checkoutIsValid);
//adds dispatches regardless of validation.
				var serializedCheckout = $('#zCheckoutFrm').serializeJSON()
//for security reasons, cc info is removed from cart/session update if the local validation isn't successful.
//they are saved in memory for panel updates. if a user leaves checkout and comes back, cc info will have to be re-entered.
				if(!checkoutIsValid)	{
					serializedCheckout['payment.cc'] = '';
					serializedCheckout['payment.cv'] = '';
					}
//				myControl.util.dump(' -> SANITIZED serialized checkout object: ');
//				myControl.util.dump(serializedCheckout);
				myControl.calls.cartSet.init(serializedCheckout);
				if(checkoutIsValid)	{
					this.dispatch(callback);
					myControl.util.dump(" -> !!! got to valid checkout and adding to dispatchQ. Why isn't there a dispatch here?");
					}
				else	{
//					myControl.util.dump(' -> validation failed.');
//originally, instead of attr(disabled,false) i removed the disabled attribute. This didn't work in ios 5 safari.					
					$('#chkoutPlaceOrderBtn').attr('disabled',false).removeClass('ui-state-disabled').removeClass('loadingButtonBg');
					
//without this jump, the create order button jumps up slightly. 
//this needs to be at the end so all the content above is manipulated BEFORE jumping to the id. otherwise, the up-jump still occurs.
				myControl.util.jumpToAnchor('chkoutSummaryErrors');

payment

A general purpose library for building credit card forms, validating inputs and formatting numbers. Base on jquery.payment by @stripe, but without the jQuery.

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis