processout

package module
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: MIT Imports: 9 Imported by: 0

README

ProcessOut Go

GoDoc

Installation

go get gopkg.in/processout.v2

Versioning

Versioning is done using gopkg.in, available at gopkg.in/processout.v2.

Documentation

Overview

Package processout offers bindings for the ProcessOut API — https://www.processout.com

The full documentation of the API, along with Go examples, can be found on our website: https://docs.processout.com

It is recommended to use the versionned version of the package (with the import path that starts with gopkg.in) instead of the GitHub repository.

To get started, you just need your API credentials, that you can find in your project's settings. Here is a simple example that creates an invoice and prints its URL:

p := processout.New("<project-id>", "<project-secret>")
iv, err := p.Invoices.Create(&processout.Invoice{
	Name:     "Test item",
	Amount:   "10.00",
	Currency: "USD",
})
if err != nil {
	panic(err)
}

fmt.Println(iv.URL)

Index

Constants

View Source
const (
	// APIVersion is the version of the API this package uses
	APIVersion = "1.3.0.0"
)

Variables

View Source
var (
	// Host is the URL where API requests are made
	Host = "https://api.processout.com"
)

Functions

This section is empty.

Types

type Activities

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

Activitys manages the Activity struct

func (Activities) All

func (s Activities) All(options ...Options) ([]*Activity, *Error)

All : Get all the project activities.

func (Activities) Find

func (s Activities) Find(activityID string, options ...Options) (*Activity, *Error)

Find : Find a specific activity and fetch its data.

type Activity

type Activity struct {
	// ID : ID of the activity
	ID string `json:"id"`
	// Project : Project to which the activity belongs
	Project *Project `json:"project"`
	// Title : Title of the activity
	Title string `json:"title"`
	// Content : Content of the activity
	Content string `json:"content"`
	// Level : Level of the activity
	Level int `json:"level"`
	// CreatedAt : Date at which the transaction was created
	CreatedAt time.Time `json:"created_at"`
}

type AuthorizationRequest

type AuthorizationRequest struct {
	// ID : ID of the authorization
	ID string `json:"id"`
	// Project : Project to which the authorization request belongs
	Project *Project `json:"project"`
	// Customer : Customer linked to the authorization request
	Customer *Customer `json:"customer"`
	// Token : Token linked to the authorization request, once authorized
	Token *Token `json:"token"`
	// URL : URL to which you may redirect your customer to proceed with the authorization
	URL string `json:"url"`
	// Authorized : Whether or not the authorization request was authorized
	Authorized bool `json:"authorized"`
	// Name : Name of the authorization
	Name string `json:"name"`
	// Currency : Currency of the authorization
	Currency string `json:"currency"`
	// ReturnURL : URL where the customer will be redirected upon authorization
	ReturnURL string `json:"return_url"`
	// CancelURL : URL where the customer will be redirected if the authorization was canceled
	CancelURL string `json:"cancel_url"`
	// Custom : Custom variable passed along in the events/webhooks
	Custom string `json:"custom"`
	// Sandbox : Define whether or not the authorization is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the authorization was created
	CreatedAt time.Time `json:"created_at"`
}

type AuthorizationRequests

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

AuthorizationRequests manages the AuthorizationRequest struct

func (AuthorizationRequests) Create

func (s AuthorizationRequests) Create(authorizationRequest *AuthorizationRequest, customerID string, options ...Options) (*AuthorizationRequest, *Error)

Create : Create a new authorization request for the given customer ID.

func (AuthorizationRequests) Customer

func (s AuthorizationRequests) Customer(authorizationRequest *AuthorizationRequest, options ...Options) (*Customer, *Error)

Customer : Get the customer linked to the authorization request.

func (AuthorizationRequests) Find

func (s AuthorizationRequests) Find(authorizationRequestID string, options ...Options) (*AuthorizationRequest, *Error)

Find : Find an authorization request by its ID.

type Customer

