Getting Started
In this guide we’ll create and configure our own ecom integration, my_gateway.
What you’ll need
Section titled “What you’ll need”- The provider’s API key, the specification of its endpoints, and test data.
- Access to the Reactivepay services
settingsandcore, plus credentials for the settings-update endpoint. - A URL that can be used to send requests to the server hosting your integration.
Merchant setup
Section titled “Merchant setup”Before you start, you need to create a new merchant in the core service.
Next, in the settings service, define the settings for the merchant, for example:
{ "EUR": { "gateways": { "pay": { "default": "gateway" } } }, "gateways": { "allow_host2host": true, "gateway": { "class": "my_gateway", "api_key": "0266e225-4225-4ed1-94f7-1b612d15e948", "signKey": "ad526148102eff9dfa7835bf06a5a20f" } }}These settings allow the merchant to send EUR requests to Reactivepay, which will then be routed to our integration.
Fields:
class— the unique name of the integration in the system. It must match thegateway_keyfrom the integration settings.api_key— an arbitrary field of ours, the authorization key for the provider’s API. It comes in handy when you need to make a request to the provider.signKey— the key required for signing callbacks. It can be generated randomly; the key size must be 32 bytes.
node -e 'console.log(require("crypto").randomBytes(16).toString("hex"))'Integration setup
Section titled “Integration setup”Every Gateway Connect integration has settings that describe the methods it uses, the parameters it needs, the status-polling intervals for transactions, and so on.
Requests use basic authorization in the header.
curl 'https://stage.business.reactivepay.com/api/v1/gateway_settings' \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ -d '{ "my_gateway": { "bypass_processing_url": true, "callback": true, "enable": true, "full_link": "http://my_gateway:64529", "gateway_key": "my_gateway", "methods": { "pay": { "enable_status_checker": true, "final_waiting_seconds": 10, "params_fields": { "params": [], "payment": [], "settings": [] } }, "status": { "params_fields": { "params": [], "payment": [], "settings": [] } } }, "processing_method": "http_requests", "status_checker_time_rates": { "1-3": 30, "4-6": 60, "7-14": 120, "15-": 3600 } }}'For now, we’re only interested in the full_link and gateway_key settings.
full_link specifies the base_url of your integration — this is the URL Gateway Connect will send requests to.
gateway_key specifies the unique identifier of the integration.
