invdapi

package module
v6.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 14 Imported by: 0

README

invoiced-go

This repository contains the Go client library for the Invoiced API.

Build Status Coverage Status

Installing

The Invoiced package can be installed like this:

go get -u https://github.com/Invoiced/invoiced-go

Requirements

  • Go 1.11+

Usage

First, you must instantiate a new client

import "github.com/Invoiced/invoiced-go"

conn := invdapi.NewConnection("API_KEY", false)

Then, API calls can be made like this:

import "github.com/Invoiced/invoiced-go/invdendpoint"
import "fmt"

//Get All The Invoices With Auto Pagination
invoiceConn := conn.NewInvoice()
invoices, err := invoiceConn.ListAll(nil, nil)

if err != nil {
    panic(err)
}

//Let's print all the invoices
for _, invoice := range invoices {
    fmt.Println(invoice)
}

//Let's create a new customer
customerConn := conn.NewCustomer()

customerToCreate := conn.NewCustomer()
customerToCreate.Name = "Test Customer"

customerResponse, err := customerConn.Create(customerToCreate)

if err != nil {
    panic(err)
}

fmt.Println("Customer Response => ", customerResponse.Customer)

//Let's create a new invoice
invoiceToCreate := conn.NewInvoice()
invoiceToCreate.Customer = customerResponse.Id

//Create a Line Item
lineItem := invdendpoint.LineItem{}
lineItem.Description = "Retina MacBook Pro"
lineItem.Quantity = 5
lineItem.UnitCost = 1999.22

lineItems := append([]invdendpoint.LineItem{}, lineItem)

invoiceToCreate.Items = lineItems

//Add a Payment Term
invoiceToCreate.PaymentTerms = "NET15"

invoiceResponse, err := invoiceConn.Create(invoiceToCreate)

if err != nil {
    panic(err)
}

fmt.Println("Invoice Response => ", invoiceResponse.Invoice)

If you want to use the sandbox API instead then you must set the second argument on the client to true like this:

conn := invdapi.NewConnection("SANDBOX_API_KEY", false)

Developing

The test suite can be ran with:

go test ./...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeContactForCreation

