Passing Payment Information to Endpoints
At this stage, you have your API credentials and a method for collecting payment information. The next step is to pass that payment information to the appropriate endpoints.
For simplicity, think of sending your tokenized payment methods to two types of endpoints:
- Integrated Endpoints: These are endpoints that Spreedly has integrated with (e.g., gateways or embedded fraud services).
- Non-Integrated Endpoints: These are third-party endpoints that Spreedly is not integrated with and are referred to as receivers.
By the end of this module:
- You will understand how to create a sandbox gateway token or receiver token.
Sending Data to Integrated Gateways
An integrated endpoint is typically a gateway (also called a processor or PSP). For convenience, we’ll refer to it as a gateway. You can send API requests to integrated gateways using a standardized API request structure and will receive a standardized Spreedly response.
Gateway Tokens
To send payment data to an integrated gateway, you need to create a gateway token. This token is included in the URL of your API requests to specify the destination of the request.
-
Creating a Gateway Token via the Spreedly App (Marketplace):
Visit our Marketplace to easily view and connect to one of our gateways. Locate your Connections area to review all gateways and add new ones. When creating your gateways, select the gateway name and authentication mode (if prompted) before completing required fields. Select ☑️Sandbox to create a gateway in Sandbox mode for processing test card data and transactions in your Spreedly environment.
When integrating your desired gateway using the Spreedly App, you can expect low-code UI configuration for sandbox and production gateway setup and easily accessible connection status. For more information on how to connect, please visit our Gateway user guide.
-
Creating a Gateway Token via API:
You can create a gateway token via the API by finding your desired gateway from our list of supported gateways. Navigate to the relevant gateway guide and locate the section titled “Adding a [X] gateway.”For example, if you’re using the Braintree Gateway, the “Adding a Braintree Gateway” section in the guide will show you how to create a gateway token by sending an API call. Each request will require credentials specific to the gateway, so be sure to check the guide for the necessary details.
-
Testing with Sandbox Credentials:
To test your API against the gateway’s sandbox environment, create the gateway token with sandbox credentials. Add a"sandbox": true
flag to indicate in your Spreedly dashboard that you are using a sandbox gateway token. -
Transacting in Production:
After testing in sandbox mode, you can switch to production. Simply create the gateway token using your gateway’s production credentials and either omit the"sandbox"
flag or set"sandbox": false
. You can then transact with live payment methods. -
Authentication:
When you create a gateway token, you’ll authenticate the request using your environment key and access secret. The environment key determines in which environment the gateway token is created, and the token is only valid in that specific environment.
Sending Data to Non-Integrated Receivers
If you're sending payment data to a third-party endpoint that Spreedly does not support directly, you will use receiver tokens. This method is known as Payment Method Distribution (PMD).
To specify which third-party endpoint to send payment information to, create a receiver token and include it in the URL of your API request.
-
Creating a Receiver Token:
Spreedly provides a list of supported receivers, which you can search to find your endpoint. If your desired receiver is not listed, you may need to request support for that receiver by following the steps in our PMD guide. -
Testing with a Test Receiver:
After submitting your request to add a receiver, you can test the PMD process by using Spreedly’s test receiver to simulate the delivery of test payment methods. Our guide, Provision a Test Receiver, will walk you through the process. -
Production Configuration:
Once Spreedly has configured your receiver, follow the Provision a Production Receiver Guide to start sending payment information to the third-party endpoint.
You’ve Completed Module 3 If:
- You have created a sandbox gateway token or receiver token.