Skip to content

Commit

Permalink
update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsangan committed May 27, 2024
1 parent 40cc04d commit ab11b74
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ async function callAPI(request) {
if (!id) {
return `{"success":false,"message":"Bad Request"}`
}
if (path.includes('/pgr')) {
if (zone.toLowerCase().includes('ap')) {
sn = 'Asia-Pacific'
sv = '5000'
} else if (zone.toLowerCase().includes('eu')) {
sn = 'Europe'
sv = '5001'
} else if (zone.toLowerCase().includes('na')) {
sn = 'North America'
sv = '5002'
} else {
return `{"success":false,"message":"Bad request"}`
}
const body = `voucherPricePoint.id=259947&voucherPricePoint.price=15135.0&voucherPricePoint.variablePrice=0&user.userId=${id}&user.zoneId=${sv}&voucherTypeName=PUNISHING_GRAY_RAVEN&shopLang=id_ID`
const request = new Request(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body
})
const response = await fetch(request)
const data = await response.json()
return `{"success":true,"game":"Punishing: Gray Raven","server":"${sn}","id":${id},"name":"${data.confirmationFields.username}"}`
}
if (path.includes('/hsr')) {
if (id. startsWith('6')) {
sn = 'America'
Expand Down

0 comments on commit ab11b74

Please sign in to comment.