func SafeContactForCreation(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeContactForUpdate

func SafeContactForUpdate(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeCouponForCreation

func SafeCouponForCreation(coupon *invdendpoint.Coupon) (*invdendpoint.Coupon, error)

SafeCouponForCreation prunes coupon data for just fields that can be used for creation of a coupon

func SafeCouponForUpdating

func SafeCouponForUpdating(coupon *invdendpoint.Coupon) (*invdendpoint.Coupon, error)

SafeTaxRateForUpdating prunes coupon data for just fields that can be used for updating of a plan

func SafeCreditNoteForCreation

func SafeCreditNoteForCreation(creditNote *invdendpoint.CreditNote) (*invdendpoint.CreditNote, error)

SafeEstimateForCreation prunes credit note data for just fields that can be used for creation of a credit note

func SafeCreditNoteForUpdate

func SafeCreditNoteForUpdate(creditNote *invdendpoint.CreditNote) (*invdendpoint.CreditNote, error)

SafeCreditNoteForUpdate prunes creditnote data for just fields that can be used for updating a credit note

func SafeCustomerForCreation

func SafeCustomerForCreation(cust *invdendpoint.Customer) (*invdendpoint.Customer, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeCustomerForUpdate

func SafeCustomerForUpdate(cust *invdendpoint.Customer) (*invdendpoint.Customer, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeEstimateForCreation

func SafeEstimateForCreation(estimate *invdendpoint.Estimate) (*invdendpoint.Estimate, error)

SafeEstimateForCreation prunes estimate data for just fields that can be used for creation of a invoice

func SafeEstimateForUpdate

func SafeEstimateForUpdate(estimate *invdendpoint.Estimate) (*invdendpoint.Estimate, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeFileForCreation

func SafeFileForCreation(file *invdendpoint.File) (*invdendpoint.File, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeInvoiceForCreation

func SafeInvoiceForCreation(inv *invdendpoint.Invoice) (*invdendpoint.Invoice, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeInvoiceForUpdate

func SafeInvoiceForUpdate(inv *invdendpoint.Invoice) (*invdendpoint.Invoice, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeItemForCreation

func SafeItemForCreation(item *invdendpoint.Item) (*invdendpoint.Item, error)

SafeForCreation prunes item data for just fields that can be used for creation of an item

func SafeItemForUpdating

func SafeItemForUpdating(item *invdendpoint.Item) (*invdendpoint.Item, error)

SafeForUpdating prunes item data for just fields that can be used for updating of an item

func SafeNoteForUpdating

func SafeNoteForUpdating(note *invdendpoint.Note) (*invdendpoint.Note, error)

SafeCustomerForCreation prunes note data for just fields that can be used for creation of a note

func SafePaymentForCreation

func SafePaymentForCreation(payment *invdendpoint.Payment) (*invdendpoint.Payment, error)

SafePaymentForCreation prunes payment data for just fields that can be used for creation of a payment

func SafePaymentForUpdate

func SafePaymentForUpdate(payment *invdendpoint.Payment) (*invdendpoint.Payment, error)

SafePaymentForUpdate prunes payment data for just fields that can be used for creation of a payment

func SafePendingLineItemForCreation

func SafePendingLineItemForCreation(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafePendingLineItemForUpdate

func SafePendingLineItemForUpdate(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafePlanForCreation

func SafePlanForCreation(plan *invdendpoint.Plan) (*invdendpoint.Plan, error)

SafeCustomerForCreation prunes plan data for just fields that can be used for creation of a plan

func SafePlanForUpdating

func SafePlanForUpdating(plan *invdendpoint.Plan) (*invdendpoint.Plan, error)

SafeTaskForUpdating prunes plan data for just fields that can be used for updating of a plan

func SafeSourceForCreation

func SafeSourceForCreation(source *invdendpoint.PaymentSource) (*invdendpoint.PaymentSource, error)

SafeSourceForCreation prunes source object for just fields that can be used for creation

func SafeSubscriptionForCreation

func SafeSubscriptionForCreation(sub *invdendpoint.Subscription) (*invdendpoint.Subscription, error)

SafeSubscriptionForCreation prunes subscription data for just fields that can be used for creation of a subscription

func SafeSubscriptionsForUpdate

func SafeSubscriptionsForUpdate(sub *invdendpoint.Subscription) (*invdendpoint.Subscription, error)

SafeSubscriptionsForUpdate prunes subscription data for just fields that can be used for updating of a subscription

func SafeTaskForCreation

func SafeTaskForCreation(task *invdendpoint.Task) (*invdendpoint.Task, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeTaskForUpdating

func SafeTaskForUpdating(task *invdendpoint.Task) (*invdendpoint.Task, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeTaxRateForCreation

func SafeTaxRateForCreation(taxRate *invdendpoint.TaxRate) (*invdendpoint.TaxRate, error)

SafetaxRateForCreation prunes tax TaxRate data for just fields that can be used for creation of a tax TaxRate

func SafeTaxRateForUpdating

func SafeTaxRateForUpdating(taxRate *invdendpoint.TaxRate) (*invdendpoint.TaxRate, error)

SafeTaxRateForUpdating prunes plan data for just fields that can be used for updating of a plan

func Version

func Version() string

Types

type APIError

type APIError struct {
	Type    string `json:"type"`
	Message string `json:"message"`
	Param   string `json:"param"`
}

func NewAPIError

func NewAPIError(typeE, message, param string) *APIError

func (*APIError) Error

func (apiErr *APIError) Error() string

type Charge

type Charge struct {
	*Connection
	*invdendpoint.Charge
}

func (*Charge) Create

func (c *Charge) Create(chargeRequest *invdendpoint.ChargeRequest) (*Payment, error)

type ChasingCadence

type ChasingCadence struct {
	*Connection
	*invdendpoint.ChasingCadence
}

func (*ChasingCadence) ListAll

type ChasingCadences

type ChasingCadences []*ChasingCadence

type Connection

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

func NewConnection

func NewConnection(key string, sandbox bool) *Connection

func (*Connection) NewCharge

func (c *Connection) NewCharge() *Charge

func (*Connection) NewChasingCadence

func (c *Connection) NewChasingCadence() *ChasingCadence

func (*Connection) NewContact

func (c *Connection) NewContact() *invdendpoint.Contact

func (*Connection) NewCoupon

func (c *Connection) NewCoupon() *Coupon

func (*Connection) NewCreditNote

func (c *Connection) NewCreditNote() *CreditNote

func (*Connection) NewCustomer

func (c *Connection) NewCustomer() *Customer

func (*Connection) NewEstimate

func (c *Connection) NewEstimate() *Estimate

func (*Connection) NewEvent

func (c *Connection) NewEvent() *Event

func (*Connection) NewFile

func (c *Connection) NewFile() *File

func (*Connection) NewInvoice

func (c *Connection) NewInvoice() *Invoice

func (*Connection) NewItem

func (c *Connection) NewItem() *Item

func (*Connection) NewNote

func (c *Connection) NewNote() *Note

func (*Connection) NewNotification

func (c *Connection) NewNotification() *Notification

func (*Connection) NewPayment

func (c *Connection) NewPayment() *Payment

func (*Connection) NewPaymentPlanRequest

func (c *Connection) NewPaymentPlanRequest() *invdendpoint.PaymentPlanRequest

func (*Connection) NewPaymentSource

func (c *Connection) NewPaymentSource() *invdendpoint.PaymentSource

func (*Connection) NewPendingLineItem

func (c *Connection) NewPendingLineItem() *invdendpoint.PendingLineItem

func (*Connection) NewPlan

func (c *Connection) NewPlan() *Plan

func (*Connection) NewPreviewRequest

func (c *Connection) NewPreviewRequest() *invdendpoint.SubscriptionPreviewRequest

func (*Connection) NewRefund

func (c *Connection) NewRefund() *Refund

func (*Connection) NewRole

func (c *Connection) NewRole() *Role

func (*Connection) NewSubscription

func (c *Connection) NewSubscription() *Subscription

func (*Connection) NewTask

func (c *Connection) NewTask() *Task

func (*Connection) NewTaxRate

func (c *Connection) NewTaxRate() *TaxRate

func (*Connection) NewUser

func (c *Connection) NewUser() *User

func (*Connection) NewWebhookAttempt

func (c *Connection) NewWebhookAttempt() *WebhookAttempt

type Coupon

type Coupon struct {
	*Connection
	*invdendpoint.Coupon
}

func (*Coupon) Create

func (c *Coupon) Create(coupon *Coupon) (*Coupon, error)

func (*Coupon) Delete

func (c *Coupon) Delete() error

func (*Coupon) ListAll

func (c *Coupon) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Coupons, error)

func (*Coupon) Retrieve

func (c *Coupon) Retrieve(id string) (*Coupon, error)

func (*Coupon) Save

func (c *Coupon) Save() error

type Coupons

type Coupons []*Coupon

type CreditNote

type CreditNote struct {
	*Connection
	*invdendpoint.CreditNote
}

func (*CreditNote) Count

func (c *CreditNote) Count() (int64, error)

func (*CreditNote) Create

func (c *CreditNote) Create(creditNote *CreditNote) (*CreditNote, error)

func (*CreditNote) Delete

func (c *CreditNote) Delete() error

func (*CreditNote) ListAll

func (c *CreditNote) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (CreditNotes, error)

func (*CreditNote) ListAttachments

func (c *CreditNote) ListAttachments() (Files, error)

func (*CreditNote) Retrieve

func (c *CreditNote) Retrieve(id int64) (*CreditNote, error)

func (*CreditNote) Save

func (c *CreditNote) Save() error

func (*CreditNote) SendEmail

func (*CreditNote) SendLetter

func (c *CreditNote) SendLetter() (*invdendpoint.LetterResponse, error)

func (*CreditNote) SendText

func (*CreditNote) String

func (c *CreditNote) String() string

func (*CreditNote) Void

func (c *CreditNote) Void() (*CreditNote, error)

type CreditNotes

type CreditNotes []*CreditNote

type Customer

type Customer struct {
	*Connection
	*invdendpoint.Customer
}

func (*Customer) ConsolidateInvoices

func (c *Customer) ConsolidateInvoices() (*Invoice, error)

func (*Customer) Count

func (c *Customer) Count() (int64, error)

func (*Customer) Create

func (c *Customer) Create(customer *Customer) (*Customer, error)

func (*Customer) CreateContact

func (c *Customer) CreateContact(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)

func (*Customer) CreateCreditBalanceAdjustment

func (c *Customer) CreateCreditBalanceAdjustment(amount float64) (*invdendpoint.BalanceAdjustment, error)

func (*Customer) CreatePaymentSource

func (c *Customer) CreatePaymentSource(source *invdendpoint.PaymentSource) (*invdendpoint.PaymentSource, error)

func (*Customer) CreatePendingLineItem

func (c *Customer) CreatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

func (*Customer) Delete

func (c *Customer) Delete() error

func (*Customer) DeleteBankAccount

func (c *Customer) DeleteBankAccount(acctID int64) error

func (*Customer) DeleteCard

func (c *Customer) DeleteCard(cardID int64) error

func (*Customer) DeleteContact

func (c *Customer) DeleteContact(contactID int64) error

func (*Customer) DeletePendingLineItem

func (c *Customer) DeletePendingLineItem(id int64) error

func (*Customer) FreeUpdate

func (c *Customer) FreeUpdate(customerData interface{}) error

func (*Customer) GetBalance

func (c *Customer) GetBalance() (*invdendpoint.Balance, error)

func (*Customer) List

func (c *Customer) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Customers, string, error)

func (*Customer) ListAll

func (c *Customer) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Customers, error)

func (*Customer) ListAllContacts

func (c *Customer) ListAllContacts() (invdendpoint.Contacts, error)

func (*Customer) ListAllPaymentSources

func (c *Customer) ListAllPaymentSources() (invdendpoint.PaymentSources, error)

func (*Customer) ListAllPendingLineItems

func (c *Customer) ListAllPendingLineItems() (invdendpoint.PendingLineItems, error)

func (*Customer) ListCustomerByNumber

func (c *Customer) ListCustomerByNumber(customerNumber string) (*Customer, error)

func (*Customer) Retrieve

func (c *Customer) Retrieve(id int64) (*Customer, error)

func (*Customer) RetrieveContact

func (c *Customer) RetrieveContact(contactID int64) (*invdendpoint.Contact, error)

func (*Customer) RetrieveNotes

func (c *Customer) RetrieveNotes() (invdendpoint.Notes, error)

func (*Customer) RetrievePendingLineItem

func (c *Customer) RetrievePendingLineItem(id int64) (*invdendpoint.PendingLineItem, error)

func (*Customer) Save

func (c *Customer) Save() error

func (*Customer) SendStatementEmail

func (c *Customer) SendStatementEmail(custStmtReq *invdendpoint.EmailRequest) (invdendpoint.EmailResponses, error)

func (*Customer) SendStatementLetter

func (c *Customer) SendStatementLetter(custStmtReq *invdendpoint.LetterRequest) (*invdendpoint.LetterResponse, error)

func (*Customer) SendStatementText

func (c *Customer) SendStatementText(custStmtReq *invdendpoint.TextRequest) (invdendpoint.TextResponses, error)

func (*Customer) TriggerInvoice

func (c *Customer) TriggerInvoice() (*Invoice, error)

func (*Customer) UpdateContact

func (c *Customer) UpdateContact(contactToUpdate *invdendpoint.Contact) (*invdendpoint.Contact, error)

func (*Customer) UpdatePendingLineItem

func (c *Customer) UpdatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

type Customers

type Customers []*Customer

type Estimate

type Estimate struct {
	*Connection
	*invdendpoint.Estimate
}

func (*Estimate) Count

func (c *Estimate) Count() (int64, error)

func (*Estimate) Create

func (c *Estimate) Create(estimate *Estimate) (*Estimate, error)

func (*Estimate) Delete

func (c *Estimate) Delete() error

func (*Estimate) GenerateInvoice

func (c *Estimate) GenerateInvoice() (*Invoice, error)

func (*Estimate) List

func (c *Estimate) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Estimates, string, error)

func (*Estimate) ListAll

func (c *Estimate) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Estimates, error)

func (*Estimate) ListAttachments

func (c *Estimate) ListAttachments() (Files, error)

func (*Estimate) Retrieve

func (c *Estimate) Retrieve(id int64) (*Estimate, error)

func (*Estimate) Save

func (c *Estimate) Save() error

func (*Estimate) SendEmail

func (*Estimate) SendLetter

func (c *Estimate) SendLetter() (*invdendpoint.LetterResponse, error)

func (*Estimate) SendText

func (*Estimate) String

func (c *Estimate) String() string

func (*Estimate) Void

func (c *Estimate) Void() (*Estimate, error)

type Estimates

type Estimates []*Estimate

type Event

type Event struct {
	*Connection
	*invdendpoint.Event
}

func (*Event) List

func (c *Event) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Events, string, error)

func (*Event) ListAll

func (c *Event) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Events, error)

func (*Event) ListAllByDatesAndUser

func (c *Event) ListAllByDatesAndUser(filter *invdendpoint.Filter, sort *invdendpoint.Sort, startDate int64, endDate int64, user string, objectType string, objectID int64) (Events, error)

func (*Event) Retrieve

func (c *Event) Retrieve(id int64) (*Event, error)

type Events

type Events []*Event

type File

type File struct {
	*Connection
	*invdendpoint.File
}

func (*File) Create

func (c *File) Create(file *File) (*File, error)

func (*File) Delete

func (c *File) Delete() error

func (*File) Retrieve

func (c *File) Retrieve(id int64) (*File, error)

type Files

type Files []*File

type Invoice

type Invoice struct {
	*Connection
	*invdendpoint.Invoice
	IncludeUpdatedAt bool
}

func (*Invoice) CancelPaymentPlan

func (c *Invoice) CancelPaymentPlan() error

func (*Invoice) Count

func (c *Invoice) Count() (int64, error)

func (*Invoice) Create

func (c *Invoice) Create(invoice *Invoice) (*Invoice, error)

func (*Invoice) CreatePaymentPlan

func (c *Invoice) CreatePaymentPlan(paymentPlanRequest *invdendpoint.PaymentPlanRequest) (*invdendpoint.PaymentPlan, error)

func (*Invoice) Delete

func (c *Invoice) Delete() error

func (*Invoice) List

func (c *Invoice) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, string, error)

func (*Invoice) ListAll

func (c *Invoice) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, error)

func (*Invoice) ListAllHelper

func (c *Invoice) ListAllHelper(endpoint string, filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, error)

func (*Invoice) ListAllInvoicesEndDate

func (c *Invoice) ListAllInvoicesEndDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, invoiceDate int64) (Invoices, error)

func (*Invoice) ListAllInvoicesStartDate

func (c *Invoice) ListAllInvoicesStartDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, invoiceDate int64) (Invoices, error)

func (*Invoice) ListAllInvoicesStartEndDate

func (c *Invoice) ListAllInvoicesStartEndDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, startDate, endDate int64) (Invoices, error)

