CodeAWS1 / Powershell

0 stars 0 forks source link

Andrapple.mhtml #4

Open CodeAWS1 opened 5 months ago

CodeAWS1 commented 5 months ago

$ slack auth list

myworkspace (Team ID: T123ABC456) User ID: U123ABC456

// Example function to show a result to the user. Your site's UI library can be used instead. function resultMessage(message) { const container = document.querySelector("#result-message"); container.innerHTML = message; } window.paypal .Buttons({ style: { shape: "rect", layout: "vertical", }, async createOrder() { try { const response = await fetch("/api/orders", { method: "POST", headers: { "Content-Type": "application/json", }, // use the "body" param to optionally pass additional order information // like product ids and quantities body: JSON.stringify({ cart: [ { id: "YOUR_PRODUCT_ID", quantity: "YOUR_PRODUCT_QUANTITY", }, ], }), });

    const orderData = await response.json();

    if (orderData.id) {
      return orderData.id;
    } else {
      const errorDetail = orderData?.details?.[0];
      const errorMessage = errorDetail
        ? `${errorDetail.issue} ${errorDetail.description} (${orderData.debug_id})`
        : JSON.stringify(orderData);

      throw new Error(errorMessage);
    }
  } catch (error) {
    console.error(error);
    resultMessage(`Could not initiate PayPal Checkout...<br><br>${error}`);
  }
},
async onApprove(data, actions) {
  try {
    const response = await fetch(`/api/orders/${data.orderID}/capture`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
    });

    const orderData = await response.json();
    // Three cases to handle:
    //   (1) Recoverable INSTRUMENT_DECLINED -> call actions.restart()
    //   (2) Other non-recoverable errors -> Show a failure message
    //   (3) Successful transaction -> Show confirmation or thank you message

    const errorDetail = orderData?.details?.[0];

    if (errorDetail?.issue === "INSTRUMENT_DECLINED") {
      // (1) Recoverable INSTRUMENT_DECLINED -> call actions.restart()
      // recoverable state, per https://developer.paypal.com/docs/checkout/standard/customize/handle-funding-failures/
      return actions.restart();
    } else if (errorDetail) {
      // (2) Other non-recoverable errors -> Show a failure message
      throw new Error(`${errorDetail.description} (${orderData.debug_id})`);
    } else if (!orderData.purchase_units) {
      throw new Error(JSON.stringify(orderData));
    } else {
      // (3) Successful transaction -> Show confirmation or thank you message
      // Or go to another URL:  actions.redirect('thank_you.html');
      const transaction =
        orderData?.purchase_units?.[0]?.payments?.captures?.[0] ||
        orderData?.purchase_units?.[0]?.payments?.authorizations?.[0];
      resultMessage(
        `Transaction ${transaction.status}: ${transaction.id}<br><br>See console for all available details`,
      );
      console.log(
        "Capture result",
        orderData,
        JSON.stringify(orderData, null, 2),
      );
    }
  } catch (error) {
    console.error(error);
    resultMessage(
      `Sorry, your transaction could not be processed...<br><br>${error}`,
    );
  }
},

}) .render("#paypal-button-container");

// Example function to show a result to the user. Your site's UI library can be used instead. function resultMessage(message) { const container = document.querySelector("#result-message"); container.innerHTML = message; } https://www.facebook.com/share/r/e6q9dMD4yYw69Gi4/?mibextid=saVFRoimport express from "express"; import fetch from "node-fetch"; import "dotenv/config"; import path from "path";

const { PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT = 8888 } = process.env; const base = "https://api-m.sandbox.paypal.com"; const app = express();

// host static files app.use(express.static("client"));

// parse post params sent in body in json format app.use(express.json());