type Customer struct {
	// ID : ID of the customer
	ID string `json:"id"`
	// Project : Project to which the customer belongs
	Project *Project `json:"project"`
	// Balance : Customer balance. Can be positive or negative. The balance is automatically applied to subscription invoices and is solely used for this purpose
	Balance string `json:"balance"`
	// Email : Email of the customer
	Email string `json:"email"`
	// FirstName : First name of the customer
	FirstName string `json:"first_name"`
	// LastName : Last name of the customer
	LastName string `json:"last_name"`
	// Address1 : Address of the customer
	Address1 string `json:"address1"`
	// Address2 : Secondary address of the customer
	Address2 string `json:"address2"`
	// City : City of the customer
	City string `json:"city"`
	// State : State of the customer
	State string `json:"state"`
	// Zip : ZIP code of the customer
	Zip string `json:"zip"`
	// CountryCode : Country code of the customer
	CountryCode string `json:"country_code"`
	// Metadata : Metadata related to the customer, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// HasPin : Wether the customer has a PIN set or not
	HasPin bool `json:"has_pin"`
	// Sandbox : Define whether or not the customer is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the customer was created
	CreatedAt time.Time `json:"created_at"`
}

type CustomerAction

type CustomerAction struct {
	// Type : Customer action type (such as url)
	Type string `json:"type"`
	// Value : Value of the customer action. If type is an URL, URL to which you should redirect your customer
	Value string `json:"value"`
}

type CustomerActions

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

CustomerActions manages the CustomerAction struct

type Customers

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

Customers manages the Customer struct

func (Customers) All

func (s Customers) All(options ...Options) ([]*Customer, *Error)

All : Get all the customers.

func (Customers) Create

func (s Customers) Create(customer *Customer, options ...Options) (*Customer, *Error)

Create : Create a new customer.

func (Customers) Delete

func (s Customers) Delete(customer *Customer, options ...Options) *Error

Delete : Delete the customer.

func (Customers) Find

func (s Customers) Find(customerID string, options ...Options) (*Customer, *Error)

Find : Find a customer by its ID.

func (Customers) Save

func (s Customers) Save(customer *Customer, options ...Options) (*Customer, *Error)

Save : Save the updated customer attributes.

func (Customers) Subscriptions

func (s Customers) Subscriptions(customer *Customer, options ...Options) ([]*Subscription, *Error)

Subscriptions : Get the subscriptions belonging to the customer.

func (Customers) Tokens

func (s Customers) Tokens(customer *Customer, options ...Options) ([]*Token, *Error)

Tokens : Get the customer's tokens.

func (Customers) Transactions added in v2.4.2

func (s Customers) Transactions(customer *Customer, options ...Options) ([]*Transaction, *Error)

Transactions : Get the transactions belonging to the customer.

type Error added in v2.3.0

type Error struct {
	Code string
	// contains filtered or unexported fields
}

Error represents an error coming from the ProcessOut API. It inherits error and adds a Code field, corresponding to the error code coming from the API

type Event

type Event struct {
	// ID : ID of the event
	ID string `json:"id"`
	// Project : Project to which the event belongs
	Project *Project `json:"project"`
	// Name : Name of the event
	Name string `json:"name"`
	// Data : Data object associated to the event
	Data interface{} `json:"data"`
	// Sandbox : Define whether or not the event is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// FiredAt : Date at which the event was fired
	FiredAt time.Time `json:"fired_at"`
}

type Events

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

Events manages the Event struct

func (Events) All

func (s Events) All(options ...Options) ([]*Event, *Error)

All : Get all the events.

func (Events) Find

func (s Events) Find(eventID string, options ...Options) (*Event, *Error)

Find : Find an event by its ID.

func (Events) Webhooks

func (s Events) Webhooks(event *Event, options ...Options) ([]*Webhook, *Error)

Webhooks : Get all the webhooks of the event.

type Gatewaies added in v2.1.0

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

Gateways manages the Gateway struct

type Gateway added in v2.1.0

type Gateway struct {
	// ID : ID of the gateway
	ID string `json:"id"`
	// Name : Name of the payment gateway
	Name string `json:"name"`
	// DisplayName : Name of the payment gateway that can be displayed
	DisplayName string `json:"display_name"`
	// LogoURL : Logo URL of the payment gateway
	LogoURL string `json:"logo_url"`
	// URL : URL of the payment gateway
	URL string `json:"url"`
	// Flows : Supported flow by the gateway (one-off, subscription or tokenization)
	Flows []string `json:"flows"`
	// Tags : Gateway tags. Mainly used to filter gateways depending on their attributes (e-wallets and such)
	Tags []string `json:"tags"`
	// Description : Description of the payment gateway
	Description string `json:"description"`
}

type GatewayConfiguration added in v2.1.0

type GatewayConfiguration struct {
	// ID : ID of the gateway configuration
	ID string `json:"id"`
	// Project : Project to which the gateway configuration belongs
	Project *Project `json:"project"`
	// Gateway : Gateway that the configuration configures
	Gateway *Gateway `json:"gateway"`
	// Enabled : Define whether or not the gateway configuration is enabled
	Enabled bool `json:"enabled"`
	// PublicKeys : Public keys of the payment gateway configuration (key-value pair)
	PublicKeys map[string]string `json:"public_keys"`
}

type GatewayConfigurations added in v2.1.0

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

GatewayConfigurations manages the GatewayConfiguration struct

type GatewayRequest added in v2.2.3

type GatewayRequest struct {
	GatewayConfigurationUID string            `json:"gateway_configuration_id"`
	URL                     string            `json:"url"`
	Method                  string            `json:"method"`
	Headers                 map[string]string `json:"headers"`
	Body                    string            `json:"body"`
}

GatewayRequest is the struture representing an abstracted payment gateway request

func NewGatewayRequest added in v2.2.3

func NewGatewayRequest(gatewayConfigurationID string,
	req *http.Request) *GatewayRequest

NewGatewayRequest creates a new GatewayRequest from the given gateway configuration ID and request

func (*GatewayRequest) String added in v2.2.3

func (gr *GatewayRequest) String() string

String encodes the GatewayRequest to a source readable by ProcessOut

type Invoice

type Invoice struct {
	// ID : ID of the invoice
	ID string `json:"id"`
	// Project : Project to which the invoice belongs
	Project *Project `json:"project"`
	// Transaction : Transaction generated by the invoice
	Transaction *Transaction `json:"transaction"`
	// Customer : Customer linked to the invoice, if any
	Customer *Customer `json:"customer"`
	// Subscription : Subscription to which the invoice is linked to, if any
	Subscription *Subscription `json:"subscription"`
	// URL : URL to which you may redirect your customer to proceed with the payment
	URL string `json:"url"`
	// Name : Name of the invoice
	Name string `json:"name"`
	// Amount : Amount to be paid
	Amount string `json:"amount"`
	// Currency : Currency of the invoice
	Currency string `json:"currency"`
	// Metadata : Metadata related to the invoice, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// RequestEmail : Choose whether or not to request the email during the checkout process
	RequestEmail bool `json:"request_email"`
	// RequestShipping : Choose whether or not to request the shipping address during the checkout process
	RequestShipping bool `json:"request_shipping"`
	// ReturnURL : URL where the customer will be redirected upon payment
	ReturnURL string `json:"return_url"`
	// CancelURL : URL where the customer will be redirected if the paymen was canceled
	CancelURL string `json:"cancel_url"`
	// Sandbox : Define whether or not the invoice is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the invoice was created
	CreatedAt time.Time `json:"created_at"`
}

type Invoices

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

Invoices manages the Invoice struct

func (Invoices) All

func (s Invoices) All(options ...Options) ([]*Invoice, *Error)

All : Get all the invoices.

func (Invoices) AssignCustomer

func (s Invoices) AssignCustomer(invoice *Invoice, customerID string, options ...Options) (*Customer, *Error)

AssignCustomer : Assign a customer to the invoice.

func (Invoices) Authorize

func (s Invoices) Authorize(invoice *Invoice, source string, options ...Options) (*Transaction, *CustomerAction, *Error)

Authorize : Authorize the invoice using the given source (customer or token)

func (Invoices) Capture

func (s Invoices) Capture(invoice *Invoice, source string, options ...Options) (*Transaction, *CustomerAction, *Error)

Capture : Capture the invoice using the given source (customer or token)

func (Invoices) Create

func (s Invoices) Create(invoice *Invoice, options ...Options) (*Invoice, *Error)

Create : Create a new invoice.

func (Invoices) Customer

func (s Invoices) Customer(invoice *Invoice, options ...Options) (*Customer, *Error)

Customer : Get the customer linked to the invoice.

func (Invoices) Find

func (s Invoices) Find(invoiceID string, options ...Options) (*Invoice, *Error)

Find : Find an invoice by its ID.

func (Invoices) Transaction

func (s Invoices) Transaction(invoice *Invoice, options ...Options) (*Transaction, *Error)

Transaction : Get the transaction of the invoice.

func (Invoices) Void

func (s Invoices) Void(invoice *Invoice, options ...Options) *Error

Void : Void the invoice

type Options

type Options struct {
	IdempotencyKey string
	Expand         []string
	Filter         string
	Limit          uint64
	Page           uint64
	DisableLogging bool
}

Options represents the options available when doing a request to the ProcessOut API

type ProcessOut

type ProcessOut struct {
	// APIVersion is the version of the API to use
	APIVersion string

	Activities            *Activities
	AuthorizationRequests *AuthorizationRequests
	Customers             *Customers
	Tokens                *Tokens
	Events                *Events
	Gatewaies             *Gatewaies
	GatewayConfigurations *GatewayConfigurations
	Invoices              *Invoices
	CustomerActions       *CustomerActions
	Products              *Products
	Projects              *Projects
	Refunds               *Refunds
	Subscriptions         *Subscriptions
	Transactions          *Transactions
	Webhooks              *Webhooks
	// contains filtered or unexported fields
}

ProcessOut wraps all the components of the package in a single structure

func New

func New(projectID, projectSecret string) *ProcessOut

New creates a new struct *ProcessOut with the given API credentials. It initializes all the resources available so they can be used immediately.

type Product added in v2.5.0

type Product struct {
	// ID : ID of the product
	ID string `json:"id"`
	// URL : URL to which you may redirect your customer to proceed with the payment
	URL string `json:"url"`
	// Name : Name of the product
	Name string `json:"name"`
	// Amount : Amount of the product
	Amount string `json:"amount"`
	// Currency : Currency of the product
	Currency string `json:"currency"`
	// Metadata : Metadata related to the product, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// RequestEmail : Choose whether or not to request the email during the checkout process
	RequestEmail bool `json:"request_email"`
	// RequestShipping : Choose whether or not to request the shipping address during the checkout process
	RequestShipping bool `json:"request_shipping"`
	// ReturnURL : URL where the customer will be redirected upon payment
	ReturnURL string `json:"return_url"`
	// CancelURL : URL where the customer will be redirected if the paymen was canceled
	CancelURL string `json:"cancel_url"`
	// Sandbox : Define whether or not the product is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the product was created
	CreatedAt time.Time `json:"created_at"`
}

type Products added in v2.5.0

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

Products manages the Product struct

func (Products) All added in v2.5.0

func (s Products) All(options ...Options) ([]*Product, *Error)

All : Get all the products.

func (Products) Create added in v2.5.0

func (s Products) Create(product *Product, options ...Options) (*Product, *Error)

Create : Create a new product.

func (Products) Delete added in v2.5.0

func (s Products) Delete(product *Product, options ...Options) *Error

Delete : Delete the product.

func (Products) Find added in v2.5.0

func (s Products) Find(productID string, options ...Options) (*Product, *Error)

Find : Find a product by its ID.

func (Products) Invoice added in v2.5.0

func (s Products) Invoice(product *Product, options ...Options) (*Invoice, *Error)

Invoice : Create a new invoice from the product.

func (Products) Save added in v2.5.0

func (s Products) Save(product *Product, options ...Options) (*Product, *Error)

Save : Save the updated product attributes.

type Project

type Project struct {
	// ID : ID of the project
	ID string `json:"id"`
	// Name : Name of the project
	Name string `json:"name"`
	// LogoURL : Name of the project
	LogoURL string `json:"logo_url"`
	// Email : Email of the project
	Email string `json:"email"`
	// CreatedAt : Date at which the project was created
	CreatedAt time.Time `json:"created_at"`
}

type Projects

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

Projects manages the Project struct

func (Projects) Find added in v2.2.0

func (s Projects) Find(projectID string, options ...Options) (*Project, *Error)

Find : Find a project by its ID.

func (Projects) GatewayConfigurations added in v2.1.0

func (s Projects) GatewayConfigurations(project *Project, options ...Options) ([]*GatewayConfiguration, *Error)

GatewayConfigurations : Get all the gateway configurations of the project

type Refund

