with Widgetform and BlueSnap?
Emit new event when a form submission is received. See the documentation
Retrieves the 10 most recent submissions. See the documentation
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
widgetform: {
type: "app",
app: "widgetform",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://usewidgetform.com/api/v1/hooks/zapier/user`,
headers: {
"x-api-key": `${this.widgetform.$auth.api_key}`,
},
})
},
})
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
bluesnap: {
type: "app",
app: "bluesnap",
}
},
async run({steps, $}) {
const data = { //Sample payload
"amount": 3500.00,
"currency": "USD",
"cardTransactionType": "AUTH_CAPTURE",
"cardHolderInfo": {
"firstName": "Test",
"lastName": "User",
"zip": "12345"
},
"creditCard": {
"expirationYear": 2025,
"expirationMonth": "12",
"cardNumber": "4111111111111111",
"securityCode": "123"
}
}
return await axios($, {
method: "post",
url: `${this.bluesnap.$auth.api_url}/services/2/transactions`,
headers: {
"content-type": `application/json`,
"bluesnap-version": `3.0`,
"accept": `application/json`,
},
auth: {
username: `${this.bluesnap.$auth.username}`,
password: `${this.bluesnap.$auth.password}`,
},
data,
})
},
})