func (*Invoice) ListAllInvoicesUpdatedDate

func (c *Invoice) ListAllInvoicesUpdatedDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, invoiceDate int64) (Invoices, error)

func (*Invoice) ListAttachments

func (c *Invoice) ListAttachments() (Files, error)

func (*Invoice) ListHelper

func (c *Invoice) ListHelper(url string, filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, string, error)

func (*Invoice) ListInvoiceByNumber

func (c *Invoice) ListInvoiceByNumber(invoiceNumber string) (*Invoice, error)

func (*Invoice) Pay

func (c *Invoice) Pay() error

func (*Invoice) Retrieve

func (c *Invoice) Retrieve(id int64) (*Invoice, error)

func (*Invoice) RetrieveNotes

func (c *Invoice) RetrieveNotes() (Notes, error)

func (*Invoice) RetrievePaymentPlan

func (c *Invoice) RetrievePaymentPlan() (*invdendpoint.PaymentPlan, error)

func (*Invoice) Save

func (c *Invoice) Save() error

func (*Invoice) SendEmail

func (*Invoice) SendLetter

func (c *Invoice) SendLetter() (*invdendpoint.LetterResponse, error)

func (*Invoice) SendText

func (*Invoice) String

func (c *Invoice) String() string

func (*Invoice) Void