type Refund struct {
	// ID : ID of the refund
	ID string `json:"id"`
	// Transaction : Transaction to which the refund is applied
	Transaction *Transaction `json:"transaction"`
	// Reason : Reason for the refund. Either customer_request, duplicate or fraud
	Reason string `json:"reason"`
	// Information : Custom details regarding the refund
	Information string `json:"information"`
	// Amount : Amount to be refunded. Must not be greater than the amount still available on the transaction
	Amount string `json:"amount"`
	// Metadata : Metadata related to the refund, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// Sandbox : Define whether or not the refund is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the refund was done
	CreatedAt time.Time `json:"created_at"`
}

type Refunds

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

Refunds manages the Refund struct

func (Refunds) Apply

func (s Refunds) Apply(refund *Refund, transactionID string, options ...Options) *Error

Apply : Apply a refund to a transaction.

func (Refunds) Find

func (s Refunds) Find(transactionID, refundID string, options ...Options) (*Refund, *Error)

Find : Find a transaction's refund by its ID.

type Subscription

type Subscription struct {
	// ID : ID of the subscription
	ID string `json:"id"`
	// Project : Project to which the subscription belongs
	Project *Project `json:"project"`
	// Customer : Customer linked to the subscription
	Customer *Customer `json:"customer"`
	// Token : Token linked to the subscription, once started
	Token *Token `json:"token"`
	// URL : URL to which you may redirect your customer to authorize the subscription
	URL string `json:"url"`
	// Name : Name of the subscription
	Name string `json:"name"`
	// Amount : Amount of the subscription
	Amount string `json:"amount"`
	// Currency : Currency of the subscription
	Currency string `json:"currency"`
	// Metadata : Metadata related to the subscription, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// ReturnURL : URL where the customer will be redirected when he activates the subscription
	ReturnURL string `json:"return_url"`
	// CancelURL : URL where the customer will be redirected when he canceles the subscription
	CancelURL string `json:"cancel_url"`
	// Interval : The subscription interval, formatted in the format "1d2w3m4y" (day, week, month, year)
	Interval string `json:"interval"`
	// TrialPeriod : The trial period. The customer will not be charged during this time span. Formatted in the format "1d2w3m4y" (day, week, month, year)
	TrialPeriod string `json:"trial_period"`
	// Activated : Weither or not the subscription is active
	Activated bool `json:"activated"`
	// Ended : Weither or not the subscription has ended (programmatically or canceled)
	Ended bool `json:"ended"`
	// EndedReason : Reason as to why the subscription ended
	EndedReason string `json:"ended_reason"`
	// Sandbox : Define whether or not the authorization is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the invoice was created
	CreatedAt time.Time `json:"created_at"`
}

type Subscriptions

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

Subscriptions manages the Subscription struct

func (Subscriptions) Activate

func (s Subscriptions) Activate(subscription *Subscription, source string, options ...Options) (*Subscription, *CustomerAction, *Error)

Activate : Activate the subscription using the provided source.

func (Subscriptions) All added in v2.5.0

func (s Subscriptions) All(options ...Options) ([]*Subscription, *Error)

All : Get all the subscriptions.

func (Subscriptions) Create

func (s Subscriptions) Create(subscription *Subscription, customerID string, options ...Options) (*Subscription, *CustomerAction, *Error)

Create : Create a new subscription for the given customer.

func (Subscriptions) Customer

func (s Subscriptions) Customer(subscription *Subscription, options ...Options) (*Customer, *Error)

Customer : Get the customer owning the subscription.

func (Subscriptions) End

func (s Subscriptions) End(subscription *Subscription, reason string, options ...Options) *Error

End : End a subscription. The reason may be provided as well.

func (Subscriptions) Find

func (s Subscriptions) Find(subscriptionID string, options ...Options) (*Subscription, *Error)

Find : Find a subscription by its ID.

func (Subscriptions) Invoice

func (s Subscriptions) Invoice(subscription *Subscription, options ...Options) (*Invoice, *Error)

Invoice : Get the invoice corresponding to the last iteration of the subscription.

func (Subscriptions) Transactions added in v2.6.0

func (s Subscriptions) Transactions(subscription *Subscription, options ...Options) ([]*Transaction, *Error)

Transactions : Get the subscriptions past transactions.

func (Subscriptions) Update added in v2.4.2

func (s Subscriptions) Update(subscription *Subscription, options ...Options) (*Subscription, *CustomerAction, *Error)

Update : Update the subscription.

func (Subscriptions) UpdateSource added in v2.7.0

func (s Subscriptions) UpdateSource(subscription *Subscription, source string, options ...Options) (*Subscription, *CustomerAction, *Error)