/**

/**

/**

async function handleResponse(response) { try { const jsonResponse = await response.json(); return { jsonResponse, httpStatusCode: response.status, }; } catch (err) { const errorMessage = await response.text(); throw new Error(errorMessage); } }

app.post("/api/orders", async (req, res) => { try { // use the cart information passed from the front-end to calculate the order amount detals const { cart } = req.body; const { jsonResponse, httpStatusCode } = await createOrder(cart); res.status(httpStatusCode).json(jsonResponse); } catch (error) { console.error("Failed to create order:", error); res.status(500).json({ error: "Failed to create order." }); } });

app.post("/api/orders/:orderID/capture", async (req, res) => { try { const { orderID } = req.params; const { jsonResponse, httpStatusCode } = await captureOrder(orderID); res.status(httpStatusCode).json(jsonResponse); } catch (error) { console.error("Failed to create order:", error); res.status(500).json({ error: "Failed to capture order." }); } });

// serve index.html app.get("/", (req, res) => { res.sendFile(path.resolve("./client/checkout.html")); });

app.listen(PORT, () => { console.log(Node server listening at http://localhost:${PORT}/); });{ "KPlugin": { "Authors": [ { "Name": "various" } ], "Category": "Application Launchers", "Description": "Search Applications and more", "EnabledByDefault": true, "Icon": "start-here-kde", "Id": "org.kde.plasma.simplekickoff", "License": "GPL-2.0+", "Name": "Simple Application Launcher", "ServiceTypes": [ "Plasma/Applet" ], "Version": "2.5" }, "X-Plasma-Provides": [ "org.kde.plasma.launchermenu" ], "X-Plasma-RequiredExtensions": [ "LaunchApp" ] } Error Error while processing login response: { "errorMessage": "", "errorCode": 512 }.address. Code: REG-PAYGO-UPGRADE-ATSA7PBB2ZPC1Code: REG-PAYGO-UPGRADE-BTZMHDT82LPC5 #Copy .env.example to .env:

cp -a .env.example .env

#Generate a key:
php artisan key:generate

#Only then run:
php artisan servehttps://forms.office.com/Pages/AnalysisPage.aspx?AnalyzerToken=nadPUThGQOYklVBSHSXqJvJ9motMzSIshttps://forms.office.com/Pages/AnalysisPage.aspx?AnalyzerToken=nadPUThGQOYklVBSHSXqJvJ9motMzSIs&id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAAN__nLB5zZUNzlGMkEzSERTRjJPSUtRUU5IUDJHRlhZTi4uhttps://forms.office.com/Pages/DesignPageV2.aspx?prevorigin=rbf&origin=NeoPortalPage&rpring=UsGovGccProduction&rpsession=fa4a2e4c-474e-40ea-b004-19aa3c50cd77&subpage=design&id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAAN__nLB5zZUNzlGMkEzSERTRjJPSUtRUU5IUDJHRlhZTi4u&branchingelementid=re4923808a99c428dad403026e34c573d&analysis=true&topview=Presentationhttps://forms.office.com/r/fPKqZ5DR7U?origin=lprLinkHTML:
https://join.slack.com/t/codeaws1/shared_invite/zt-2c0zxp9hw-dgDTJ2oaddvCwHR9Ital8ghttps://codeaws1.slack.com/apphttps://join.slack.com/t/slack-nrr4703/shared_invite/zt-2c0zxp9hw-dgDTJ2oaddvCwHR9Ital8gcurl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash https://aur.archlinux.org/snapd.git$ slack login 📋 Run the following slash command in any Slack channel or DM This will open a modal with user permissions for you to approve Once approved, a challenge code will be generated in Slack /slackauthticket ABC123defABC123defABC123defABC123defXYZ ? Enter challenge code ? Enter challenge code eXaMpLeCoDe ✅ You've successfully authenticated! 🎉 Authorization data was saved to ~/.slack/credentials.json 💡 Get started by creating a new app with slack create my-app Explore the details of available commands with slack help $ slack auth list myworkspace (Team ID: T123ABC456) User ID: U123ABC456 Last updated: 2023-01-01 12:00:00 -07:00 Authorization Level: Workspace slack create my-app --template https://github.com/slack-samples/deno-starter-template ? Choose a local environment > Install to a new workspace or organization cd my-app ``` https://aur.archlinux.org/snapd.git ``` ![1707083481716.gif](https://github.com/CodeAWS1/Powershell/assets/158616597/abe72a58-9db0-45de-9de1-39ca97f05871)