func (c *Invoice) Void() (*Invoice, error)

type Invoices

type Invoices []*Invoice

type Item

type Item struct {
	*Connection
	*invdendpoint.Item
}

func (*Item) Create

func (c *Item) Create(item *Item) (*Item, error)

func (*Item) Delete

func (c *Item) Delete() error

func (*Item) ListAll

func (c *Item) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Items, error)

func (*Item) Retrieve

func (c *Item) Retrieve(id string) (*Item, error)

func (*Item) Save

func (c *Item) Save() error

type Items

type Items []*Item

type Note

type Note struct {
	*Connection
	*invdendpoint.Note
}

func (*Note) Create

func (c *Note) Create(createNoteRequest invdendpoint.CreateNoteRequest) (*Note, error)

func (*Note) Delete

func (c *Note) Delete() error

func (*Note) ListAll

func (c *Note) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Notes, error)

func (*Note) Save

func (c *Note) Save() error

type Notes

type Notes []*Note

type Notification

type Notification struct {
	*Connection
	*invdendpoint.Notification
}

func (*Notification) Create

func (c *Notification) Create(notificationRequest *invdendpoint.NotificationRequest) (*Notification, error)

func (*Notification) Delete

func (c *Notification) Delete(id int64) error

func (*Notification) ListAll

