Ayzal AIAYZAL .AI
← Back to Knowledge Base
integrations

Custom Payment Gateway Integration

Generic pattern for any payment gateway — Braintree, Adyen, Square, or your own authorization

Universal pattern

  1. Receive email + IP from your form
  2. POST to https://email.ayzalai.com/v1/check/email with X-API-Key
  3. Inspect verdict
  4. Block or proceed to your payment processor

Node.js generic

async function checkBeforePayment(email, ip) {
  const r = await fetch("https://email.ayzalai.com/v1/check/email", {
    method: "POST",
    headers: { "X-API-Key": process.env.AYZAL_GUARD_KEY,
               "Content-Type": "application/json" },
    body: JSON.stringify({ email, client_ip: ip }),
  });
  const risk = await r.json();
  if (["disposable", "invalid"].includes(risk.verdict)) {
    throw new Error("Use a real email");
  }
  // proceed to your gateway: braintree.transaction.sale(), square.payments.create(), etc.
}

Fail-open pattern

If Guard API returns 5xx or times out, do not block the payment. Log the failure, proceed, and flag the order for manual review. Blocking sales because a risk vendor is down is worse than occasionally letting a bot through.