https://github.com/helios-ag/sberbank-acquiring-go
Sberbank acquiring API wrapper (client) for GO
https://github.com/helios-ag/sberbank-acquiring-go
acquiring api api-rest go golang sberbank
Last synced: 2 months ago
JSON representation
Sberbank acquiring API wrapper (client) for GO
- Host: GitHub
- URL: https://github.com/helios-ag/sberbank-acquiring-go
- Owner: helios-ag
- License: other
- Created: 2018-12-09T07:29:31.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-03T05:19:18.000Z (3 months ago)
- Last Synced: 2025-03-03T06:24:37.664Z (3 months ago)
- Topics: acquiring, api, api-rest, go, golang, sberbank
- Language: Go
- Homepage:
- Size: 135 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
[](LICENSE)
[](https://github.com/helios-ag/sberbank-acquiring-go/actions/workflows/go.yml)
[](https://codecov.io/gh/helios-ag/sberbank-acquiring-go)
[](https://goreportcard.com/report/github.com/helios-ag/sberbank-acquiring-go)
[](https://godoc.org/github.com/helios-ag/sberbank-acquiring-go)
# Sberbank Acquiring API Wrapper[Sberbank Acquiring API](https://securepayments.sberbank.ru/wiki/doku.php/integration:api:start) written in Go
## Installation
Make sure your project is using Go Modules (it will have a `go.mod` file in its
root if it already is):``` sh
go mod init
```Then, reference stripe-go in a Go program with `import`:
``` go
import (
"github.com/helios-ag/sberbank-acquiring-go/acquiring"
"github.com/helios-ag/sberbank-acquiring-go/currency"
)
```Run any of the normal `go` commands (`build`/`install`/`test`). The Go
toolchain will resolve and fetch the module automatically.Alternatively, you can also explicitly `go get` the package into a project:
```bash
go get -u github.com/helios-ag/sberbank-acquiring-go
```## Getting started
### Step 1
Get password and username### Step 2
Set mode sandbox or production, currency, language### Step 3
Configure client as in an example below
Example below:
```golang
package mainimport (
"context"
"fmt"
"github.com/helios-ag/sberbank-acquiring-go/acquiring"
"github.com/helios-ag/sberbank-acquiring-go/currency"
)func main() {
cfg := acquiring.ClientConfig{
UserName: "test-api", // Replace with your own
Currency: currency.RUB,
Password: "test", // Replace with your own
Language: "ru",
SessionTimeoutSecs: 1200,
SandboxMode: true,
}client, err := acquiring.NewClient(&cfg)
if err != nil {
panic(err)
}
order := acquiring.Order{
OrderNumber: "test",
Amount: 100,
Description: "My Order for Client",
}
result, _, err := client.RegisterOrder(context.Background(), order)
if err != nil {
panic(err)
}
fmt.Println(result.ErrorCode)
fmt.Println(result.ErrorMessage)
fmt.Println(result.FormUrl)
fmt.Println(result.OrderId)
}```
### Step 4
Run example `go build example.go`