func (c *Notification) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Notifications, error)

func (*Notification) Retrieve

func (c *Notification) Retrieve(id int64) (*Notification, error)

func (*Notification) Save

func (c *Notification) Save(notificationRequest *invdendpoint.NotificationRequest, id int64) error

type Notifications

type Notifications []*Notification

type Payment

type Payment struct {
	*Connection
	*invdendpoint.Payment
}

func (*Payment) Count

func (c *Payment) Count() (int64, error)

func (*Payment) Create

func (c *Payment) Create(payment *Payment) (*Payment, error)

func (*Payment) Delete

func (c *Payment) Delete() error

func (*Payment) List

func (c *Payment) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Payments, string, error)

func (*Payment) ListAll

func (c *Payment) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Payments, error)

func (*Payment) Retrieve

func (c *Payment) Retrieve(id int64) (*Payment, error)

func (*Payment) Save

func (c *Payment) Save() error

func (*Payment) SendReceipt

func (c *Payment) SendReceipt(emailReq *invdendpoint.EmailRequest) (invdendpoint.EmailResponses, error)

type Payments

type Payments []*Payment

type Plan

type Plan struct {
	*Connection
	*invdendpoint.Plan
}

func (*Plan) Create

func (c *Plan) Create(plan *Plan) (*Plan, error)

