Git Product home page Git Product logo

qiwi's Introduction

Qiwi GoDoc

An golang qiwi.com api client

Qiwi.com - CIS and Russian Payment system and this package relevant for Russian-speaking users. All the following documentation will be in Russian.

Чтобы получить токен доступа, перейдите по ссылке

История изменений

Доступна в файле CHANGELOG.md.

Установка

go get -u github.com/zhuharev/qiwi

Использование

token = "YOUR_TOKEN"
qw := qiwi.New(token)

// get last 10 payments
resp, err := qw.History.Payments(10)
if err != nil {
  // handle error
}
log.Printf("%v", resp)

Пример платежа

Для того, чтобы перевести деньги по номеру карты, мы должны определить ID провайдера, через которого будет проведён платёж.

	// токен
	token := "QIWI_TOKEN"
	// номер карты, на которую мы хотим сделать перевод
	cartNumber := "4377723744084975"
	// сумма перевода
	amount := 10.0

	qw := New(token)

	ctx := context.Background()

	// Определяем провайдера
	providerID, err := qw.Payments.DetectProviderIDByCardNumber(ctx, cartNumber)
	checkErr(err)

	// Проверяем комиссию
	resp, err := qw.Payments.SpecialComission(ctx, providerID, cartNumber, amount)
	checkErr(err)
	log.Printf("Комиссия: %.2f", resp.QwCommission.Amount)
	log.Printf("Сумма платежа с комиссией: %.2f", resp.WithdrawSum.Amount)

	// Делаем платёж
	paymentResponse, err := qw.Payment(ctx, providerID, cartNumber, amount)
	checkErr(err)
	log.Printf("ID транзакции: %s", paymentResponse.Transaction.ID)

qiwi's People

Contributors

bruhanda avatar zhuharev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qiwi's Issues

Обновление

Здравствуйте. Могли бы Вы обновить Ваш проект? Например функция последних платежей уже не работает. И например добавить функцию которая мониторит новый платеж?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.