Fiserv RESTful Web Services
Payment Gateway API Specification.
- API version: 6.14.0.20201015.001
With Go Modules:
package main
import (
"fmt"
"github.com/tooolbox/fiserv"
)
func main() {
creds := fiserv.Credentials{
ApiKey: "...",
ApiSecret: "...",
}
clnt, err := fiserv.NewClientWithResponses(fiserv.SandboxServer, creds)
if err != nil {
panic(err)
}
// Calls will automatically generate the authentication signature.
resp, err := clnt.SubmitPrimaryTransactionWithResponse(
context.Background(),
&fiserv.SubmitPrimaryTransactionParams{
// Params will be automatically populated
// with signature-related headers.
},
&fiserv.SubmitPrimaryTransactionJSONBody{
// ...
},
)
if err != nil {
panic(err)
}
fmt.Println(resp.JSON200.ApprovedAmount.Total)
}
To re-generate the OpenAPI types and client:
> cd tools
> go generate # install the tools
> cd ..
> go generate # generate the code