At this stage, you have your API credentials and a method of collecting payment information. How do you pass that payment information to the desired endpoints?
For simplicity, you can think of sending your tokenized payment methods to two kinds of endpoints: parties that Spreedly has integrated with and parties that Spreedly is not integrated with.
- An integrated endpoint can be a gateway (sometimes called a processor, or PSP) or an embedded fraud service. To keep things simple, we’ll refer to this as a gateway here.
- We’ll refer to a receiver as any third party endpoint that Spreedly is not integrated with.
For convenience, you can send API requests to integrated gateways using a standardized API request structure; likewise, you can expect to receive a standardized Spreedly response to these requests.
To send payment data to an integrated gateway partner, you will need to create a gateway token. This gateway token is placed in the URL of your API requests to designate where you want to send your requests.
You can create a gateway token via the API by finding your desired gateway among our list of supported gateways, navigating to the gateway guide you want to use, and locating the section on “Adding a [X] gateway”.
For example, look at the Braintree Gateway Guide. Scrolling down to the “Adding a Braintree gateway” section, you can see that creating a Braintree gateway token is as simple as sending an API call. These requests will always require credentials that are specific to each gateway, so be sure to examine each gateway guide for details.
To test the API against your gateway’s sandbox, you can create the gateway token with sandbox credentials. When you do this, please include an additional “sandbox”: true flag to indicate in your Spreedly dashboard that this is a sandbox gateway token.
After you’ve tested your connection to the sandbox and want to transact in production, you can simply create a gateway token using your gateway’s production credentials. Omit the “sandbox” flag (or set “sandbox”: false) and you are free to transact with production payment methods. We recommend testing your integration in sandbox before switching to production; we’ll discuss this in more detail in a later module.
When you create a gateway token, you’ll use your environment key and access secret to authenticate the request. The environment key you use will determine which environment that gateway token is created in; the gateway token can only be used in this environment.
Alternatively, you can add a gateway via the UI in app.spreedly.com by navigating to the “Gateways” tab, selecting “Create a new gateway”, and filling out the required fields.
You can send your tokenized payment methods to third parties that Spreedly is not integrated with. We refer to this approach as Payment Method Distribution (PMD). To designate which endpoint you’d like to send payment information to, you’ll need to create a receiver token and include this in the URL of your API request.
After you’ve submitted 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 “Provision a test receiver” guide will walk you through this process.
When Spreedly has configured your receiver for use, you can follow the “Provision a production receiver” guide to send payment information to the third party.
Configuring Connections as a Merchant Aggregator
If you’re configuring gateway or receiver tokens on behalf of another party, like merchants on whose behalf you’re facilitating transactions, you will have additional setup considerations.
For each individual merchant, you will want to configure a unique production gateway token using that merchant’s credentials. Remember that gateway tokens will only work in the environment in which it’s created; if you segment your merchants’ data by environment, you’ll also want to segment gateway tokens by environment.
You have completed Module 3 if you have:
Created a sandbox gateway token or receiver token