payment

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package payment provides APIs related to payments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*paddle.Client
}

Client performs API operations.

func (Client) List

func (c Client) List(plans []uint64, subscription uint64, paid bool, oneOff bool, from, to time.Time) (Iter, error)

List returns an iterator over all payments for the logged in user, filtered by the given arguments.

func (Client) Reschedule

func (c Client) Reschedule(id uint64, date time.Time) error

Reschedule changes the due date on an upcoming payment and all future payments on the same schedule.

type Iter

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

Iter provides a mechanism for lazily decoding and iterating over a list.

func (Iter) Decode

func (c Iter) Decode() (*Payment, error)

Decode returns the next payment.

func (Iter) Next

func (c Iter) Next() bool

Next returns true if there is more data to decode.

type Payment

type Payment struct {
	ID           int64           `json:"id"`
	Subscription int64           `json:"subscription_id"`
	Amount       uint            `json:"amount"`
	Currency     paddle.Currency `json:"currency"`
	PayoutDate   paddle.Time     `json:"payout_date"`
	Paid         bool            `json:"is_paid"`
	OneOff       bool            `json:"is_one_off_charge"`
	Receipt      string          `json:"receipt_url"`
}

Payment may represent an existing payment or an upcoming (unpaid) payment.

Jump to

Keyboard shortcuts

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