This guide introduces how to get started with using the Cobo Payments Go SDK, which allows you to integrate the Cobo payments service into your existing application using the Go programming language. To learn more about the initial setup steps necessary for utilizing the Payments API, see Send your first request. You can go to GitHub to access the source code of the SDK.Documentation Index
Fetch the complete documentation index at: https://cobo.com/payments/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- You have installed Go 1.18 or newer.
- Follow the instructions in Preparation for development environment to set up your Cobo account and create your organization. If an organization has already been set up, ask your organization admin to invite you to join the organization.
- Follow the instructions in Send your first request to generate an API key and an API secret, and register the API key on Cobo Portal.
Install the SDK
- Create a Go project if you have not already done so.
-
In the
go.modfile of your project, add the following line:Replace {VERSION} with the lastest version number, for example,v1.2.0. Obtain the latest version number from the GitHub repository. -
Run the
go mod tidycommand in a terminal or in your IDE to install the dependencies. -
In your
main.gofile, import the WaaS SDK as follows:
Configure API key and HTTP host
In the main function in yourmain.go file, configure the HTTP host by selecting the environment and provide your API secret.
The following code snippet shows the configuration for the development environment.
