Had to change Sandata's script to grab the groups first and then grab people - going with people first was taking way too long. Updated some notes, worked on Luminate's fiveserv integration.
This commit is contained in:
@ -3,4 +3,5 @@
|
|||||||
{% styles custom %}
|
{% styles custom %}
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/tiny-slider.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/tiny-slider.css">
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js"></script>
|
||||||
@ -4,7 +4,55 @@
|
|||||||
<div class="np-homepage-featured-text">
|
<div class="np-homepage-featured-text">
|
||||||
<div class="np-homepage-headline">
|
<div class="np-homepage-headline">
|
||||||
{{ homepage.featured_courses_headline }}
|
{{ homepage.featured_courses_headline }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<button type="button" value="Submit" onclick="myclick()" class="button" style="border:none; background:transparent;">
|
||||||
|
Purchase access to a course!
|
||||||
|
<div id='mylink'></div>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="dvsnappay_hppform">
|
||||||
|
</div>
|
||||||
|
<input src="https://stage.snappayglobal.com/Interop/HostedPaymentPage" id="snappayhppform_response" type="hidden" name="snappayhppform_response" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
function myclick() {
|
||||||
|
var mylink = document.getElementById('mylink');
|
||||||
|
mylink.onclick = function () {
|
||||||
|
var t = document.createElement("script");
|
||||||
|
t.setAttribute("id", "snappay_hppform");
|
||||||
|
t.setAttribute("src", "https://stage.snappayglobal.com/Areas/Interop/Scripts/HPPForm.js");
|
||||||
|
t.setAttribute("data-target", "#snappayhppform_response");
|
||||||
|
t.setAttribute("data-callback", "submit_external_ecommerce");
|
||||||
|
t.setAttribute("data-accountid", "1003003518");
|
||||||
|
t.setAttribute("data-merchantid", "496695144562");
|
||||||
|
t.setAttribute("data-customerid", "100");
|
||||||
|
t.setAttribute("data-transactionamount", "100");
|
||||||
|
t.setAttribute("data-currencycode", "USD");
|
||||||
|
t.setAttribute("data-firstname", "No one");
|
||||||
|
t.setAttribute("data-lastname", "Noooo One");
|
||||||
|
t.setAttribute("data-email", "Noone@none.com");
|
||||||
|
t.setAttribute("data-redirectionurl", "https://www.walmartluminate.com");
|
||||||
|
t.setAttribute("data-snappayurl", "https://stage.snappayglobal.com/Interop/HostedPaymentPage");
|
||||||
|
document.getElementsByTagName("head")[0].appendChild(t);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
document.getElementById('mylink').click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function submit_external_ecommerce() {
|
||||||
|
var result = $("#snappayhppform_response").val();
|
||||||
|
sessionStorage.setItem("snappayhppresponse", result);
|
||||||
|
sessionStorage.setItem("caller", "js");
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="featured-carousel-controls np-hidden-mobile">
|
<div class="featured-carousel-controls np-hidden-mobile">
|
||||||
<div class="prev-arrow carousel-control"><i class="far fa-chevron-left"></i></div>
|
<div class="prev-arrow carousel-control"><i class="far fa-chevron-left"></i></div>
|
||||||
<div class="next-arrow carousel-control"><i class="far fa-chevron-right"></i></div>
|
<div class="next-arrow carousel-control"><i class="far fa-chevron-right"></i></div>
|
||||||
|
|||||||
85
CustomerNotes/Walmart_Luminate/snap-fiveserv.html
Normal file
85
CustomerNotes/Walmart_Luminate/snap-fiveserv.html
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<div id="dvsnappay_hppform">
|
||||||
|
<a src=""> Test </a>
|
||||||
|
</div>
|
||||||
|
<input id="snappayhppform_response" type="hidden" name="snappayhppform_response" />
|
||||||
|
|
||||||
|
<script id="snappay_hppform"
|
||||||
|
src='https://stage.snappayglobal.com/Areas/Interop/Scripts/HPPForm.js'
|
||||||
|
data-target="#snappayhppform_response"
|
||||||
|
data-callback="submit_external_ecommerce"
|
||||||
|
data-accountid='1003003518'
|
||||||
|
data-customerid='100'
|
||||||
|
data-currencycode='USD'
|
||||||
|
data-transactionamount='123.45'
|
||||||
|
data-merchantid='496695144562'
|
||||||
|
data-paymentmode='CC' // CC for credit card
|
||||||
|
data-cvvrequired='Y'
|
||||||
|
data-enableemailreceipt='Y'
|
||||||
|
data-redirectionurl='https://northpass.com'
|
||||||
|
data-snappayurl='https://stage.snappayglobal.com/Interop/HostedPaymentPage'
|
||||||
|
data-firstname='John'
|
||||||
|
data-lastname='Smith'
|
||||||
|
data-addressline1='850 Maple Ave'
|
||||||
|
data-city='Aurora'
|
||||||
|
data-state='IL'
|
||||||
|
data-zip='60504'
|
||||||
|
data-country='US'
|
||||||
|
data-email='john.smith@abcd.com'
|
||||||
|
data-phonenumber='6301234567'
|
||||||
|
data-signature='ccq3/65vra5FuhV++oFZxBdIvKn9W8PCsd@OIdDHIE='>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- From Srinavas -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function myclick() {
|
||||||
|
var isCVV = "N";
|
||||||
|
var isEmail = "N";
|
||||||
|
var abcd = document.getElementsByClassName('cvvreq');
|
||||||
|
if (abcd[0].checked) {
|
||||||
|
isCVV = "Y";
|
||||||
|
}
|
||||||
|
var pqrs = document.getElementsByClassName('emailrecep');
|
||||||
|
if (pqrs[0].checked) {
|
||||||
|
isEmail = "Y";
|
||||||
|
}
|
||||||
|
var pm = document.getElementsByName('paymentmode');
|
||||||
|
var selectedPM = "CC";
|
||||||
|
for (i = 0; i < pm.length; i++) {
|
||||||
|
if (pm[i].checked)
|
||||||
|
selectedPM = pm[i].value;
|
||||||
|
}
|
||||||
|
var mylink = document.getElementById('mylink');
|
||||||
|
mylink.onclick = function () {
|
||||||
|
var t = document.createElement("script");
|
||||||
|
t.setAttribute("id", "snappay_hppform");
|
||||||
|
t.setAttribute("src", "https://stage.snappayglobal.com/Areas/Interop/Scripts/HPPForm.js");
|
||||||
|
t.setAttribute("data-target", "#snappayhppform_response");
|
||||||
|
t.setAttribute("data-callback", "submit_external_ecommerce");
|
||||||
|
t.setAttribute("data-accountid", document.getElementById("accountid").value);
|
||||||
|
t.setAttribute("data-customerid", document.getElementById("customerid").value);
|
||||||
|
t.setAttribute("data-merchantid", document.getElementById("merchantid").value);
|
||||||
|
t.setAttribute("data-transactionamount", document.getElementById("transactionamount").value);
|
||||||
|
t.setAttribute("data-currencycode", document.getElementById("currencycode").value);
|
||||||
|
t.setAttribute("data-paymentmode", selectedPM);
|
||||||
|
t.setAttribute("data-cvvrequired", isCVV);
|
||||||
|
t.setAttribute("data-emailreceipt", isEmail);
|
||||||
|
t.setAttribute("data-udf0", document.getElementById("udf0").value);
|
||||||
|
t.setAttribute("data-udf1", document.getElementById("udf1").value);
|
||||||
|
t.setAttribute("data-udf2", document.getElementById("udf2").value);
|
||||||
|
t.setAttribute("data-udf3", document.getElementById("udf3").value);
|
||||||
|
t.setAttribute("data-udf4", document.getElementById("udf4").value);
|
||||||
|
t.setAttribute("data-udf5", document.getElementById("udf5").value);
|
||||||
|
t.setAttribute("data-udf6", document.getElementById("udf6").value);
|
||||||
|
t.setAttribute("data-udf7", document.getElementById("udf7").value);
|
||||||
|
t.setAttribute("data-udf8", document.getElementById("udf8").value);
|
||||||
|
t.setAttribute("data-udf9", document.getElementById("udf9").value);
|
||||||
|
t.setAttribute("data-redirectionurl", "https://www.google.com");
|
||||||
|
t.setAttribute("data-snappayurl", "https://stage.snappayglobal.com/Interop/HostedPaymentPage");
|
||||||
|
document.getElementsByTagName("head")[0].appendChild(t);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
document.getElementById('mylink').click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -11,6 +11,51 @@ APIKEY = Apikeys.SANDATA
|
|||||||
HEADERS = {"accept": "application/json", "X-Api-Key": APIKEY}
|
HEADERS = {"accept": "application/json", "X-Api-Key": APIKEY}
|
||||||
PERSON_GROUPS = []
|
PERSON_GROUPS = []
|
||||||
PPL_DELETIONS = []
|
PPL_DELETIONS = []
|
||||||
|
GROUPS_LIST = []
|
||||||
|
|
||||||
|
def get_groups():
|
||||||
|
count = 1
|
||||||
|
while True:
|
||||||
|
url = f"{BASEURL}/groups?limit=100&page={count}"
|
||||||
|
resp = requests.get(url, headers=HEADERS)
|
||||||
|
json = resp.json()
|
||||||
|
nextlink = json["links"]
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
for data in json["data"]:
|
||||||
|
group_name = data["attributes"]["name"]
|
||||||
|
members = data["attributes"]["memberships_count"]
|
||||||
|
id = data["id"]
|
||||||
|
if "ST - OH" in group_name or "ST - CA" in group_name:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if members > 0:
|
||||||
|
grouple = (id, group_name, members)
|
||||||
|
print(grouple)
|
||||||
|
GROUPS_LIST.append(grouple)
|
||||||
|
|
||||||
|
if "next" not in nextlink:
|
||||||
|
break
|
||||||
|
|
||||||
|
get_ppl_from_groups(GROUPS_LIST)
|
||||||
|
|
||||||
|
def get_ppl_from_groups(GROUPS_LIST):
|
||||||
|
for single_group in GROUPS_LIST:
|
||||||
|
print(single_group)
|
||||||
|
group_count = 1
|
||||||
|
while True:
|
||||||
|
group_url = f"{BASEURL}/groups/{single_group[0]}/memberships?limit=100&page={group_count}"
|
||||||
|
group_resp = requests.get(group_url, headers=HEADERS)
|
||||||
|
groupson = group_resp.json()
|
||||||
|
group_count += 1
|
||||||
|
nextlink = groupson["links"]
|
||||||
|
|
||||||
|
for data in groupson["data"]:
|
||||||
|
id = data["relationships"]["person"]["data"]["id"]
|
||||||
|
print(id)
|
||||||
|
|
||||||
|
if "next" not in nextlink:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def get_people():
|
def get_people():
|
||||||
@ -35,15 +80,30 @@ def get_people():
|
|||||||
uuid = group["id"]
|
uuid = group["id"]
|
||||||
group_url = f"https://api.northpass.com/v2/groups/{uuid}"
|
group_url = f"https://api.northpass.com/v2/groups/{uuid}"
|
||||||
response = requests.get(group_url, headers=HEADERS)
|
response = requests.get(group_url, headers=HEADERS)
|
||||||
group_resp = response.json()
|
try:
|
||||||
|
group_resp = response.json()
|
||||||
|
|
||||||
group_name = group_resp["data"]["attributes"]["name"]
|
group_name = group_resp["data"]["attributes"]["name"]
|
||||||
# print(email, group_name)
|
# print(email, group_name)
|
||||||
if "- OH" not in group_name or "- CA" not in group_name:
|
if "ST - OH" in group_name or "ST - CA" in group_name:
|
||||||
PPL_DELETIONS.append(id)
|
pass
|
||||||
print(email, group_name)
|
else:
|
||||||
|
PPL_DELETIONS.append(id)
|
||||||
|
print(email, group_name)
|
||||||
|
|
||||||
PERSON_GROUPS.append((id, email, group_name))
|
PERSON_GROUPS.append((id, email, group_name))
|
||||||
|
except JSONDecodeError as e:
|
||||||
|
print(f"There was a JSON Error --> {e}")
|
||||||
|
dataerror = df.from_records(PERSON_GROUPS)
|
||||||
|
dataerror.to_csv('~/Downloads/Sandata-err-all-ppl')
|
||||||
|
print(dataerror)
|
||||||
|
print(len(PERSON_GROUPS))
|
||||||
|
|
||||||
|
datadelerr = df.from_records(PPL_DELETIONS)
|
||||||
|
datadelerr.to_csv('~/Downloads/Sandata-err-ppl-to-delete')
|
||||||
|
pass
|
||||||
|
finally:
|
||||||
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
PERSON_GROUPS.append((id, email, "No Group"))
|
PERSON_GROUPS.append((id, email, "No Group"))
|
||||||
@ -52,9 +112,13 @@ def get_people():
|
|||||||
break
|
break
|
||||||
|
|
||||||
dataframe = df.from_records(PERSON_GROUPS)
|
dataframe = df.from_records(PERSON_GROUPS)
|
||||||
|
dataframe.to_csv('~/Downloads/Sandata-all-ppl')
|
||||||
print(dataframe)
|
print(dataframe)
|
||||||
print(len(PERSON_GROUPS))
|
print(len(PERSON_GROUPS))
|
||||||
|
|
||||||
|
datadel = df.from_records(PPL_DELETIONS)
|
||||||
|
datadel.to_csv('~/Downloads/Sandata-ppl-to-delete')
|
||||||
|
|
||||||
|
|
||||||
# def parse_groups(id, grouplist):
|
# def parse_groups(id, grouplist):
|
||||||
# for uuid in grouplist:
|
# for uuid in grouplist:
|
||||||
@ -66,4 +130,4 @@ payload = { "payload": ["asd", "asd", "asd"] }
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
get_people()
|
get_groups()
|
||||||
|
|||||||
BIN
Scripts/Walmart/PDFs/Driver Support options_05.09.2024.pdf
Normal file
BIN
Scripts/Walmart/PDFs/Driver Support options_05.09.2024.pdf
Normal file
Binary file not shown.
@ -8,7 +8,7 @@ const apiKey = "6hUfJdAartHTHhHc0WIRZYPWe"
|
|||||||
// Luminate Production ^
|
// Luminate Production ^
|
||||||
const uid = "/\?uid\=7beg87y4-fh24-4929-3rt5-24kdn87s5241";
|
const uid = "/\?uid\=7beg87y4-fh24-4929-3rt5-24kdn87s5241";
|
||||||
const groupIds = [
|
const groupIds = [
|
||||||
'fbadcf2b-db4a-4342-b1a7-15fc357e6443',
|
'bcab9f82-4bac-4903-a054-aabae5f0a347'
|
||||||
]
|
]
|
||||||
|
|
||||||
const getAllGroups = async (num) => {
|
const getAllGroups = async (num) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user