This library provides basic API options of SolidGate payment gateway.
$ go get github.com/solidgate-tech/go-sdk
package main
import (
"encoding/json"
"fmt"
solidgate "github.com/solidgate-tech/go-sdk"
)
func main() {
//.....
someRequestStruct := SomeRequestStruct{}
someStructJson, err := json.Marshal(someRequestStruct)
if err != nil {
fmt.Print(err)
}
solidgateSdk := solidgate.NewSolidGateApi("YourPublicKey", "YourSecretKey")
response, err := solidgateSdk.Charge(someStructJson)
if err != nil {
fmt.Print(err)
}
someResponeStruct = SomeResponeStruct{}
err := json.Unmarshal(response, &someResponeStruct)
if err != nil {
fmt.Print(err)
}
//.....
}
package main
import (
"encoding/json"
"fmt"
solidgate "github.com/solidgate-tech/go-sdk"
)
func main() {
solidgateSdk := solidgate.NewSolidGateApi("YourPublicKey", "YourSecretKey")
someRequestStruct := SomeRequestStruct{}
someStructJson, err := json.Marshal(someRequestStruct)
if err != nil {
fmt.Print(err)
}
formInitDto, err := solidgateSdk.FormMerchantData(someStructJson)
if err != nil {
fmt.Print(err)
}
// ...
}
package main
import (
"encoding/json"
"fmt"
solidgate "github.com/solidgate-tech/go-sdk"
)
type UpdateParams struct {
...
}
func main() {
solidgateSdk := solidgate.NewSolidGateApi("YourPublicKey", "YourSecretKey")
someRequestStruct := UpdateParams{}
someStructJson, err := json.Marshal(someRequestStruct)
if err != nil {
fmt.Print(err)
}
formUpdateDto, err := solidgateSdk.FormUpdate(someStructJson)
if err != nil {
fmt.Print(err)
}
// ...
}
package main
import (
"encoding/json"
"fmt"
solidgate "github.com/solidgate-tech/go-sdk"
)
func main() {
solidgateSdk := solidgate.NewSolidGateApi("YourPublicKey", "YourSecretKey")
someRequestStruct := SomeRequestStruct{}
someStructJson, err := json.Marshal(someRequestStruct)
if err != nil {
fmt.Print(err)
}
formResignDto, err := solidgateSdk.FormResign(someStructJson)
if err != nil {
fmt.Print(err)
}
// ...
}