ebaysdk

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 13 Imported by: 0

README

================= unofficial eBay Go SDK

Created in 2018. Need a lot of improvements and adding more resources support.

INSTALLATION

go get github.com/feelinc/go_ebay_sdk

Features!

  • Shopping
    • GetMultipleItems
    • GetSingleItem
  • Trading
    • AddMemberMessageAAQToPartner
    • AddMemberMessageRTQ
    • CompleteSale
    • GetFeedback
    • GetItem
    • GetOrderTransactions
    • GetUser
Example
import "github.com/feelinc/ebaysdk/trading"

api := trading.NewConnection(trading.SetDevID("the-dev-id"),
    trading.SetAppID("the-app-id"),
    trading.SetCertID("the-cert-id"),
    trading.SetToken("the-token"),
    trading.SetSiteID(ebaysdk.SiteIds["US"]))
    
request := trading.NewGetUser("the-item-id", "the-user-id", false)

response, err := api.Execute(request)
if err != nil {
	fmt.Println(err)
}
fmt.Println(response)
Todos
  • Unit and Integration test
  • Improve existing codes
  • Implement remaining Telesign resources
FOUND BUGS

Please open a issue (please check if similar issue exist reported here, just comment). We will consider to fix or close without fixing it.

IMPROVING

Thank you for your help improving it. Please fork and create push request.

License

MIT license.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SiteIds = map[string]int{
	"US":    0,
	"GB":    3,
	"SG":    216,
	"FR":    71,
	"FRBE":  0,
	"FRCA":  0,
	"MY":    207,
	"NL":    146,
	"AT":    16,
	"AU":    15,
	"CH":    193,
	"DE":    77,
	"ENCA":  0,
	"ES":    186,
	"HK":    201,
	"IE":    205,
	"IN":    203,
	"IT":    101,
	"MOTOR": 0,
	"NLBE":  0,
	"PH":    211,
	"PL":    212,
}

SiteIds site IDs

Functions

This section is empty.

Types

type Config

type Config struct {
	Domain              string
	Debug               bool
	Warnings            bool
	Errors              bool
	URI                 string
	DevID               string
	AppID               string
	CertID              string
	Token               string
	SiteID              int
	Version             int
	HTTPS               bool
	Timeout             int
	TrackingID          string
	TrackingPartnerCode string
	RequestEncoding     string
	ResponseEncoding    string
}

Config data

type Connection

type Connection interface {
	Execute(req Request) (Response, error)
	BuildRequestHeader() map[string]string
	BuildRequestData() string
}

Connection interface

type EbayResponse

type EbayResponse struct {
	EBayTime  string         `xml:"EBayTime"`
	Timestamp time.Time      `xml:"Timestamp"`
	Ack       string         `xml:"Ack"`
	Build     string         `xml:"Build"`
	Version   string         `xml:"Version"`
	Error     ResponseErrors `xml:"Errors"`
}

EbayResponse data

func (EbayResponse) Acknowledge

func (r EbayResponse) Acknowledge() string

Acknowledge return acknowledge info

func (EbayResponse) Failure

func (r EbayResponse) Failure() bool

Failure return true if failure, otherwise false

func (EbayResponse) ResponseErrors

func (r EbayResponse) ResponseErrors() Errors

ResponseErrors return response errors

func (EbayResponse) Success

func (r EbayResponse) Success() bool

Success return true if success, otherwise false

func (EbayResponse) Warning

func (r EbayResponse) Warning() bool

Warning return true if warning, otherwise false

type Errors

type Errors []ResponseError

Errors responses

func (Errors) Error

func (err Errors) Error() string

type HTTPError

type HTTPError struct {
	// contains filtered or unexported fields
}

HTTPError data

func (HTTPError) Error

func (err HTTPError) Error() string

type Request

type Request interface {
	Name() string
	BodyXML() string
	ParseResponse(content []byte) (Response, error)
}

Request interface

type Response

type Response interface {
	Success() bool
	Failure() bool
	Acknowledge() string
	Warning() bool
	ResponseErrors() Errors
}

Response interface

func BuildRequest

func BuildRequest(config *Config, headers map[string]string, body string,
	request Request) (Response, error)

BuildRequest build the request

type ResponseError

type ResponseError struct {
	Code                string `xml:"Code"`
	ErrorClass          string `xml:"ErrorClass"`
	ShortMessage        string `xml:"ShortMessage"`
	LongMessage         string `xml:"LongMessage"`
	ErrorCode           string `xml:"ErrorCode"`
	SeverityCode        string `xml:"SeverityCode"`
	Severity            string `xml:"Severity"`
	Line                string `xml:"Line"`
	Column              string `xml:"Column"`
	ErrorClassification string `xml:"ErrorClassification"`
}

ResponseError data

func (ResponseError) Error

func (err ResponseError) Error() string

type ResponseErrors

type ResponseErrors struct {
	Items []ResponseError `xml:"Error"`
}

ResponseErrors data

func (ResponseErrors) Error

func (err ResponseErrors) Error() string

type Shopping

type Shopping struct {
	Config  *Config
	Request Request
}

Shopping object

func (*Shopping) BuildRequestData

func (c *Shopping) BuildRequestData() string

BuildRequestData build the request data

func (*Shopping) BuildRequestHeader

func (c *Shopping) BuildRequestHeader() map[string]string

BuildRequestHeader build the request header

func (*Shopping) Execute

func (c *Shopping) Execute(req Request) (Response, error)

Execute the request

type Trading

type Trading struct {
	Config  *Config
	Request Request
}

Trading object

func (*Trading) BuildRequestData

func (c *Trading) BuildRequestData() string

BuildRequestData build the request data

func (*Trading) BuildRequestHeader

func (c *Trading) BuildRequestHeader() map[string]string

BuildRequestHeader build the request header

func (*Trading) Execute

func (c *Trading) Execute(req Request) (Response, error)

Execute the request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL