Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "dominos", | ||
"payment=disallowed-name": "pizzapi", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "node js API for Domino's pizza", | ||
@@ -6,0 +6,0 @@ "main": "dominos-pizza-api.js", |
@@ -447,4 +447,12 @@ Domino's PizzAPI | ||
var cardNumber='4100123422343234'; | ||
var cardInfo = new order.PaymentObject(); | ||
cardInfo.Amount = order.Amounts.Customer; | ||
cardInfo.Number = cardNumber; | ||
cardInfo.CardType = order.validateCC(cardNumber); | ||
cardInfo.Expiration = '0115';// 01/15 just the numbers "01/15".replace(/\D/g,''); | ||
cardInfo.SecurityCode = '777'; | ||
cardInfo.PostalCode = '90210'; // Billing Zipcode | ||
order.Payments.push(cardInfo); | ||
@@ -451,0 +459,0 @@ |
@@ -182,2 +182,38 @@ 'use strict'; | ||
Order.prototype.validateCC=function(number){ | ||
var re = { | ||
visa : /^4[0-9]{12}(?:[0-9]{3})?$/, | ||
mastercard : /^5[1-5][0-9]{14}$/, | ||
amex : /^3[47][0-9]{13}$/, | ||
diners : /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/, | ||
discover : /^6(?:011|5[0-9]{2})[0-9]{12}$/, | ||
jcb : /^(?:2131|1800|35\d{3})\d{11}$/, | ||
enroute : /^(?:2014|2149)\d{11}$/ | ||
}; | ||
if (re.visa.test(number)) | ||
return 'VISA'; | ||
if (re.mastercard.test(number)) | ||
return 'MASTERCARD'; | ||
if (re.amex.test(number)) | ||
return 'AMEX'; | ||
if (re.diners.test(number)) | ||
return 'DINERS'; | ||
if (re.discover.test(number)) | ||
return 'DISCOVER'; | ||
if (re.jcb.test(number)) | ||
return 'JCB'; | ||
if (re.enroute.test(number)) | ||
return 'JCB'; | ||
return ""; | ||
} | ||
} | ||
Order.prototype.PaymentObject=function(){ | ||
@@ -184,0 +220,0 @@ Object.defineProperties( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
384531
9852
530
0