Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/congiary/cdek-pay
Golang client for CDEK Pay
https://github.com/congiary/cdek-pay
api api-client cdek cdek-api cdek-pay go golang
Last synced: 6 days ago
JSON representation
Golang client for CDEK Pay
- Host: GitHub
- URL: https://github.com/congiary/cdek-pay
- Owner: Congiary
- Created: 2024-10-27T09:14:04.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-02T09:25:02.000Z (about 2 months ago)
- Last Synced: 2024-12-17T00:13:40.460Z (6 days ago)
- Topics: api, api-client, cdek, cdek-api, cdek-pay, go, golang
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Golang CDEK Pay API client
## Installation
```shell
go get github.com/congiary/cdek-pay@latest
```## Usage
#### Create client
Provide terminal key and password from terminal settings page.
```go
client := cdek_pay.NewClient(login, secretKey)
```#### Create payment
```go
var receiptItems []cdek_pay.ReceiptItem
receiptItems = append(receiptItems, cdek_pay.ReceiptItem{
ID: "10",
Name: "Soul",
Price: 100,
Quantity: 1,
Sum: 100,
PaymentObject: 1,
})order := cdek_pay.PaymentOrder{
PayFor: "Something",
Currency: "TST",
PayAmount: 100,
ReceiptDetails: receiptItems,
}
req := &cdek_pay.InitRequest{
PaymentOrder: order,
}response, err := client.InitPayment(context.TODO(), req)
```## References
The code in this repo based on some code from [nikita-vanyasin/tinkoff](https://github.com/nikita-vanyasin/tinkoff)