ewgRa/ogone

Golang Ogone integration library

★ 1Forks 1GoGitHub ↗Compare

README

Golang library for Ogone integration

This library is an Ingenico Payment Services integration library for the Go programming language.

Build Status license GoReportCard codecov.io

Releases

Library version Package URL
1.x gopkg.in/ewgra/ogone.v1

Installation:

$ go get gopkg.in/ewgra/ogone.v1

And then import it in your code:

import "gopkg.in/ewgra/ogone.v1"

Example

DirectLink request with alias

	dlr := NewDirectLinkRequest()

	dlr.
		SetAlias("ALIAS").
		SetAmount("100").
		SetReserveOperation().
		SetCurrency("EUR").
		SetOrderID("ORDERID")

	dlg := NewDirectLinkGateway()

	dlr.
		SetPspID("ewgraogone").
		SetUserID("ewgragolang").
		SetPassword("123123aa").
		Sign("qwdqwoidj29812d9")

	dlResp, _ := dlg.Send(dlr) // Use SandboxSend for send it to sandbox

	if !dlResp.IsAuthorised() {
		// .. STATUS in response is not Authorized
	}

	// Request was authorized successfully

Perform server-to-server Alias request

	ar := NewAliasRequest()

	ar.
		SetAcceptURL("https://github.com/ewgRa/ogone/success").
		SetExceptionURL("https://github.com/ewgRa/ogone/exception").
		SetOrderID("ORDERID").
		SetCardNumber("4111111111111111").
		SetCardHolderName("Sökolov Evgenii").
		SetCardCvc("123").
		SetCardExpireMonth("01").
		SetCardExpireYear("2020")

	ag := NewAliasGateway()

	ar.
		SetPspID("ewgraogone").
		Sign("qwdqwoidj29812d9")

	aResp, _ := ag.Send(ar) // Use SandboxSend for send it to sandbox

	if !aResp.CheckSign("qwdqwoidj29812d9") {
		// ... signuture check failed, do not trust this request
	}

	if !aResp.IsOk() {
		// ... STATUS at response is not OK
	}

	// Alias created, you can use it

Status

DirectLink

  • With Alias
  • another API

Alias

  • Server-to-server request
  • another API

How to contribute

Open issue or pull requests

LICENSE

MIT-LICENSE. See LICENSE or the LICENSE file provided in the repository for details.

Contributors

ewgRa

Issues