UpdateSource : Update the subscription source.

type Token

type Token struct {
	// ID : ID of the customer token
	ID string `json:"id"`
	// Customer : Customer linked to the token
	Customer *Customer `json:"customer"`
	// CustomerID : ID of the customer token
	CustomerID string `json:"customer_id"`
	// Metadata : Metadata related to the token, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// IsSubscriptionOnly : Define whether or not the customer token is used on a recurring invoice
	IsSubscriptionOnly bool `json:"is_subscription_only"`
	// CreatedAt : Date at which the customer token was created
	CreatedAt time.Time `json:"created_at"`
}

type Tokens

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

Tokens manages the Token struct

func (Tokens) Create

func (s Tokens) Create(token *Token, customerID, source string, options ...Options) (*Token, *Error)

Create : Create a new token for the given customer ID.

func (Tokens) CreateFromRequest added in v2.7.0

func (s Tokens) CreateFromRequest(token *Token, customerID, target, source string, options ...Options) (*Token, *CustomerAction, *Error)

CreateFromRequest : Create a new token for the given customer ID from an authorization request.

func (Tokens) Find

func (s Tokens) Find(customerID, tokenID string, options ...Options) (*Token, *CustomerAction, *Error)

Find : Find a customer's token by its ID.

type Transaction

type Transaction struct {
	// ID : ID of the transaction
	ID string `json:"id"`
	// Name : Name of the transaction
	Name string `json:"name"`
	// AuthorizedAmount : Amount that was successfully authorized on the transaction
	AuthorizedAmount string `json:"authorized_amount"`
	// CapturedAmount : Amount that was successfully captured on the transaction
	CapturedAmount string `json:"captured_amount"`
	// Currency : Currency of the transaction
	Currency string `json:"currency"`
	// Status : Status of the transaction
	Status string `json:"status"`
	// Authorized : Whether the transaction was authorized or not
	Authorized bool `json:"authorized"`
	// Captured : Whether the transaction was captured or not
	Captured bool `json:"captured"`
	// ProcessoutFee : ProcessOut fee applied on the transaction
	ProcessoutFee string `json:"processout_fee"`
	// Metadata : Metadata related to the transaction, in the form of a dictionary (key-value pair)
	Metadata map[string]string `json:"metadata"`
	// Sandbox : Define whether or not the transaction is in sandbox environment
	Sandbox bool `json:"sandbox"`
	// CreatedAt : Date at which the transaction was created
	CreatedAt time.Time `json:"created_at"`
}

type Transactions

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

Transactions manages the Transaction struct

func (Transactions) All

func (s Transactions) All(options ...Options) ([]*Transaction, *Error)

All : Get all the transactions.

func (Transactions) Find

func (s Transactions) Find(transactionID string, options ...Options) (*Transaction, *Error)

Find : Find a transaction by its ID.

func (Transactions) Refunds

func (s Transactions) Refunds(transaction *Transaction, options ...Options) ([]*Refund, *Error)

Refunds : Get the transaction's refunds.

type Webhook

type Webhook struct {
	// ID : ID of the recurring invoice
	ID string `json:"id"`
	// Event : Event the webhook is linked to
	Event *Event `json:"event"`
	// RequestURL : URL to which the webhook will be posted
	RequestURL string `json:"request_url"`
	// RequestMethod : Method used to send the webhook (GET or POST)
	RequestMethod string `json:"request_method"`
	// ResponseBody : The response body the webhook received when sending its payload
	ResponseBody string `json:"response_body"`
	// ResponseCode : The response code the webhook received when sending its payload
	ResponseCode string `json:"response_code"`
	// ResponseHeaders : The response headers the webhook received when sending its payload
	ResponseHeaders string `json:"response_headers"`
	// ResponseTimeMs : The time it took for the webhook to send its payload
	ResponseTimeMs int `json:"response_time_ms"`
	// Status : The status of the webhook. 0: pending, 1: success, 2: error
	Status int `json:"status"`
	// CreatedAt : Date at which the webhook was created
	CreatedAt time.Time `json:"created_at"`
	// ReleaseAt : Date at webhook will be/is released
	ReleaseAt time.Time `json:"release_at"`
}

type Webhooks

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

Webhooks manages the Webhook struct

Jump to

Keyboard shortcuts

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