Skip to content

sweet-tv/solidgate-go-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go project version

SolidGate API

This library provides basic API options of SolidGate payment gateway.

Installation

$ go get github.com/sweet-tv/solidgate-go-sdk

Usage for h2h

package main

import (
	"encoding/json"
	"fmt"

	solidgate "github.com/sweet-tv/solidgate-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)
	}
	//.....
}

Usage for init payment form data

package main

import (
	"encoding/json"
	"fmt"

	solidgate "github.com/sweet-tv/solidgate-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)
	}

	// ...
}

Usage for update form data

package main

import (
	"encoding/json"
	"fmt"

	solidgate "github.com/sweet-tv/solidgate-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)
	}

	// ...
}

Usage for resign form data

package main

import (
	"encoding/json"
	"fmt"

	solidgate "github.com/sweet-tv/solidgate-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)
	}

	// ...
}

Packages

No packages published

Languages

  • Go 100.0%