func (*Plan) Delete

func (c *Plan) Delete() error

func (*Plan) ListAll

func (c *Plan) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Plans, error)

func (*Plan) ListAllSubNumber

func (c *Plan) ListAllSubNumber(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Plans, error)

func (*Plan) Retrieve

func (c *Plan) Retrieve(id string) (*Plan, error)

func (*Plan) RetrieveWithSubNumber

func (c *Plan) RetrieveWithSubNumber(id string) (*Plan, error)

func (*Plan) Save

func (c *Plan) Save() error

type Plans

type Plans []*Plan

type Refund

type Refund struct {
	*Connection
	*invdendpoint.Refund
}

func (*Refund) Create

func (c *Refund) Create(chargeId int64, amount float64) error

type Role

type Role struct {
	*Connection
	*invdendpoint.Role
}

func (*Role) ListAll

func (c *Role) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) ([]*Role, error)

func (*Role) Retrieve

func (c *Role) Retrieve(id int64) (*Role, error)

type Roles

type Roles []*Role

type Subscription

type Subscription struct {
	*Connection
	*invdendpoint.Subscription
}

func (*Subscription) Cancel

func (c *Subscription) Cancel() error

func (*Subscription) Count

func (c *Subscription) Count() (int64, error)

func (*Subscription) Create

