Documentation ¶
Overview ¶
Transactions can represent a charge, payment, refund, or adjustment. We record charge and refund transactions for you that happen through Invoiced. The payment transaction type is designated for recording offline payments like checks. Finally, an adjustment transaction represents any additional credit or debits to a customer’s balance. Most transactions will be associated with an invoice, however, not all. For example, if you wanted to credit your customer for $20 you would create an adjustment transaction for -$20 using the customer ID only instead of the invoice ID. We currently support the following payment methods on transactions: credit_card ach bitcoin paypal wire_transfer check cash other
Index ¶
- Constants
- func Version() string
- type APIError
- type Connection
- func (c *Connection) CancelSubscription(subscriptionID int64) error
- func (c *Connection) MakeEndPointURL(endPoint string) string
- func (c *Connection) NewCustomer() *Customer
- func (c *Connection) NewEvent() *Event
- func (c *Connection) NewFile() *File
- func (c *Connection) NewInvoice() *Invoice
- func (c *Connection) NewSubscription() *Subscription
- func (c *Connection) NewTransaction() *Transaction
- func (c *Connection) SetCancelAtPeriodEnd(subscriptionID int64, val bool) (*Subscription, error)
- type Customer
- func (c *Customer) Count() (int64, error)
- func (c *Customer) Create(customer *Customer) (*Customer, error)
- func (c *Customer) CreateContact(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)
- func (c *Customer) CreatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)
- func (c *Customer) Delete() error
- func (c *Customer) DeleteContact(contactID int64) error
- func (c *Customer) DeletePendingLineItem(id int64) error
- func (c *Customer) GetBalance() (*invdendpoint.CustomerBalance, error)
- func (c *Customer) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Customers, string, error)
- func (c *Customer) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Customers, error)
- func (c *Customer) ListAllContacts() (invdendpoint.Contacts, error)
- func (c *Customer) ListCustomerByNumber(customerNumber string) (*Customer, error)
- func (c *Customer) ListCustomersByName(customerName string) (Customers, error)
- func (c *Customer) Retrieve(id int64) (*Customer, error)
- func (c *Customer) RetrieveContact(contactID int64) (*invdendpoint.Contact, error)
- func (c *Customer) RetrievePendingLineItem(id int64) (*invdendpoint.PendingLineItem, error)
- func (c *Customer) Save() error
- func (c *Customer) SendStatement(custStmtReq *invdendpoint.EmailResponse) (*invdendpoint.EmailResponses, error)
- func (c *Customer) TriggerInvoice() (*Invoice, error)
- func (c *Customer) UpdateContact(contactToUpdate *invdendpoint.Contact) (*invdendpoint.Contact, error)
- func (c *Customer) UpdatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)
- type Customers
- type Event
- type Events
- type File
- type Files
- type Invoice
- func (c *Invoice) Count() (int64, error)
- func (c *Invoice) Create(invoice *Invoice) (*Invoice, error)
- func (c *Invoice) Delete() error
- func (c *Invoice) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, string, error)
- func (c *Invoice) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, error)
- func (c *Invoice) ListAttachements() (Files, error)
- func (c *Invoice) ListInvoiceByNumber(invoiceNumber string) (*Invoice, error)
- func (c *Invoice) Pay() error
- func (c *Invoice) Retrieve(id int64) (*Invoice, error)
- func (c *Invoice) Save() error
- func (c *Invoice) Send(emailReq *invdendpoint.EmailRequest) (invdendpoint.EmailResponses, error)
- func (c *Invoice) String() string
- type InvoicedToken
- type Invoices
- type Subscription
- func (c *Subscription) Cancel() error
- func (c *Subscription) Count() (int64, error)
- func (c *Subscription) Create(subscription *Subscription) (*Subscription, error)
- func (c *Subscription) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Subscriptions, string, error)
- func (c *Subscription) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Subscriptions, error)
- func (c *Subscription) Retrieve(id int64) (*Subscription, error)
- func (c *Subscription) Save() error
- type Subscriptions
- type Transaction
- func (c *Transaction) Count() (int64, error)
- func (c *Transaction) Create(transaction *Transaction) (*Transaction, error)
- func (c *Transaction) Delete() error
- func (c *Transaction) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Transactions, string, error)
- func (c *Transaction) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Transactions, error)
- func (c *Transaction) ListSuccessfulByInvoiceID(invoiceID int64) (Transactions, error)
- func (c *Transaction) ListSuccessfulChargesAndPaymentsByInvoiceID(invoiceID int64) (Transactions, error)
- func (c *Transaction) ListSuccessfulChargesByInvoiceID(invoiceID int64) (Transactions, error)
- func (c *Transaction) ListSuccessfulPaymentsByInvoiceID(invoiceID int64) (Transactions, error)
- func (c *Transaction) ListSuccessfulRefundsByInvoiceID(invoiceID int64) (Transactions, error)
- func (c *Transaction) Refund(refund *invdendpoint.Refund) error
- func (c *Transaction) Retrieve(id int64) (*Transaction, error)
- func (c *Transaction) Save() error
- func (c *Transaction) SendReceipt(emailReq *invdendpoint.EmailRequest) (invdendpoint.EmailResponses, error)
- type Transactions
Constants ¶
const InvoicedTokenString = "invoicedToken"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct { Type string `json:"type"` Message string `json:"message"` Param string `json:"param"` }
func NewAPIError ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func MockConnection ¶
func MockConnection(key string, server *httptest.Server) *Connection
func NewConnection ¶
func NewConnection(key string, devMode bool) *Connection
func (*Connection) CancelSubscription ¶
func (c *Connection) CancelSubscription(subscriptionID int64) error
CancelSubscription calls: DELETE /subscriptions/:subscriptionID
func (*Connection) MakeEndPointURL ¶
func (c *Connection) MakeEndPointURL(endPoint string) string
func (*Connection) NewCustomer ¶
func (c *Connection) NewCustomer() *Customer
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) NewSubscription ¶
func (c *Connection) NewSubscription() *Subscription
func (*Connection) NewTransaction ¶
func (c *Connection) NewTransaction() *Transaction
func (*Connection) SetCancelAtPeriodEnd ¶
func (c *Connection) SetCancelAtPeriodEnd(subscriptionID int64, val bool) (*Subscription, error)
SetCancelAtPeriodEnd sets the cancel_at_period_end field for the given subscription ID. This is a convenience function to save having to fetch or construct a whole Subscription object in order to call Subscription.Save() on it.
type Customer ¶
type Customer struct { *Connection *invdendpoint.Customer }
func (*Customer) CreateContact ¶
func (c *Customer) CreateContact(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)
func (*Customer) CreatePendingLineItem ¶
func (c *Customer) CreatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)
func (*Customer) DeleteContact ¶
func (*Customer) DeletePendingLineItem ¶
func (*Customer) GetBalance ¶
func (c *Customer) GetBalance() (*invdendpoint.CustomerBalance, 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) ListCustomerByNumber ¶
func (*Customer) ListCustomersByName ¶
func (*Customer) RetrieveContact ¶
func (c *Customer) RetrieveContact(contactID int64) (*invdendpoint.Contact, error)
func (*Customer) RetrievePendingLineItem ¶
func (c *Customer) RetrievePendingLineItem(id int64) (*invdendpoint.PendingLineItem, error)
func (*Customer) SendStatement ¶
func (c *Customer) SendStatement(custStmtReq *invdendpoint.EmailResponse) (*invdendpoint.EmailResponses, error)
func (*Customer) TriggerInvoice ¶
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 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)
type File ¶
type File struct { *Connection *invdendpoint.File }
type Invoice ¶
type Invoice struct { *Connection *invdendpoint.Invoice IncludeUpdatedAt bool }
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) ListAttachements ¶
func (*Invoice) ListInvoiceByNumber ¶
func (*Invoice) Send ¶
func (c *Invoice) Send(emailReq *invdendpoint.EmailRequest) (invdendpoint.EmailResponses, error)
type InvoicedToken ¶
type InvoicedToken struct {
Key string `json:"invoicedApiKey"`
}
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 (c *Subscription) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Subscriptions, string, error)
func (*Subscription) ListAll ¶
func (c *Subscription) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Subscriptions, error)
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 Transaction ¶
type Transaction struct { *Connection *invdendpoint.Transaction }
func (*Transaction) Count ¶
func (c *Transaction) Count() (int64, error)
func (*Transaction) Create ¶
func (c *Transaction) Create(transaction *Transaction) (*Transaction, error)
func (*Transaction) Delete ¶
func (c *Transaction) Delete() error
func (*Transaction) List ¶
func (c *Transaction) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Transactions, string, error)
func (*Transaction) ListAll ¶
func (c *Transaction) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Transactions, error)
func (*Transaction) ListSuccessfulByInvoiceID ¶
func (c *Transaction) ListSuccessfulByInvoiceID(invoiceID int64) (Transactions, error)
func (*Transaction) ListSuccessfulChargesAndPaymentsByInvoiceID ¶
func (c *Transaction) ListSuccessfulChargesAndPaymentsByInvoiceID(invoiceID int64) (Transactions, error)
func (*Transaction) ListSuccessfulChargesByInvoiceID ¶
func (c *Transaction) ListSuccessfulChargesByInvoiceID(invoiceID int64) (Transactions, error)
func (*Transaction) ListSuccessfulPaymentsByInvoiceID ¶
func (c *Transaction) ListSuccessfulPaymentsByInvoiceID(invoiceID int64) (Transactions, error)
func (*Transaction) ListSuccessfulRefundsByInvoiceID ¶
func (c *Transaction) ListSuccessfulRefundsByInvoiceID(invoiceID int64) (Transactions, error)
func (*Transaction) Refund ¶
func (c *Transaction) Refund(refund *invdendpoint.Refund) error
func (*Transaction) Retrieve ¶
func (c *Transaction) Retrieve(id int64) (*Transaction, error)
func (*Transaction) Save ¶
func (c *Transaction) Save() error
func (*Transaction) SendReceipt ¶
func (c *Transaction) SendReceipt(emailReq *invdendpoint.EmailRequest) (invdendpoint.EmailResponses, error)
type Transactions ¶
type Transactions []*Transaction