JS SDK Overview

Introduction

This page will walk you through the process of accepting an EBT payment with Forage's JS SDK. The benefits of using Forage's JS SDK are,

  1. You ensure the PCI compliance of your application by using audited components hosted on secure Forage servers.

  2. You do not need to redirect your customer away from your checkout flow, therefore increasing conversions.

  3. You maintain control over the styling and location of the components supplied by Forage.

Features

Forage's JS SDK allows you to embed secure <iframe>s in your web application which can perform one of three functions,

  1. Tokenize an EBT card - Your customer enters their EBT card number into a Forage-hosted <iframe> and your application receives a tokenized version of the card which can be used in future payment attempts.

  2. Perform a balance check - Your customer enters their EBT card PIN into a Forage-hosted <iframe> and your application receives the current balance of the EBT card.

  3. Capture an EBT Payment - Your customer enters their EBT card PIN into a Forage-hosted <iframe> and your application receives a success or failure response along with information to be displayed on a receipt.

Flow

For all 3 of these functions, the developer flow is the same.

  1. You will create a Forage Frame, which inserts a secure <iframe> into your webpage at a location you specify.

  2. Then you wait for the customer to interact with the <iframe> (e.g. type in their card number) and click a submit button on your site.

  3. When the submit button is clicked, your app calls a corresponding submit method on the ForageFrame object and supplies separate callbacks for success and failure responses. These callbacks execute in the browser and therefore have access to all of your application's state in addition to the response object from Forage's Payments API.

Understanding the ForageFrame class

ForageFrame is a generic class representing a single <iframe> inside your application's DOM. Each <iframe> is composed of a single HTML input field and a "Powered by Forage" logo. Here is the simplest example:

1260

Detailed view of a ForageFrame for PIN collection.

Inside the context of a larger checkout page, you might place the ForageFrame next to the PaymentMethod information. For example:

627

Example checkout form where the ForageFrame is next to the PaymentMethod information.