func (c *Subscription) Create(subscription *Subscription) (*Subscription, error)

func (*Subscription) List

func (*Subscription) ListAll

func (c *Subscription) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Subscriptions, error)

func (*Subscription) Preview

func (*Subscription) Retrieve

func (c *Subscription) Retrieve(id int64) (*Subscription, error)

func (*Subscription) Save

func (c *Subscription) Save() error

type Subscriptions

type Subscriptions []*Subscription

type Task

type Task struct {
	*Connection
	*invdendpoint.Task
}

func (*Task) Create

func (c *Task) Create(task *Task) (*Task, error)

func (*Task) Delete

func (c *Task) Delete() error

func (*Task) ListAll

func (c *Task) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Tasks, error)

func (*Task) Retrieve

func (c *Task) Retrieve(id int64) (*Task, error)

func (*Task) Save

func (c *Task) Save() error

type Tasks

type Tasks []*Task

type TaxRate

type TaxRate struct {
	*Connection
	*invdendpoint.TaxRate
}

func (*TaxRate) Create

func (c *TaxRate) Create(taxRate *TaxRate) (*TaxRate, error)

func (*TaxRate) Delete

func (c *TaxRate) Delete() error

func (*TaxRate) ListAll

func (c *TaxRate) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (TaxRates, error)

func (*TaxRate) Retrieve

func (c *TaxRate) Retrieve(id string) (*TaxRate, error)

func (*TaxRate) Save

func (c *TaxRate) Save() error

type TaxRates

type TaxRates []*TaxRate

type User

type User struct {
	*Connection
	*invdendpoint.UserResponse
}

func (*User) Create

func (c *User) Create(userRequest *invdendpoint.UserRequest) (*User, error)

func (*User) Delete

func (c *User) Delete(id int64) error

func (*User) GenerateRegistrationURL

func (c *User) GenerateRegistrationURL() string

func (*User) ListAll

func (c *User) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Users, error)

func (*User) Retrieve

func (c *User) Retrieve(id int64) (*User, error)

func (*User) Save

func (c *User) Save(userRequest *invdendpoint.UserRequest, id int64) error

func (*User) SendInvite

func (c *User) SendInvite(id int64) error

func (*User) SetUserEmailFrequency

func (c *User) SetUserEmailFrequency(userEmailFrequency string, id int64) (*User, error)

type Users

type Users []*User

type WebhookAttempt

type WebhookAttempt struct {
	*Connection
	*invdendpoint.WebhookAttempt
}

func (*WebhookAttempt) ListAll

func (*WebhookAttempt) ReAttempt

func (c *WebhookAttempt) ReAttempt(webhookId int64) error

type WebhookAttempts

type WebhookAttempts []*WebhookAttempt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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