The Benny “Checkout Button” is the easiest way to integrate Benny’s hosted checkout into your store and supports a single-item per button. You can create multiple checkout buttons to enable checking out for different items or quantities. If you’d like to support a dynamic cart, please follow the Quickstart guide for the API integration.

Configuration

The Benny EBT “Checkout Button” has the same required fields as the API method for creating a transaction. They’re:
  • publicKey: The Benny public key obtained from the Benny EBT merchant dashboard
  • onSuccessRedirectUrl: Where the browser navigates a customer on successful checkout
  • onExitRedirectUrl: Where the browser navigates a customer when exiting checkout
  • items: An array of size one for the single-item sold from the link. See the expected item fields for more information.
On the button click, the customer is re-directed to a unique checkout session, returning them to the appropriate page on exit or completion.
Example integration
<script async src="https://js.bennyapi.com/v1/ebt-checkout-button.js"></script>

<ebt-checkout-button
  publicKey="<Public Key>"
  environment="<Environment of PRODUCTION or SANDBOX">
  transactionDetails='{
    "onSuccessRedirectUrl": "https://yoursite.com/success",
    "onExitRedirectUrl": "https://yoursite.com/exit",
    "items": [
      {
        "id": "item_1",
        "description": "Staple Produce Sampler",
        "quantity": 1,
        "unit": "COUNT",
        "price": 500,
        "snapEligible": true,
        "taxRate": 0.0
      }
    ]
  }'
/>

Squarespace

To configure on Squarespace, use a Code block set to HTML mode with Display Source Code turned off. Wrap the component with a <div> and </div> so that it renders as HTML like the example below:
Integrating with Squarespace
<script async src="https://js.bennyapi.com/v1/ebt-checkout-button.js"></script>

<div>
  <ebt-checkout-button
    publicKey="<Public Key>"
    transactionDetails='{
      "onSuccessRedirectUrl": "https://yoursite.com/success",
      "onExitRedirectUrl": "https://yoursite.com/exit",
      "items": [
        {
          "id": "item_1",
          "description": "Staple Produce Sampler",
          "quantity": 1,
          "unit": "COUNT",
          "price": 500,
          "snapEligible": true,
          "taxRate": 0.0
        }
      ]
    }'
  />
</div>