This library is an Ingenico Payment Services integration library for the Go programming language.
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"
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
- With Alias
- another API
- Server-to-server request
- another API
Open issue or pull requests
MIT-LICENSE. See LICENSE or the LICENSE file provided in the repository for details.