Interkassa api wrapper in golang.

Golang https://interkassa.com/ api wrapper (WIP)

Как использовать

Создаём кассу

package main

import (
	"net/http"
	"time"

	"github.com/qystishere/interkassa"
)

func main() {
	// Создаём кассу.
	kassa := interkassa.New(interkassa.Config{
		ID:            "1",                            // ID кассы
		SignAlgorithm: interkassa.SignAlgorithmSha256, // Алгоритм подписи
		SignKey:       "2",                            // Секретный ключ
		SignTestKey:   "3",                            // Тестовый секретный ключ
	})

	// Создаём платеж
	_, err := kassa.NewPayment(interkassa.PaymentParameters{
		ID:                "1",
		Currency:          interkassa.OptionalString("RUB"),
		Amount:            "100.0",
		Description:       "sample description",
		ExpiredAt:         interkassa.OptionalTime(time.Now().Add(time.Hour * 24)),
		PayerContact:      interkassa.OptionalString("[email protected]"),
		InteractionURL:    interkassa.OptionalString("https://local.kikree.com/merchant"),
		InteractionMethod: interkassa.OptionalString("POST"),
		SuccessURL:        interkassa.OptionalString("http://localhost:5000/donation/success"),
		SuccessMethod:     interkassa.OptionalString("GET"),
		PendingURL:        interkassa.OptionalString("http://localhost:5000/donation/pending"),
		PendingMethod:     interkassa.OptionalString("GET"),
		FailURL:           interkassa.OptionalString("http://localhost:5000/donation/failed"),
		FailMethod:        interkassa.OptionalString("GET"),
		AdditionalFields: interkassa.Fields{
			"userID": "222",
		},
	})
	if err != nil {
		panic(err)
	}

	// Обработчик для приёма уведомлений о статусе платежа.
	http.HandleFunc("/merchant", func(w http.ResponseWriter, r *http.Request) {
		_ = r.ParseForm()

		// Парсим уведомление.
		notification, err := kassa.ParseNotification(r.Form)
		if err != nil {
			_, _ = w.Write([]byte(err.Error()))
			return
		}

		if notification.InvoiceState != "success" {
			w.WriteHeader(200)
			return
		}

		// Используем.
	})
}
Similar Resources

GoSetProcessAffinity as a wrapper with GUI

GoSetProcessAffinity as a wrapper with GUI

GoSetProcessAffinity as a wrapper with GUI basically this is a configuration tool for the IFEO settings. Settings that go beyond the IFEO are done via

Sep 24, 2022

Tiny 10MinuteMail wrapper for Go.

tmm Tiny package that uses 10MinuteMail to generate temporary email addresses. Zero dependancies. Supports receiving, forwarding and replying to messa

Nov 29, 2021

Executor - Wrapper for exec.Command for simple using and multi commands executing

executor Examples package main import ( "fmt" "github.com/solar-jsoc/execut

Feb 12, 2022

Basic-api-with-go - A basic api with golang

I am creating my first API with GO. Install go get -u github.com/Yefhem/basic-ap

Jan 3, 2022

Simple Golang API to demonstrate file upload to fireabase storage and retrieving url of uploaded file.

go-firebase-storage -Work in progress 🛠️ Simple Golang API that uses Firebase as its backend to demonstrate various firebase services using Go such a

Oct 4, 2021

Golang api for a league of legends teamfinder project

Golang api for a league of legends teamfinder project

League teamfinder API Golang api for a league of legends teamfinder project Table of Contents League teamfinder API Table of Contents Introduction Get

Nov 9, 2021

An API to simulate banking transactions in Golang

BASIC BANKING TRANSACTION IN GO This project is an API to simulate banking transactions in Golang. Functionalities POST /accounts = Create a new acco

Nov 11, 2021

Golang exaroton API client

Golang exaroton API client This is the unofficial Go implementation of this I'm still learning so expect badly design code PR are appreciated. Code In

Dec 14, 2021

Functional Programming support for golang.(Streaming API)

Funtional Api for Golang Functional Programming support for golang.(Streaming API) The package can only be used with go 1.18. Do not try in lower vers

Dec 8, 2021
Go API wrapper for Greenhouse.io API

Greenhouse IO A Go interface to Greenhouse.io's API Useage Creating the Client NewClient accepts: A context; used for any HTTP requests made using the

Jan 14, 2022
A wrapper for the Wandbox API, written in Golang!

GoWandBox A simple wrapper for the WandBox API, written in Golang! Documentation can be found at classpythonaddike.github.io/gowandbox/ Note: This wra

Sep 19, 2021
A dead simple Go wrapper around the hidden moonarch.app API.

moonarch A dead simple Go wrapper around the hidden moonarch.app API. How-To First, get the repository: go get github.com/lazdotdigital/moonarch. moon

Nov 27, 2021
Testing the use of a golang wrapper around UserMode Linux for making stdin

This code is for testing the use of a golang wrapper around UserMode Linux for making stdin, stdout and stderr available to attach, detach and reattach to from the host using Unix sockets.

Dec 24, 2021
Rusprofile wrapper with golang

Rusprofile Wrapper Запуск docker-compose up Описание Swagger http://localhost:8080/swagger/ Можно было бы брать данные здесь: https://www.rusprofile.r

Nov 24, 2021
A simple Via CEP Wrapper to demonstrate GoLang tests usage

via-cep-wrapper A simple Via CEP Wrapper to demonstrate GoLang tests usage Purpose Demonstrate how struct services could make easy to build and test a

May 18, 2022
A simple wrapper to daemonize Go applications.

daemonigo A simple library to daemonize Go programming language applications. Installing $ go get github.com/tyranron/daemonigo After this command da

Jul 15, 2022
Some helper types for go1: priority queue, slice wrapper.

go-villa Package villa contains some helper types for Go: priority queue, slice wrapper, binary-search, merge-sort. GoDoc Link: http://godoc.org/githu

Apr 24, 2021
singleflight wrapper supporting contexts

contextflight contextflight is a thin wrapper around singleflight that adds context handling. It works like singleflight, with the addition that the p

Nov 9, 2022
rsync wrapper (or output parser) that pushes metrics to prometheus

rsync-prom An rsync wrapper (or output parser) that pushes metrics to prometheus. This allows you to then build dashboards and alerting for your rsync

Dec 11, 2022