Online Payment Processing. Modern Commerce. Simplified.
import { axios } from "@pipedream/platform";
import dayjs from "dayjs";
import crypto from "crypto";
export default defineComponent({
props: {
verifone: {
type: "app",
app: "verifone",
}
},
async run({steps, $}) {
let requestDateTime = new Date();
requestDateTime = dayjs(requestDateTime).format("YYYY-MM-DD hh:mm:ss");
const algo = "sha256";
let hash = this.verifone.$auth.vendor_code.length
+ this.verifone.$auth.vendor_code
+ requestDateTime.toString().length
+ requestDateTime;
hash = crypto.createHmac(algo, this.verifone.$auth.secret_key)
.update(hash)
.digest('hex');
return await axios($, {
url: `https://api.2checkout.com/rest/6.0/products/`,
headers: {
"X-Avangate-Authentication": `code="${this.verifone.$auth.vendor_code}" date="${requestDateTime}" hash="${hash}" algo="${algo}"`,
Accept: "application/json"
},
})
},
})
The Klaviyo API grants you the power to automate and personalize your email marketing efforts. With it, you can manage lists, profiles, and campaigns, track event-driven communications, and analyze the results. By leveraging this API on Pipedream, you can create intricate, automated workflows that respond in real-time to your users' behavior, sync data across multiple platforms, and tailor your marketing strategies to improve engagement and conversion rates.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
klaviyo: {
type: "app",
app: "klaviyo",
}
},
async run({steps, $}) {
return await axios($, {
url: ` https://a.klaviyo.com/api/accounts/`,
headers: {
"Authorization": `Klaviyo-API-Key ${this.klaviyo.$auth.api_key}`,
"revision": `2023-12-15`,
},
})
},
})