README

BE ADVISED: This project is no longer maintained. Use at your own risk.

No Maintenance Intended

Documentation

Overview

Package paddle is an HTTP API client for the Paddle payment processing service.

Be advised

This package is unmaintained. It does not receive support or security updates. Please do not attempt to use it in production.

Index

Constants

View Source
const Version = "2.0"

Version is the Paddle API version that this package supports. It is exported for convenience.

Variables

This section is empty.

Functions

func NewRoundTripper

func NewRoundTripper(transport http.RoundTripper, vendorID int, vendorAuthCode string) http.RoundTripper

NewRoundTripper wraps an existing http.RoundTripper so that any POST request using content-type application/x-www-form-urlencoded sent through it to "https://vendors.paddle.com/api/version" will include authentication information. If a transport is nil, http.DefaultTransport is used instead.

This is a lower level API exposed for advanced users; most of the time, users will want to create a Client and then use it with one of the subpackages instead.

Types

type Client

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

Client is a paddle HTTP API client.

func NewClient

func NewClient(c *http.Client, vendorID int, vendorAuthCode string) *Client

NewClient returns a Paddle API client that wraps an existing HTTP client and adds auth support for all POST requests to the API endpoint.

func (*Client) Do

func (c *Client) Do(path string, v url.Values) (json.RawMessage, error)

Do sends an HTTP POST request to the server and decodes common response fields.

type Currency

type Currency string

Currency is an ISO 4217 currency designator.

const (
	// G10 currencies
	USD Currency = "USD"
	EUR Currency = "EUR"
	GBP Currency = "GBP"
)

Reexport of currencies currently supported by Paddle.

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Error can unmarshal the "error" field of an API response.

func (Error) Error

func (err Error) Error() string

Error implements the error interface for the Error type.

type Time

type Time time.Time

Time is a custom time type that supports marshaling and unmarshaling Paddle's custom time format that ignores the standard JSON format.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON satisfies the json.Unmarshaler interface for Time.

Directories

Path Synopsis
Package coupon provides APIs related to coupons.
Package coupon provides APIs related to coupons.
Package license provides APIs related to licenses.
Package license provides APIs related to licenses.
Package payment provides APIs related to payments.
Package payment provides APIs related to payments.
Package plan provides APIs related to plans.
Package plan provides APIs related to plans.
Package product provides APIs related to products.
Package product provides APIs related to products.
Package user provides APIs related to users.
Package user provides APIs related to users.