Skip to content

Edge Payment Technologies offers payment solutions for merchants in diverse legal industries. To learn more about Edge's proposition see our about page.

Authentication

Before starting with the API, you must create a merchant account and obtain API keys from the Developer tab in your account dashboard. You will use the “Publishable key” with Edge JavaScript SDK and the “Secret key” with any SDK or HTTP API call. The Edge HTTP API requires in every request a Authorization header with a Bearer token.

JSONAPI

The Edge API is based upon REST principles, returns JSON responses, and uses standard HTTP response codes. We speficially use the JSON:API specification.

Browser SDK

If you're wanting to use Edge Payment Technologies in the browser to make a charge you're going to need to include the Edge javascript SDK. The Edge JavaScript SDK is a toolkit for encrypting data in the browser. Using the Edge JavaScript SDK means your customer's data never leaves their browser unencrypted. You can get the URL to the SDK on the Developers page.

Then after that you need to initialize the client:

const publishableToken = "publishableToken";
const formFactor = "inputs";
const paymentButton = document.querySelector("button#pay");

console.log("Initializing Edge JS with Payment ID:", paymentId);
console.log("Publishable Key:", publishableToken);
const edgeClient = new Edge(publishableToken, {});

Once initialized you'll need to wait for webhook subscriptions in your backend, but you can also define optimistic javascript event callbacks:

edgeClient.on("payment_method_verifying", (payload) => {
  console.log("Verifying payment method", payload.detail);
  // ...
});

edgeClient.on("payment_method_ready", (payload) => {
  console.log("Payment method ready", payload.detail);
  if (paymentButton) {
    // ...
  }
});

edgeClient.on("payment_approved", (payload) => {
  console.log("Payment approved", payload.detail);
});

edgeClient.on("subscription_approved", (payload) => {
  console.log("Subscription approved", payload.detail);
  // ...
});

edgeClient.on("payment_method_verified", async (payload) => {
  console.log("Payment method verified", payload.detail);
  // ...
});

edgeClient.on("payment_failed", (payload) => {
  console.log("Payment failed", payload.detail);
  // ...
});

edgeClient.on("payment_timeout", (payload) => {
  console.log("Payment timeout", payload.detail);
  // ...
});

// Pay button click triggers payment method verification
paymentButton.addEventListener("click", function () {
  // ...
  edgeClient.verifyPaymentMethod().catch((err) => {
    console.error("Payment method verification failed", err);
    // ...
  });
});

Finally you need to mount the edge client to the form:

edgeClient.mountPaymentForm("edge-js", paymentId);

Test Card Numbers (By network)

Card Number3DS ResultNetwork Result
4005519200000004Frictionless SuccessVisa Success
4444333322221111455Frictionless SuccessVisa (19 Digit Pan) Success
5406004444444443Frictionless SuccessMastercard Success
6011450103333333Frictionless SuccessDiscover Success
370000999999990Frictionless SuccessAmEx Success
36006666333344Frictionless SuccessDinner's Club Success
6771798021000008Frictionless SuccessMaestro Success
4124939999999990Frictionless SuccessGeneric Decline
4444333322221111Frictionless SuccessInsufficient Funds
5555341244441115Frictionless SuccessLost Card
6011601160116611Frictionless SuccessStolen Card
370000000000002Frictionless SuccessIncorrect CVC
4917300800000000Frictionless SuccessAlways Blocked
5407721000353481Frictionless SuccessHighest risk
370000000100018Frictionless Rejection-
5100060000000002Challenge PromptSuccess
4012000077777777Not Enrolled-
4166676667666746Issuer Rejected, Unattempted-

JSON:API Filtering

EPT supports advanced filtering for all JSON:API resources via query parameters. You can filter by attributes, relationships, and relationship attributes using dot notation.

Filter by a direct attribute:

GET /api/payment_demands?filter[status]=pending

Filter by a relationship's ID:

GET /api/payment_demands?filter[payer]=<payer_id>

Filter by an attribute of a related resource using dot notation:

GET /api/payment_demands?filter[payer.email]=john@example.com

This works for any resource and any relationship chain, e.g. consumer_addresses?filter[customer.name]=John+Doe.

Notes

  • Multiple filters can be combined: filter[status]=pending&filter[payer.email]=john@example.com
  • Relationship chains of arbitrary depth are supported: filter[merchant.account.owner.email]=ceo@acme.com
  • All filters are applied as SQL AND conditions.