processout

package module
v4.20.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 11 Imported by: 0

README

ProcessOut Go

GoDoc

Installation

go get gopkg.in/processout.v4

Versioning

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

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.NewInvoice(&processout.Invoice{
	Name:     "Test item",
	Amount:   "10.00",
	Currency: "USD",
 }).Create()
 if err != nil {
	panic(err)
 }
 fmt.Println(iv.URL)

Index

Constants

This section is empty.

Variables

View Source
var (
	// RequestAPIVersion is the default version of the API used in requests
	// made with this package
	RequestAPIVersion = "1.4.0.0"
	// Host is the URL where API requests are made
	Host = "https://api.processout.com"

	// DefaultClient sets the HTTP default client used for ProcessOut clients
	DefaultClient = &http.Client{
		Timeout: time.Second * 95,
	}
)

Functions

func Bool

func Bool(b bool) *bool

Bool returns the pointer to the bool value

func Float64

func Float64(f float64) *float64

Float64 returns the pointer to the float value

func Int64

func Int64(i int64) *int64

Int64 returns the pointer to the integer value

func String

func String(s string) *string

String returns the pointer to the string value

func Time

func Time(t time.Time) *time.Time

Time returns the pointer to the time value

func ToBool

func ToBool(b *bool) bool

ToBool returns the value of the bool pointer, or false

func ToFloat64

func ToFloat64(f *float64) float64

ToFloat64 returns the value of the float64 pointer, or 0

func ToInt64

func ToInt64(i *int64) int64

ToInt64 returns the value of the int64 pointer, or 0

func ToString

func ToString(s *string) string

ToString returns the value of the string pointer, or an empty string

func ToTime

func ToTime(t *time.Time) time.Time

ToTime returns the value of the time pointer, or an empty time.Time struct

Types

type APIRequest

type APIRequest struct {
	// ID is the iD of the API request
	ID *string `json:"id,omitempty"`
	// Project is the project used to send the API request
	Project *Project `json:"project,omitempty"`
	// APIVersion is the aPI version used to process the request
	APIVersion *APIVersion `json:"api_version,omitempty"`
	// IdempotencyKey is the idempotency key used to identify the request
	IdempotencyKey *string `json:"idempotency_key,omitempty"`
	// URL is the uRL called
	URL *string `json:"url,omitempty"`
	// Method is the hTTP verb used in the request (GET, POST etc)
	Method *string `json:"method,omitempty"`
	// Headers is the headers sent with the request (client to server)
	Headers *map[string]string `json:"headers,omitempty"`
	// Body is the body of the request (client to server)
	Body *string `json:"body,omitempty"`
	// ResponseCode is the response code (such as 200 for a successful request)
	ResponseCode *int `json:"response_code,omitempty"`
	// ResponseHeaders is the headers sent in the response (server to client)
	ResponseHeaders *map[string]string `json:"response_headers,omitempty"`
	// ResponseBody is the body of the response (client to server)
	ResponseBody *string `json:"response_body,omitempty"`
	// ResponseMs is the number of milliseconds needed to process the request
	ResponseMs *float64 `json:"response_ms,omitempty"`
	// Sandbox is the define whether or not the API request was made in the sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the API request was made
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

APIRequest represents the APIRequest API object

func (APIRequest) All

func (s APIRequest) All(options ...APIRequestAllParameters) (*Iterator, error)

All allows you to get all the API requests.

func (APIRequest) Find

func (s APIRequest) Find(APIRequestID string, options ...APIRequestFindParameters) (*APIRequest, error)

Find allows you to find an API request by its ID.

func (*APIRequest) GetID

func (s *APIRequest) GetID() string

GetID implements the Identiable interface

func (*APIRequest) Prefill

func (s *APIRequest) Prefill(c *APIRequest) *APIRequest

Prefil prefills the object with data provided in the parameter

func (*APIRequest) SetClient

func (s *APIRequest) SetClient(c *ProcessOut) *APIRequest

SetClient sets the client for the APIRequest object and its children

type APIRequestAllParameters

type APIRequestAllParameters struct {
	*Options
	*APIRequest
}

APIRequestAllParameters is the structure representing the additional parameters used to call APIRequest.All

type APIRequestFindParameters

type APIRequestFindParameters struct {
	*Options
	*APIRequest
}

APIRequestFindParameters is the structure representing the additional parameters used to call APIRequest.Find

type APIVersion

type APIVersion struct {
	// Name is the name used to identify the API version
	Name *string `json:"name,omitempty"`
	// Description is the description of the API version. Can contain a changelog
	Description *string `json:"description,omitempty"`
	// CreatedAt is the date at which the API version was released
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

APIVersion represents the APIVersion API object

func (*APIVersion) Prefill

func (s *APIVersion) Prefill(c *APIVersion) *APIVersion

Prefil prefills the object with data provided in the parameter

func (*APIVersion) SetClient

func (s *APIVersion) SetClient(c *ProcessOut) *APIVersion

SetClient sets the client for the APIVersion object and its children

type Activity added in v1.3.0

type Activity struct {
	// ID is the iD of the activity
	ID *string `json:"id,omitempty"`
	// Project is the project to which the activity belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the activity belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Title is the title of the activity
	Title *string `json:"title,omitempty"`
	// Content is the content of the activity
	Content *string `json:"content,omitempty"`
	// Level is the level of the activity
	Level *int `json:"level,omitempty"`
	// CreatedAt is the date at which the transaction was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Activity represents the Activity API object

func (Activity) All

func (s Activity) All(options ...ActivityAllParameters) (*Iterator, error)

All allows you to get all the project activities.

func (Activity) Find

func (s Activity) Find(activityID string, options ...ActivityFindParameters) (*Activity, error)

Find allows you to find a specific activity and fetch its data.

func (*Activity) GetID

func (s *Activity) GetID() string

GetID implements the Identiable interface

func (*Activity) Prefill

func (s *Activity) Prefill(c *Activity) *Activity

Prefil prefills the object with data provided in the parameter

func (*Activity) SetClient

func (s *Activity) SetClient(c *ProcessOut) *Activity

SetClient sets the client for the Activity object and its children

type ActivityAllParameters

type ActivityAllParameters struct {
	*Options
	*Activity
}

ActivityAllParameters is the structure representing the additional parameters used to call Activity.All

type ActivityFindParameters

type ActivityFindParameters struct {
	*Options
	*Activity
}

ActivityFindParameters is the structure representing the additional parameters used to call Activity.Find

type Addon

type Addon struct {
	// ID is the iD of the addon
	ID *string `json:"id,omitempty"`
	// Project is the project to which the addon belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the addon belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Subscription is the subscription to which the addon belongs
	Subscription *Subscription `json:"subscription,omitempty"`
	// SubscriptionID is the iD of the subscription to which the addon belongs
	SubscriptionID *string `json:"subscription_id,omitempty"`
	// Plan is the plan used to create the addon, if any
	Plan *Plan `json:"plan,omitempty"`
	// PlanID is the iD of the plan used to create the addon, if any
	PlanID *string `json:"plan_id,omitempty"`
	// Type is the type of the addon. Can be either metered or recurring
	Type *string `json:"type,omitempty"`
	// Name is the name of the addon
	Name *string `json:"name,omitempty"`
	// Amount is the amount of the addon
	Amount *string `json:"amount,omitempty"`
	// Quantity is the quantity of the addon
	Quantity *int `json:"quantity,omitempty"`
	// Metadata is the metadata related to the addon, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Sandbox is the define whether or not the addon is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the addon was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Addon represents the Addon API object

func (Addon) Create

func (s Addon) Create(options ...AddonCreateParameters) (*Addon, error)

Create allows you to create a new addon to the given subscription ID.

func (Addon) Delete

func (s Addon) Delete(options ...AddonDeleteParameters) error

Delete allows you to delete an addon applied to a subscription.

func (Addon) FetchSubscriptionAddons

func (s Addon) FetchSubscriptionAddons(subscriptionID string, options ...AddonFetchSubscriptionAddonsParameters) (*Iterator, error)

FetchSubscriptionAddons allows you to get the addons applied to the subscription.

func (Addon) Find

func (s Addon) Find(subscriptionID, addonID string, options ...AddonFindParameters) (*Addon, error)

Find allows you to find a subscription's addon by its ID.

func (*Addon) GetID

func (s *Addon) GetID() string

GetID implements the Identiable interface

func (*Addon) Prefill

func (s *Addon) Prefill(c *Addon) *Addon

Prefil prefills the object with data provided in the parameter

func (Addon) Save

func (s Addon) Save(options ...AddonSaveParameters) (*Addon, error)

Save allows you to save the updated addon attributes.

func (*Addon) SetClient

func (s *Addon) SetClient(c *ProcessOut) *Addon

SetClient sets the client for the Addon object and its children

type AddonCreateParameters

type AddonCreateParameters struct {
	*Options
	*Addon
	Prorate       interface{} `json:"prorate"`
	ProrationDate interface{} `json:"proration_date"`
	Preview       interface{} `json:"preview"`
}

AddonCreateParameters is the structure representing the additional parameters used to call Addon.Create

type AddonDeleteParameters

type AddonDeleteParameters struct {
	*Options
	*Addon
	Prorate       interface{} `json:"prorate"`
	ProrationDate interface{} `json:"proration_date"`
	Preview       interface{} `json:"preview"`
}

AddonDeleteParameters is the structure representing the additional parameters used to call Addon.Delete

type AddonFetchSubscriptionAddonsParameters

type AddonFetchSubscriptionAddonsParameters struct {
	*Options
	*Addon
}

AddonFetchSubscriptionAddonsParameters is the structure representing the additional parameters used to call Addon.FetchSubscriptionAddons

type AddonFindParameters

type AddonFindParameters struct {
	*Options
	*Addon
}

AddonFindParameters is the structure representing the additional parameters used to call Addon.Find

type AddonSaveParameters

type AddonSaveParameters struct {
	*Options
	*Addon
	Prorate             interface{} `json:"prorate"`
	ProrationDate       interface{} `json:"proration_date"`
	Preview             interface{} `json:"preview"`
	IncrementQuantityBy interface{} `json:"increment_quantity_by"`
}

AddonSaveParameters is the structure representing the additional parameters used to call Addon.Save

type Card

type Card struct {
	// ID is the iD of the card
	ID *string `json:"id,omitempty"`
	// Project is the project to which the card belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the card belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Token is the token linked to the card, which can be used to process payments
	Token *Token `json:"token,omitempty"`
	// Scheme is the scheme of the card, such as visa or mastercard
	Scheme *string `json:"scheme,omitempty"`
	// CoScheme is the co-scheme of the card, such as carte bancaire
	CoScheme *string `json:"co_scheme,omitempty"`
	// PreferredScheme is the customer preferred scheme, such as carte bancaire vs visa
	PreferredScheme *string `json:"preferred_scheme,omitempty"`
	// Type is the type of the card (Credit, Debit, ...)
	Type *string `json:"type,omitempty"`
	// BankName is the name of the bank of the card
	BankName *string `json:"bank_name,omitempty"`
	// Brand is the level of the card (Electron, Classic, Gold, ...)
	Brand *string `json:"brand,omitempty"`
	// Iin is the first 6 digits of the card
	Iin *string `json:"iin,omitempty"`
	// Last4Digits is the last 4 digits of the card
	Last4Digits *string `json:"last_4_digits,omitempty"`
	// ExpMonth is the expiry month
	ExpMonth *int `json:"exp_month,omitempty"`
	// ExpYear is the expiry year, in a 4 digits format
	ExpYear *int `json:"exp_year,omitempty"`
	// CvcCheck is the status of the CVC check initially made on the card when the CVC was provided
	CvcCheck *string `json:"cvc_check,omitempty"`
	// AvsCheck is the status of the AVS check initially made on the card when the AVS was provided
	AvsCheck *string `json:"avs_check,omitempty"`
	// Name is the name of the card holder
	Name *string `json:"name,omitempty"`
	// Address1 is the address line of the card holder
	Address1 *string `json:"address1,omitempty"`
	// Address2 is the secondary address line of the card holder
	Address2 *string `json:"address2,omitempty"`
	// City is the city of the card holder
	City *string `json:"city,omitempty"`
	// State is the state of the card holder
	State *string `json:"state,omitempty"`
	// Zip is the zIP code of the card holder
	Zip *string `json:"zip,omitempty"`
	// CountryCode is the country code of the card holder (ISO-3166, 2 characters format)
	CountryCode *string `json:"country_code,omitempty"`
	// IpAddress is the iP address of the card (IPv4 or IPv6)
	IpAddress *string `json:"ip_address,omitempty"`
	// Fingerprint is the fingerprint of the card (stays the same if the same card gets tokenized multiple times). Scoped per ProcessOut project
	Fingerprint *string `json:"fingerprint,omitempty"`
	// Metadata is the metadata related to the card, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// ExpiresSoon is the contains true if the card will expire soon, false otherwise
	ExpiresSoon *bool `json:"expires_soon,omitempty"`
	// Sandbox is the define whether or not the card is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the card was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Card represents the Card API object

func (Card) All

func (s Card) All(options ...CardAllParameters) (*Iterator, error)

All allows you to get all the cards.

func (Card) Anonymize

func (s Card) Anonymize(options ...CardAnonymizeParameters) error

Anonymize allows you to anonymize the card.

func (Card) Find

func (s Card) Find(cardID string, options ...CardFindParameters) (*Card, error)

Find allows you to find a card by its ID.

func (*Card) GetID

func (s *Card) GetID() string

GetID implements the Identiable interface

func (*Card) Prefill

func (s *Card) Prefill(c *Card) *Card

Prefil prefills the object with data provided in the parameter

func (*Card) SetClient

func (s *Card) SetClient(c *ProcessOut) *Card

SetClient sets the client for the Card object and its children

type CardAllParameters

type CardAllParameters struct {
	*Options
	*Card
}

CardAllParameters is the structure representing the additional parameters used to call Card.All

type CardAnonymizeParameters

type CardAnonymizeParameters struct {
	*Options
	*Card
}

CardAnonymizeParameters is the structure representing the additional parameters used to call Card.Anonymize

type CardFindParameters

type CardFindParameters struct {
	*Options
	*Card
}

CardFindParameters is the structure representing the additional parameters used to call Card.Find

type CardInformation

type CardInformation struct {
	// Iin is the first 6 digits of the card
	Iin *string `json:"iin,omitempty"`
	// Scheme is the scheme of the card, such as visa or mastercard
	Scheme *string `json:"scheme,omitempty"`
	// Type is the type of the card (Credit, Debit, ...)
	Type *string `json:"type,omitempty"`
	// BankName is the name of the bank of the card
	BankName *string `json:"bank_name,omitempty"`
	// Brand is the level of the card (Electron, Classic, Gold, ...)
	Brand *string `json:"brand,omitempty"`
	// Category is the category of the card (consumer, commercial, ...)
	Category *string `json:"category,omitempty"`
	// Country is the country that issued the card
	Country *string `json:"country,omitempty"`
	// contains filtered or unexported fields
}

CardInformation represents the CardInformation API object

func (CardInformation) Fetch

Fetch allows you to fetch card information from the IIN.

func (*CardInformation) Prefill

Prefil prefills the object with data provided in the parameter

func (*CardInformation) SetClient

func (s *CardInformation) SetClient(c *ProcessOut) *CardInformation

SetClient sets the client for the CardInformation object and its children

type CardInformationFetchParameters

type CardInformationFetchParameters struct {
	*Options
	*CardInformation
}

CardInformationFetchParameters is the structure representing the additional parameters used to call CardInformation.Fetch

type Coupon

type Coupon struct {
	// ID is the iD of the coupon
	ID *string `json:"id,omitempty"`
	// Project is the project to which the coupon belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the coupon belongs
	ProjectID *string `json:"project_id,omitempty"`
	// AmountOff is the amount to be removed from the subscription price
	AmountOff *string `json:"amount_off,omitempty"`
	// PercentOff is the percent of the subscription amount to be removed (integer between 0 and 100)
	PercentOff *int `json:"percent_off,omitempty"`
	// Currency is the currency of the coupon amount_off
	Currency *string `json:"currency,omitempty"`
	// IterationCount is the number billing cycles the coupon will last when applied to a subscription. If 0, will last forever
	IterationCount *int `json:"iteration_count,omitempty"`
	// MaxRedemptions is the number of time the coupon can be redeemed. If 0, there's no limit
	MaxRedemptions *int `json:"max_redemptions,omitempty"`
	// ExpiresAt is the date at which the coupon will expire
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// Metadata is the metadata related to the coupon, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// RedeemedNumber is the number of times the coupon was already redeemed
	RedeemedNumber *int `json:"redeemed_number,omitempty"`
	// Sandbox is the true if the coupon was created in the sandbox environment, false otherwise
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the coupon was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Coupon represents the Coupon API object

func (Coupon) All

func (s Coupon) All(options ...CouponAllParameters) (*Iterator, error)

All allows you to get all the coupons.

func (Coupon) Create

func (s Coupon) Create(options ...CouponCreateParameters) (*Coupon, error)

Create allows you to create a new coupon.

func (Coupon) Delete

func (s Coupon) Delete(options ...CouponDeleteParameters) error

Delete allows you to delete the coupon.

func (Coupon) Find

func (s Coupon) Find(couponID string, options ...CouponFindParameters) (*Coupon, error)

Find allows you to find a coupon by its ID.

func (*Coupon) GetID

func (s *Coupon) GetID() string

GetID implements the Identiable interface

func (*Coupon) Prefill

func (s *Coupon) Prefill(c *Coupon) *Coupon

Prefil prefills the object with data provided in the parameter

func (Coupon) Save

func (s Coupon) Save(options ...CouponSaveParameters) (*Coupon, error)

Save allows you to save the updated coupon attributes.

func (*Coupon) SetClient

func (s *Coupon) SetClient(c *ProcessOut) *Coupon

SetClient sets the client for the Coupon object and its children

type CouponAllParameters

type CouponAllParameters struct {
	*Options
	*Coupon
}

CouponAllParameters is the structure representing the additional parameters used to call Coupon.All

type CouponCreateParameters

type CouponCreateParameters struct {
	*Options
	*Coupon
}

CouponCreateParameters is the structure representing the additional parameters used to call Coupon.Create

type CouponDeleteParameters

type CouponDeleteParameters struct {
	*Options
	*Coupon
}

CouponDeleteParameters is the structure representing the additional parameters used to call Coupon.Delete

type CouponFindParameters

type CouponFindParameters struct {
	*Options
	*Coupon
}

CouponFindParameters is the structure representing the additional parameters used to call Coupon.Find

type CouponSaveParameters

type CouponSaveParameters struct {
	*Options
	*Coupon
}

CouponSaveParameters is the structure representing the additional parameters used to call Coupon.Save

type Customer

type Customer struct {
	// ID is the iD of the customer
	ID *string `json:"id,omitempty"`
	// Project is the project to which the customer belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the customer belongs
	ProjectID *string `json:"project_id,omitempty"`
	// DefaultToken is the default token of the customer
	DefaultToken *Token `json:"default_token,omitempty"`
	// DefaultTokenID is the iD of the default token of the customer
	DefaultTokenID *string `json:"default_token_id,omitempty"`
	// Tokens is the list of the customer tokens
	Tokens *[]*Token `json:"tokens,omitempty"`
	// Subscriptions is the list of the customer subscriptions
	Subscriptions *[]*Subscription `json:"subscriptions,omitempty"`
	// Transactions is the list of the customer transactions
	Transactions *[]*Transaction `json:"transactions,omitempty"`
	// Balance is the customer balance. Can be positive or negative
	Balance *string `json:"balance,omitempty"`
	// Currency is the currency of the customer balance. Once the currency is set it cannot be modified
	Currency *string `json:"currency,omitempty"`
	// Email is the email of the customer
	Email *string `json:"email,omitempty"`
	// FirstName is the first name of the customer
	FirstName *string `json:"first_name,omitempty"`
	// LastName is the last name of the customer
	LastName *string `json:"last_name,omitempty"`
	// Address1 is the address of the customer
	Address1 *string `json:"address1,omitempty"`
	// Address2 is the secondary address of the customer
	Address2 *string `json:"address2,omitempty"`
	// City is the city of the customer
	City *string `json:"city,omitempty"`
	// State is the state of the customer
	State *string `json:"state,omitempty"`
	// Zip is the zIP code of the customer
	Zip *string `json:"zip,omitempty"`
	// CountryCode is the country code of the customer (ISO-3166, 2 characters format)
	CountryCode *string `json:"country_code,omitempty"`
	// IpAddress is the iP address of the customer (IPv4 or IPv6)
	IpAddress *string `json:"ip_address,omitempty"`
	// PhoneNumber is the phone number of the customer
	PhoneNumber *string `json:"phone_number,omitempty"`
	// LegalDocument is the legal document number
	LegalDocument *string `json:"legal_document,omitempty"`
	// Sex is the sex of the customer
	Sex *string `json:"sex,omitempty"`
	// IsBusiness is the define whether or not the customer is a business
	IsBusiness *bool `json:"is_business,omitempty"`
	// Metadata is the metadata related to the customer, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Sandbox is the define whether or not the customer is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the customer was created at ProcessOut
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// RegisteredAt is the date at which the customer was registered on your platform
	RegisteredAt *time.Time `json:"registered_at,omitempty"`
	// contains filtered or unexported fields
}

Customer represents the Customer API object

func (Customer) All

func (s Customer) All(options ...CustomerAllParameters) (*Iterator, error)

All allows you to get all the customers.

func (Customer) Create

func (s Customer) Create(options ...CustomerCreateParameters) (*Customer, error)

Create allows you to create a new customer.

func (Customer) Delete

func (s Customer) Delete(options ...CustomerDeleteParameters) error

Delete allows you to delete the customer.

func (Customer) DeleteToken

func (s Customer) DeleteToken(tokenID string, options ...CustomerDeleteTokenParameters) error

DeleteToken allows you to delete a customer's token by its ID.

func (Customer) FetchSubscriptions

func (s Customer) FetchSubscriptions(options ...CustomerFetchSubscriptionsParameters) (*Iterator, error)

FetchSubscriptions allows you to get the subscriptions belonging to the customer.

func (Customer) FetchTokens

func (s Customer) FetchTokens(options ...CustomerFetchTokensParameters) (*Iterator, error)

FetchTokens allows you to get the customer's tokens.

func (Customer) FetchTransactions

func (s Customer) FetchTransactions(options ...CustomerFetchTransactionsParameters) (*Iterator, error)

FetchTransactions allows you to get the transactions belonging to the customer.

func (Customer) Find

func (s Customer) Find(customerID string, options ...CustomerFindParameters) (*Customer, error)

Find allows you to find a customer by its ID.

func (Customer) FindToken

func (s Customer) FindToken(tokenID string, options ...CustomerFindTokenParameters) (*Token, error)

FindToken allows you to find a customer's token by its ID.

func (*Customer) GetID

func (s *Customer) GetID() string

GetID implements the Identiable interface

func (*Customer) Prefill

func (s *Customer) Prefill(c *Customer) *Customer

Prefil prefills the object with data provided in the parameter

func (Customer) Save

func (s Customer) Save(options ...CustomerSaveParameters) (*Customer, error)

Save allows you to save the updated customer attributes.

func (*Customer) SetClient

func (s *Customer) SetClient(c *ProcessOut) *Customer

SetClient sets the client for the Customer object and its children

type CustomerAction

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

CustomerAction represents the CustomerAction API object

func (*CustomerAction) Prefill

Prefil prefills the object with data provided in the parameter

func (*CustomerAction) SetClient

func (s *CustomerAction) SetClient(c *ProcessOut) *CustomerAction

SetClient sets the client for the CustomerAction object and its children

type CustomerAllParameters

type CustomerAllParameters struct {
	*Options
	*Customer
}

CustomerAllParameters is the structure representing the additional parameters used to call Customer.All

type CustomerCreateParameters

type CustomerCreateParameters struct {
	*Options
	*Customer
}

CustomerCreateParameters is the structure representing the additional parameters used to call Customer.Create

type CustomerDeleteParameters

type CustomerDeleteParameters struct {
	*Options
	*Customer
}

CustomerDeleteParameters is the structure representing the additional parameters used to call Customer.Delete

type CustomerDeleteTokenParameters

type CustomerDeleteTokenParameters struct {
	*Options
	*Customer
}

CustomerDeleteTokenParameters is the structure representing the additional parameters used to call Customer.DeleteToken

type CustomerFetchSubscriptionsParameters

type CustomerFetchSubscriptionsParameters struct {
	*Options
	*Customer
}

CustomerFetchSubscriptionsParameters is the structure representing the additional parameters used to call Customer.FetchSubscriptions

type CustomerFetchTokensParameters

type CustomerFetchTokensParameters struct {
	*Options
	*Customer
}

CustomerFetchTokensParameters is the structure representing the additional parameters used to call Customer.FetchTokens

type CustomerFetchTransactionsParameters

type CustomerFetchTransactionsParameters struct {
	*Options
	*Customer
}

CustomerFetchTransactionsParameters is the structure representing the additional parameters used to call Customer.FetchTransactions

type CustomerFindParameters

type CustomerFindParameters struct {
	*Options
	*Customer
}

CustomerFindParameters is the structure representing the additional parameters used to call Customer.Find

type CustomerFindTokenParameters

type CustomerFindTokenParameters struct {
	*Options
	*Customer
}

CustomerFindTokenParameters is the structure representing the additional parameters used to call Customer.FindToken

type CustomerSaveParameters

type CustomerSaveParameters struct {
	*Options
	*Customer
}

CustomerSaveParameters is the structure representing the additional parameters used to call Customer.Save

type Discount

type Discount struct {
	// ID is the iD of the discount
	ID *string `json:"id,omitempty"`
	// Project is the project to which the discount belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the discount belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Subscription is the subscription to which the discount belongs
	Subscription *Subscription `json:"subscription,omitempty"`
	// SubscriptionID is the iD of the subscription to which the addon belongs
	SubscriptionID *string `json:"subscription_id,omitempty"`
	// Coupon is the coupon used to create the discount, if any
	Coupon *Coupon `json:"coupon,omitempty"`
	// CouponID is the iD of the coupon used to create the discount, if any
	CouponID *string `json:"coupon_id,omitempty"`
	// Name is the name of the discount
	Name *string `json:"name,omitempty"`
	// Amount is the amount discounted
	Amount *string `json:"amount,omitempty"`
	// Percent is the percentage discounted
	Percent *int `json:"percent,omitempty"`
	// ExpiresAt is the date at which the discount will expire
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// Metadata is the metadata related to the discount, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Sandbox is the define whether or not the discount is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the discount was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Discount represents the Discount API object

func (Discount) Create

func (s Discount) Create(options ...DiscountCreateParameters) (*Discount, error)

Create allows you to create a new discount for the given subscription ID.

func (Discount) Delete

func (s Discount) Delete(options ...DiscountDeleteParameters) error

Delete allows you to delete a discount applied to a subscription.

func (Discount) FetchSubscriptionDiscounts

func (s Discount) FetchSubscriptionDiscounts(subscriptionID string, options ...DiscountFetchSubscriptionDiscountsParameters) (*Iterator, error)

FetchSubscriptionDiscounts allows you to get the discounts applied to the subscription.

func (Discount) Find

func (s Discount) Find(subscriptionID, discountID string, options ...DiscountFindParameters) (*Discount, error)

Find allows you to find a subscription's discount by its ID.

func (*Discount) GetID

func (s *Discount) GetID() string

GetID implements the Identiable interface

func (*Discount) Prefill

func (s *Discount) Prefill(c *Discount) *Discount

Prefil prefills the object with data provided in the parameter

func (*Discount) SetClient

func (s *Discount) SetClient(c *ProcessOut) *Discount

SetClient sets the client for the Discount object and its children

type DiscountCreateParameters

type DiscountCreateParameters struct {
	*Options
	*Discount
}

DiscountCreateParameters is the structure representing the additional parameters used to call Discount.Create

type DiscountDeleteParameters

type DiscountDeleteParameters struct {
	*Options
	*Discount
}

DiscountDeleteParameters is the structure representing the additional parameters used to call Discount.Delete

type DiscountFetchSubscriptionDiscountsParameters

type DiscountFetchSubscriptionDiscountsParameters struct {
	*Options
	*Discount
}

DiscountFetchSubscriptionDiscountsParameters is the structure representing the additional parameters used to call Discount.FetchSubscriptionDiscounts

type DiscountFindParameters

type DiscountFindParameters struct {
	*Options
	*Discount
}

DiscountFindParameters is the structure representing the additional parameters used to call Discount.Find

type DunningAction

type DunningAction struct {
	// Action is the dunning action. Can be either retry, cancel, set_past_due or leave_unchanged
	Action *string `json:"action,omitempty"`
	// DelayInDays is the delay in days that should be waited before executing the next dunning action
	DelayInDays *int `json:"delay_in_days,omitempty"`
	// contains filtered or unexported fields
}

DunningAction represents the DunningAction API object

func (*DunningAction) Prefill

func (s *DunningAction) Prefill(c *DunningAction) *DunningAction

Prefil prefills the object with data provided in the parameter

func (*DunningAction) SetClient

func (s *DunningAction) SetClient(c *ProcessOut) *DunningAction

SetClient sets the client for the DunningAction object and its children

type Event

type Event struct {
	// ID is the iD of the event
	ID *string `json:"id,omitempty"`
	// Project is the project to which the event belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the event belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Name is the name of the event
	Name *string `json:"name,omitempty"`
	// Data is the data object associated to the event
	Data interface{} `json:"data,omitempty"`
	// Sandbox is the define whether or not the event is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// FiredAt is the date at which the event was fired
	FiredAt *time.Time `json:"fired_at,omitempty"`
	// contains filtered or unexported fields
}

Event represents the Event API object

func (Event) All

func (s Event) All(options ...EventAllParameters) (*Iterator, error)

All allows you to get all the events.

func (Event) FetchWebhooks

func (s Event) FetchWebhooks(options ...EventFetchWebhooksParameters) (*Iterator, error)

FetchWebhooks allows you to get all the webhooks of the event.

func (Event) Find

func (s Event) Find(eventID string, options ...EventFindParameters) (*Event, error)

Find allows you to find an event by its ID.

func (*Event) GetID

func (s *Event) GetID() string

GetID implements the Identiable interface

func (*Event) Prefill

func (s *Event) Prefill(c *Event) *Event

Prefil prefills the object with data provided in the parameter

func (*Event) SetClient

func (s *Event) SetClient(c *ProcessOut) *Event

SetClient sets the client for the Event object and its children

type EventAllParameters

type EventAllParameters struct {
	*Options
	*Event
}

EventAllParameters is the structure representing the additional parameters used to call Event.All

type EventFetchWebhooksParameters

type EventFetchWebhooksParameters struct {
	*Options
	*Event
}

EventFetchWebhooksParameters is the structure representing the additional parameters used to call Event.FetchWebhooks

type EventFindParameters

type EventFindParameters struct {
	*Options
	*Event
}

EventFindParameters is the structure representing the additional parameters used to call Event.Find

type Gateway

type Gateway struct {
	// ID is the iD of the gateway
	ID *string `json:"id,omitempty"`
	// Name is the name of the payment gateway
	Name *string `json:"name,omitempty"`
	// DisplayName is the name of the payment gateway that can be displayed
	DisplayName *string `json:"display_name,omitempty"`
	// LogoURL is the logo URL of the payment gateway
	LogoURL *string `json:"logo_url,omitempty"`
	// URL is the uRL of the payment gateway
	URL *string `json:"url,omitempty"`
	// Flows is the supported flow by the gateway (one-off, subscription or tokenization)
	Flows *[]string `json:"flows,omitempty"`
	// Tags is the gateway tags. Mainly used to filter gateways depending on their attributes (e-wallets and such)
	Tags *[]string `json:"tags,omitempty"`
	// CanPullTransactions is the true if the gateway can pull old transactions into ProcessOut, false otherwise
	CanPullTransactions *bool `json:"can_pull_transactions,omitempty"`
	// CanRefund is the true if the gateway supports refunds, false otherwise
	CanRefund *bool `json:"can_refund,omitempty"`
	// IsOauthAuthentication is the true if the gateway supports oauth authentication, false otherwise
	IsOauthAuthentication *bool `json:"is_oauth_authentication,omitempty"`
	// Description is the description of the payment gateway
	Description *string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

Gateway represents the Gateway API object

func (Gateway) FetchGatewayConfigurations

func (s Gateway) FetchGatewayConfigurations(options ...GatewayFetchGatewayConfigurationsParameters) (*Iterator, error)

FetchGatewayConfigurations allows you to get all the gateway configurations of the gateway

func (*Gateway) GetID

func (s *Gateway) GetID() string

GetID implements the Identiable interface

func (*Gateway) Prefill

func (s *Gateway) Prefill(c *Gateway) *Gateway

Prefil prefills the object with data provided in the parameter

func (*Gateway) SetClient

func (s *Gateway) SetClient(c *ProcessOut) *Gateway

SetClient sets the client for the Gateway object and its children

type GatewayConfiguration

type GatewayConfiguration struct {
	// ID is the iD of the gateway configuration
	ID *string `json:"id,omitempty"`
	// Project is the project to which the gateway configuration belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the gateway configuration belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Gateway is the gateway that the configuration configures
	Gateway *Gateway `json:"gateway,omitempty"`
	// GatewayID is the iD of the gateway to which the gateway configuration belongs
	GatewayID *int `json:"gateway_id,omitempty"`
	// Name is the name of the gateway configuration
	Name *string `json:"name,omitempty"`
	// DefaultCurrency is the default currency of the gateway configuration
	DefaultCurrency *string `json:"default_currency,omitempty"`
	// Enabled is the define whether or not the gateway configuration is enabled
	Enabled *bool `json:"enabled,omitempty"`
	// PublicKeys is the public keys of the payment gateway configuration (key-value pair)
	PublicKeys *map[string]string `json:"public_keys,omitempty"`
	// CreatedAt is the date at which the gateway configuration was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// EnabledAt is the date at which the gateway configuration was enabled
	EnabledAt *time.Time `json:"enabled_at,omitempty"`
	// contains filtered or unexported fields
}

GatewayConfiguration represents the GatewayConfiguration API object

func (GatewayConfiguration) All

All allows you to get all the gateway configurations.

func (GatewayConfiguration) Create

Create allows you to create a new gateway configuration.

func (GatewayConfiguration) Delete

Delete allows you to delete the gateway configuration.

func (GatewayConfiguration) Find

Find allows you to find a gateway configuration by its ID.

func (*GatewayConfiguration) GetID

func (s *GatewayConfiguration) GetID() string

GetID implements the Identiable interface

func (*GatewayConfiguration) Prefill

Prefil prefills the object with data provided in the parameter

func (GatewayConfiguration) Save

Save allows you to save the updated gateway configuration attributes and settings.

func (*GatewayConfiguration) SetClient

SetClient sets the client for the GatewayConfiguration object and its children

type GatewayConfigurationAllParameters

type GatewayConfigurationAllParameters struct {
	*Options
	*GatewayConfiguration
	ExpandMerchantAccounts interface{} `json:"expand_merchant_accounts"`
}

GatewayConfigurationAllParameters is the structure representing the additional parameters used to call GatewayConfiguration.All

type GatewayConfigurationCreateParameters

type GatewayConfigurationCreateParameters struct {
	*Options
	*GatewayConfiguration
	Settings           interface{} `json:"settings"`
	SubAccountsEnabled interface{} `json:"sub_accounts_enabled"`
}

GatewayConfigurationCreateParameters is the structure representing the additional parameters used to call GatewayConfiguration.Create

type GatewayConfigurationDeleteParameters

type GatewayConfigurationDeleteParameters struct {
	*Options
	*GatewayConfiguration
}

GatewayConfigurationDeleteParameters is the structure representing the additional parameters used to call GatewayConfiguration.Delete

type GatewayConfigurationFindParameters

type GatewayConfigurationFindParameters struct {
	*Options
	*GatewayConfiguration
}

GatewayConfigurationFindParameters is the structure representing the additional parameters used to call GatewayConfiguration.Find

type GatewayConfigurationSaveParameters

type GatewayConfigurationSaveParameters struct {
	*Options
	*GatewayConfiguration
	Settings           interface{} `json:"settings"`
	SubAccountsEnabled interface{} `json:"sub_accounts_enabled"`
}

GatewayConfigurationSaveParameters is the structure representing the additional parameters used to call GatewayConfiguration.Save

type GatewayFetchGatewayConfigurationsParameters

type GatewayFetchGatewayConfigurationsParameters struct {
	*Options
	*Gateway
}

GatewayFetchGatewayConfigurationsParameters is the structure representing the additional parameters used to call Gateway.FetchGatewayConfigurations

type GatewayRequest

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

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

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

func (*GatewayRequest) String

func (gr *GatewayRequest) String() string

String encodes the GatewayRequest to a source readable by ProcessOut

type Identifiable

type Identifiable interface {
	GetID() string
}

Identifiable is the interface used by the Iterator to get the ID of the resources

type Invoice

type Invoice struct {
	// ID is the iD of the invoice
	ID *string `json:"id,omitempty"`
	// Project is the project to which the invoice belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the invoice belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Transaction is the transaction generated by the invoice
	Transaction *Transaction `json:"transaction,omitempty"`
	// TransactionID is the iD of the transaction generated by the invoice
	TransactionID *string `json:"transaction_id,omitempty"`
	// Customer is the customer linked to the invoice, if any
	Customer *Customer `json:"customer,omitempty"`
	// CustomerID is the iD of the customer linked to the invoice, if any
	CustomerID *string `json:"customer_id,omitempty"`
	// Subscription is the subscription to which the invoice is linked to, if any
	Subscription *Subscription `json:"subscription,omitempty"`
	// SubscriptionID is the iD of the subscription to which the invoice is linked to, if any
	SubscriptionID *string `json:"subscription_id,omitempty"`
	// Token is the token used to pay the invoice, if any
	Token *Token `json:"token,omitempty"`
	// TokenID is the iD of the token used to pay the invoice, if any
	TokenID *string `json:"token_id,omitempty"`
	// Details is the details of the invoice
	Details *[]*InvoiceDetail `json:"details,omitempty"`
	// URL is the uRL to which you may redirect your customer to proceed with the payment
	URL *string `json:"url,omitempty"`
	// Name is the name of the invoice
	Name *string `json:"name,omitempty"`
	// Amount is the amount to be paid
	Amount *string `json:"amount,omitempty"`
	// Currency is the currency of the invoice
	Currency *string `json:"currency,omitempty"`
	// MerchantInitiatorType is the type of the transaction initiated by the merchant (off-session). Can be either one-off or recurring, depending on the nature of the merchant initiated transaction.
	MerchantInitiatorType *string `json:"merchant_initiator_type,omitempty"`
	// StatementDescriptor is the statement to be shown on the bank statement of your customer
	StatementDescriptor *string `json:"statement_descriptor,omitempty"`
	// StatementDescriptorPhone is the support phone number shown on the customer's bank statement
	StatementDescriptorPhone *string `json:"statement_descriptor_phone,omitempty"`
	// StatementDescriptorCity is the city shown on the customer's bank statement
	StatementDescriptorCity *string `json:"statement_descriptor_city,omitempty"`
	// StatementDescriptorCompany is the your company name shown on the customer's bank statement
	StatementDescriptorCompany *string `json:"statement_descriptor_company,omitempty"`
	// StatementDescriptorURL is the uRL shown on the customer's bank statement
	StatementDescriptorURL *string `json:"statement_descriptor_url,omitempty"`
	// Metadata is the metadata related to the invoice, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// GatewayData is the dictionary that transmit specific informations to gateways (key-value pair)
	GatewayData *map[string]string `json:"gateway_data,omitempty"`
	// ReturnURL is the uRL where the customer will be redirected upon payment
	ReturnURL *string `json:"return_url,omitempty"`
	// CancelURL is the uRL where the customer will be redirected if the payment was canceled
	CancelURL *string `json:"cancel_url,omitempty"`
	// WebhookURL is the custom webhook URL where updates about this specific payment will be sent, on top of your project-wide URLs
	WebhookURL *string `json:"webhook_url,omitempty"`
	// RequireBackendCapture is the define whether the invoice can be captured from the front-end or not
	RequireBackendCapture *bool `json:"require_backend_capture,omitempty"`
	// Sandbox is the define whether or not the invoice is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the invoice was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Risk is the risk information
	Risk *InvoiceRisk `json:"risk,omitempty"`
	// Shipping is the shipping information
	Shipping *InvoiceShipping `json:"shipping,omitempty"`
	// Device is the device information
	Device *InvoiceDevice `json:"device,omitempty"`
	// ExternalFraudTools is the contain objects that'll be forwarded to external fraud tools
	ExternalFraudTools *InvoiceExternalFraudTools `json:"external_fraud_tools,omitempty"`
	// contains filtered or unexported fields
}

Invoice represents the Invoice API object

func (Invoice) All

func (s Invoice) All(options ...InvoiceAllParameters) (*Iterator, error)

All allows you to get all the invoices.

func (Invoice) AssignCustomer

func (s Invoice) AssignCustomer(customerID string, options ...InvoiceAssignCustomerParameters) (*Customer, error)

AssignCustomer allows you to assign a customer to the invoice.

func (Invoice) Authorize

func (s Invoice) Authorize(source string, options ...InvoiceAuthorizeParameters) (*Transaction, error)

Authorize allows you to authorize the invoice using the given source (customer or token)

func (Invoice) Capture

func (s Invoice) Capture(source string, options ...InvoiceCaptureParameters) (*Transaction, error)

Capture allows you to capture the invoice using the given source (customer or token)

func (Invoice) Create

func (s Invoice) Create(options ...InvoiceCreateParameters) (*Invoice, error)

Create allows you to create a new invoice.

func (Invoice) FetchCustomer

func (s Invoice) FetchCustomer(options ...InvoiceFetchCustomerParameters) (*Customer, error)

FetchCustomer allows you to get the customer linked to the invoice.

func (Invoice) FetchTransaction

func (s Invoice) FetchTransaction(options ...InvoiceFetchTransactionParameters) (*Transaction, error)

FetchTransaction allows you to get the transaction of the invoice.

func (Invoice) Find

func (s Invoice) Find(invoiceID string, options ...InvoiceFindParameters) (*Invoice, error)

Find allows you to find an invoice by its ID.

func (*Invoice) GetID

func (s *Invoice) GetID() string

GetID implements the Identiable interface

func (Invoice) InitiateThreeDS

func (s Invoice) InitiateThreeDS(source string, options ...InvoiceInitiateThreeDSParameters) (*CustomerAction, error)

InitiateThreeDS allows you to initiate a 3-D Secure authentication

func (*Invoice) Prefill

func (s *Invoice) Prefill(c *Invoice) *Invoice

Prefil prefills the object with data provided in the parameter

func (*Invoice) SetClient

func (s *Invoice) SetClient(c *ProcessOut) *Invoice

SetClient sets the client for the Invoice object and its children

func (Invoice) Void

func (s Invoice) Void(options ...InvoiceVoidParameters) (*Transaction, error)

Void allows you to void the invoice

type InvoiceAllParameters

type InvoiceAllParameters struct {
	*Options
	*Invoice
}

InvoiceAllParameters is the structure representing the additional parameters used to call Invoice.All

type InvoiceAssignCustomerParameters

type InvoiceAssignCustomerParameters struct {
	*Options
	*Invoice
}

InvoiceAssignCustomerParameters is the structure representing the additional parameters used to call Invoice.AssignCustomer

type InvoiceAuthorizeParameters

type InvoiceAuthorizeParameters struct {
	*Options
	*Invoice
	Synchronous             interface{} `json:"synchronous"`
	RetryDropLiabilityShift interface{} `json:"retry_drop_liability_shift"`
	CaptureAmount           interface{} `json:"capture_amount"`
	EnableThreeDS2          interface{} `json:"enable_three_d_s_2"`
	AutoCaptureAt           interface{} `json:"auto_capture_at"`
}

InvoiceAuthorizeParameters is the structure representing the additional parameters used to call Invoice.Authorize

type InvoiceCaptureParameters

type InvoiceCaptureParameters struct {
	*Options
	*Invoice
	AuthorizeOnly           interface{} `json:"authorize_only"`
	Synchronous             interface{} `json:"synchronous"`
	RetryDropLiabilityShift interface{} `json:"retry_drop_liability_shift"`
	CaptureAmount           interface{} `json:"capture_amount"`
	AutoCaptureAt           interface{} `json:"auto_capture_at"`
	EnableThreeDS2          interface{} `json:"enable_three_d_s_2"`
}

InvoiceCaptureParameters is the structure representing the additional parameters used to call Invoice.Capture

type InvoiceCreateParameters

type InvoiceCreateParameters struct {
	*Options
	*Invoice
}

InvoiceCreateParameters is the structure representing the additional parameters used to call Invoice.Create

type InvoiceDetail

type InvoiceDetail struct {
	// Name is the name of the invoice detail
	Name *string `json:"name,omitempty"`
	// Type is the type of the invoice detail. Can be a string containing anything, up to 30 characters
	Type *string `json:"type,omitempty"`
	// Amount is the amount represented by the invoice detail
	Amount *string `json:"amount,omitempty"`
	// Quantity is the quantity of items represented by the invoice detail
	Quantity *int `json:"quantity,omitempty"`
	// Metadata is the metadata related to the invoice detail, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Reference is the reference of the product
	Reference *string `json:"reference,omitempty"`
	// Description is the description of the invoice detail
	Description *string `json:"description,omitempty"`
	// Brand is the brand of the product
	Brand *string `json:"brand,omitempty"`
	// Model is the model of the product
	Model *string `json:"model,omitempty"`
	// DiscountAmount is the discount amount represented by the invoice detail
	DiscountAmount *string `json:"discount_amount,omitempty"`
	// Condition is the condition of the product
	Condition *string `json:"condition,omitempty"`
	// MarketplaceMerchant is the marketplace merchant of the invoice detail
	MarketplaceMerchant *string `json:"marketplace_merchant,omitempty"`
	// MarketplaceMerchantIsBusiness is the define whether or not the marketplace merchant is a business
	MarketplaceMerchantIsBusiness *bool `json:"marketplace_merchant_is_business,omitempty"`
	// MarketplaceMerchantCreatedAt is the date at which the merchant was created
	MarketplaceMerchantCreatedAt *time.Time `json:"marketplace_merchant_created_at,omitempty"`
	// Category is the category of the product
	Category *string `json:"category,omitempty"`
	// contains filtered or unexported fields
}

InvoiceDetail represents the InvoiceDetail API object

func (*InvoiceDetail) Prefill

func (s *InvoiceDetail) Prefill(c *InvoiceDetail) *InvoiceDetail

Prefil prefills the object with data provided in the parameter

func (*InvoiceDetail) SetClient

func (s *InvoiceDetail) SetClient(c *ProcessOut) *InvoiceDetail

SetClient sets the client for the InvoiceDetail object and its children

type InvoiceDevice

type InvoiceDevice struct {
	// Channel is the channel of the device
	Channel *string `json:"channel,omitempty"`
	// IpAddress is the iP address of the device
	IpAddress *string `json:"ip_address,omitempty"`
	// ID is the iD of the device
	ID *string `json:"id,omitempty"`
	// contains filtered or unexported fields
}

InvoiceDevice represents the InvoiceDevice API object

func (*InvoiceDevice) GetID

func (s *InvoiceDevice) GetID() string

GetID implements the Identiable interface

func (*InvoiceDevice) Prefill

func (s *InvoiceDevice) Prefill(c *InvoiceDevice) *InvoiceDevice

Prefil prefills the object with data provided in the parameter

func (*InvoiceDevice) SetClient

func (s *InvoiceDevice) SetClient(c *ProcessOut) *InvoiceDevice

SetClient sets the client for the InvoiceDevice object and its children

type InvoiceExternalFraudTools

type InvoiceExternalFraudTools struct {
	// Forter is the forter
	Forter *string `json:"forter,omitempty"`
	// contains filtered or unexported fields
}

InvoiceExternalFraudTools represents the InvoiceExternalFraudTools API object

func (*InvoiceExternalFraudTools) Prefill

Prefil prefills the object with data provided in the parameter

func (*InvoiceExternalFraudTools) SetClient

SetClient sets the client for the InvoiceExternalFraudTools object and its children

type InvoiceFetchCustomerParameters

type InvoiceFetchCustomerParameters struct {
	*Options
	*Invoice
}

InvoiceFetchCustomerParameters is the structure representing the additional parameters used to call Invoice.FetchCustomer

type InvoiceFetchTransactionParameters

type InvoiceFetchTransactionParameters struct {
	*Options
	*Invoice
}

InvoiceFetchTransactionParameters is the structure representing the additional parameters used to call Invoice.FetchTransaction

type InvoiceFindParameters

type InvoiceFindParameters struct {
	*Options
	*Invoice
}

InvoiceFindParameters is the structure representing the additional parameters used to call Invoice.Find

type InvoiceInitiateThreeDSParameters

type InvoiceInitiateThreeDSParameters struct {
	*Options
	*Invoice
	EnableThreeDS2 interface{} `json:"enable_three_d_s_2"`
}

InvoiceInitiateThreeDSParameters is the structure representing the additional parameters used to call Invoice.InitiateThreeDS

type InvoiceRisk

type InvoiceRisk struct {
	// Score is the scoring of the invoice
	Score *string `json:"score,omitempty"`
	// IsLegit is the define whether or not the invoice is legit
	IsLegit *bool `json:"is_legit,omitempty"`
	// contains filtered or unexported fields
}

InvoiceRisk represents the InvoiceRisk API object

func (*InvoiceRisk) Prefill

func (s *InvoiceRisk) Prefill(c *InvoiceRisk) *InvoiceRisk

Prefil prefills the object with data provided in the parameter

func (*InvoiceRisk) SetClient

func (s *InvoiceRisk) SetClient(c *ProcessOut) *InvoiceRisk

SetClient sets the client for the InvoiceRisk object and its children

type InvoiceShipping

type InvoiceShipping struct {
	// Amount is the amount of the shipping
	Amount *string `json:"amount,omitempty"`
	// Method is the delivery method
	Method *string `json:"method,omitempty"`
	// Provider is the delivery provider
	Provider *string `json:"provider,omitempty"`
	// Delay is the shipping delay
	Delay *string `json:"delay,omitempty"`
	// Address1 is the address where the shipment will be delivered
	Address1 *string `json:"address1,omitempty"`
	// Address2 is the secondary address where the shipment will be delivered
	Address2 *string `json:"address2,omitempty"`
	// City is the city where the shipment will be delivered
	City *string `json:"city,omitempty"`
	// State is the state where the shipment will be delivered
	State *string `json:"state,omitempty"`
	// CountryCode is the country code where the shipment will be delivered
	CountryCode *string `json:"country_code,omitempty"`
	// Zip is the zIP where the shipment will be delivered
	Zip *string `json:"zip,omitempty"`
	// PhoneNumber is the phone number for the shipment
	PhoneNumber *string `json:"phone_number,omitempty"`
	// ExpectsShippingAt is the date at which the shipment is expected to be sent
	ExpectsShippingAt *time.Time `json:"expects_shipping_at,omitempty"`
	// contains filtered or unexported fields
}

InvoiceShipping represents the InvoiceShipping API object

func (*InvoiceShipping) Prefill

Prefil prefills the object with data provided in the parameter

func (*InvoiceShipping) SetClient

func (s *InvoiceShipping) SetClient(c *ProcessOut) *InvoiceShipping

SetClient sets the client for the InvoiceShipping object and its children

type InvoiceVoidParameters

type InvoiceVoidParameters struct {
	*Options
	*Invoice
}

InvoiceVoidParameters is the structure representing the additional parameters used to call Invoice.Void

type Iterator

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

Iterator is the structure used to iterate over resources sent by the API

func (*Iterator) Data

func (i *Iterator) Data() []Identifiable

Data returns the data currently fetched by the iterator

func (*Iterator) Error

func (i *Iterator) Error() error

Error returns the error that occured when paginating, if any

func (*Iterator) Get

func (i *Iterator) Get() interface{}

Get returns the current element

func (*Iterator) Next

func (i *Iterator) Next() bool

Next iterates on the objects list and fetches new data if available

func (*Iterator) NextPage

func (i *Iterator) NextPage() (bool, error)

NextPage fetches the next data page

func (*Iterator) Prev

func (i *Iterator) Prev() bool

Prev iterates on the objects list and fetches new data if available

func (*Iterator) PrevPage

func (i *Iterator) PrevPage() (bool, error)

PrevPage fetches the previous data page

type Options added in v1.5.0

type Options struct {
	IdempotencyKey string   `json:"-"`
	Expand         []string `json:"expand"`
	Filter         string   `json:"filter"`
	Limit          uint64   `json:"limit"`
	EndBefore      string   `json:"end_before"`
	StartAfter     string   `json:"start_after"`
	DisableLogging bool     `json:"-"`
}

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

type PaymentDataNetworkAuthentication

type PaymentDataNetworkAuthentication struct {
	// Cavv is the authentication CAVV
	Cavv *string `json:"cavv,omitempty"`
	// contains filtered or unexported fields
}

PaymentDataNetworkAuthentication represents the PaymentDataNetworkAuthentication API object

func (*PaymentDataNetworkAuthentication) Prefill

Prefil prefills the object with data provided in the parameter

func (*PaymentDataNetworkAuthentication) SetClient

SetClient sets the client for the PaymentDataNetworkAuthentication object and its children

type PaymentDataThreeDSAuthentication

type PaymentDataThreeDSAuthentication struct {
	// XID is the authentication XID
	XID *string `json:"XID,omitempty"`
	// contains filtered or unexported fields
}

PaymentDataThreeDSAuthentication represents the PaymentDataThreeDSAuthentication API object

func (*PaymentDataThreeDSAuthentication) Prefill

Prefil prefills the object with data provided in the parameter

func (*PaymentDataThreeDSAuthentication) SetClient

SetClient sets the client for the PaymentDataThreeDSAuthentication object and its children

type PaymentDataThreeDSRequest

type PaymentDataThreeDSRequest struct {
	// AcsURL is the uRL of the ACS
	AcsURL *string `json:"acs_url,omitempty"`
	// Pareq is the pAReq used during the 3DS authentication
	Pareq *string `json:"pareq,omitempty"`
	// Md is the mD used during the 3DS authentication
	Md *string `json:"md,omitempty"`
	// TermURL is the uRL of the 3DS term
	TermURL *string `json:"term_url,omitempty"`
	// contains filtered or unexported fields
}

PaymentDataThreeDSRequest represents the PaymentDataThreeDSRequest API object

func (*PaymentDataThreeDSRequest) Prefill

Prefil prefills the object with data provided in the parameter

func (*PaymentDataThreeDSRequest) SetClient

SetClient sets the client for the PaymentDataThreeDSRequest object and its children

type Payout

type Payout struct {
	// ID is the iD of the payout
	ID *string `json:"id,omitempty"`
	// Project is the project to which the payout belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the payout belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Status is the status of the payout
	Status *string `json:"status,omitempty"`
	// Amount is the amount of the payout
	Amount *string `json:"amount,omitempty"`
	// Currency is the currency of the payout
	Currency *string `json:"currency,omitempty"`
	// Metadata is the metadata related to the payout, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// BankName is the name of the bank to which the payout was issued, if available
	BankName *string `json:"bank_name,omitempty"`
	// BankSummary is the summary of the bank to which the payout was issued, if available
	BankSummary *string `json:"bank_summary,omitempty"`
	// SalesTransactions is the number of completed transactions linked to the payout, if available
	SalesTransactions *int `json:"sales_transactions,omitempty"`
	// SalesVolume is the volume of completed transactions linked to the payout, if available
	SalesVolume *string `json:"sales_volume,omitempty"`
	// RefundsTransactions is the number of refunded transactions linked to the payout, if available
	RefundsTransactions *int `json:"refunds_transactions,omitempty"`
	// RefundsVolume is the volume of refunded transactions linked to the payout, if available
	RefundsVolume *string `json:"refunds_volume,omitempty"`
	// ChargebacksTransactions is the number of chargebacked transactions linked to the payout, if available
	ChargebacksTransactions *int `json:"chargebacks_transactions,omitempty"`
	// ChargebacksVolume is the volume of chargebacked transactions linked to the payout, if available
	ChargebacksVolume *string `json:"chargebacks_volume,omitempty"`
	// Fees is the fees linked to the payout, if available
	Fees *string `json:"fees,omitempty"`
	// Adjustments is the adjustments linked to the payout, if available
	Adjustments *string `json:"adjustments,omitempty"`
	// Reserve is the reserve kept on the payout, if available
	Reserve *string `json:"reserve,omitempty"`
	// SettledAt is the date at which the payout was settled
	SettledAt *time.Time `json:"settled_at,omitempty"`
	// CreatedAt is the date at which the payout was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Payout represents the Payout API object

func (Payout) All

func (s Payout) All(options ...PayoutAllParameters) (*Iterator, error)

All allows you to get all the payouts.

func (Payout) FetchItems

func (s Payout) FetchItems(options ...PayoutFetchItemsParameters) (*Iterator, error)

FetchItems allows you to get all the items linked to the payout.

func (Payout) Find

func (s Payout) Find(payoutID string, options ...PayoutFindParameters) (*Payout, error)

Find allows you to find a payout by its ID.

func (*Payout) GetID

func (s *Payout) GetID() string

GetID implements the Identiable interface

func (*Payout) Prefill

func (s *Payout) Prefill(c *Payout) *Payout

Prefil prefills the object with data provided in the parameter

func (*Payout) SetClient

func (s *Payout) SetClient(c *ProcessOut) *Payout

SetClient sets the client for the Payout object and its children

type PayoutAllParameters

type PayoutAllParameters struct {
	*Options
	*Payout
}

PayoutAllParameters is the structure representing the additional parameters used to call Payout.All

type PayoutFetchItemsParameters

type PayoutFetchItemsParameters struct {
	*Options
	*Payout
}

PayoutFetchItemsParameters is the structure representing the additional parameters used to call Payout.FetchItems

type PayoutFindParameters

type PayoutFindParameters struct {
	*Options
	*Payout
}

PayoutFindParameters is the structure representing the additional parameters used to call Payout.Find

type PayoutItem

type PayoutItem struct {
	// ID is the iD of the payout item
	ID *string `json:"id,omitempty"`
	// Project is the project to which the payout item belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the payout item belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Payout is the payout to which the item belongs
	Payout *Payout `json:"payout,omitempty"`
	// PayoutID is the iD of the payout to which the item belongs
	PayoutID *string `json:"payout_id,omitempty"`
	// Transaction is the transaction linked to this payout item. Can be null
	Transaction *Transaction `json:"transaction,omitempty"`
	// TransactionID is the iD of the transaction linked to this payout item. Can be null
	TransactionID *string `json:"transaction_id,omitempty"`
	// Type is the type of the payout item
	Type *string `json:"type,omitempty"`
	// GatewayResourceID is the iD of the payout item from the payment gateway
	GatewayResourceID *string `json:"gateway_resource_id,omitempty"`
	// Amount is the amount related to this specific payout item. Can be null or 0.
	Amount *string `json:"amount,omitempty"`
	// Fees is the fee linked to this specific payout item. Can be null or 0.
	Fees *string `json:"fees,omitempty"`
	// Metadata is the metadata related to the payout item, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// CreatedAt is the date at which the payout item was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

PayoutItem represents the PayoutItem API object

func (*PayoutItem) GetID

func (s *PayoutItem) GetID() string

GetID implements the Identiable interface

func (*PayoutItem) Prefill

func (s *PayoutItem) Prefill(c *PayoutItem) *PayoutItem

Prefil prefills the object with data provided in the parameter

func (*PayoutItem) SetClient

func (s *PayoutItem) SetClient(c *ProcessOut) *PayoutItem

SetClient sets the client for the PayoutItem object and its children

type Plan

type Plan struct {
	// ID is the iD of the plan
	ID *string `json:"id,omitempty"`
	// Project is the project to which the plan belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the plan belongs
	ProjectID *string `json:"project_id,omitempty"`
	// URL is the uRL to which you may redirect your customer to activate the subscription plan
	URL *string `json:"url,omitempty"`
	// Name is the name of the plan
	Name *string `json:"name,omitempty"`
	// Amount is the amount of the plan
	Amount *string `json:"amount,omitempty"`
	// Currency is the currency of the plan
	Currency *string `json:"currency,omitempty"`
	// Metadata is the metadata related to the plan, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Interval is the the plan interval, formatted in the format "1d2w3m4y" (day, week, month, year)
	Interval *string `json:"interval,omitempty"`
	// TrialPeriod is the 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,omitempty"`
	// ReturnURL is the uRL where the customer will be redirected when activating the subscription created using this plan
	ReturnURL *string `json:"return_url,omitempty"`
	// CancelURL is the uRL where the customer will be redirected when cancelling the subscription created using this plan
	CancelURL *string `json:"cancel_url,omitempty"`
	// Sandbox is the define whether or not the plan is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the plan was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Plan represents the Plan API object

func (Plan) All

func (s Plan) All(options ...PlanAllParameters) (*Iterator, error)

All allows you to get all the plans.

func (Plan) Create

func (s Plan) Create(options ...PlanCreateParameters) (*Plan, error)

Create allows you to create a new plan.

func (Plan) End

func (s Plan) End(options ...PlanEndParameters) error

End allows you to delete a plan. Subscriptions linked to this plan won't be affected.

func (Plan) Find

func (s Plan) Find(planID string, options ...PlanFindParameters) (*Plan, error)

Find allows you to find a plan by its ID.

func (*Plan) GetID

func (s *Plan) GetID() string

GetID implements the Identiable interface

func (*Plan) Prefill

func (s *Plan) Prefill(c *Plan) *Plan

Prefil prefills the object with data provided in the parameter

func (Plan) Save

func (s Plan) Save(options ...PlanSaveParameters) (*Plan, error)

Save allows you to save the updated plan attributes. This action won't affect subscriptions already linked to this plan.

func (*Plan) SetClient

func (s *Plan) SetClient(c *ProcessOut) *Plan

SetClient sets the client for the Plan object and its children

type PlanAllParameters

type PlanAllParameters struct {
	*Options
	*Plan
}

PlanAllParameters is the structure representing the additional parameters used to call Plan.All

type PlanCreateParameters

type PlanCreateParameters struct {
	*Options
	*Plan
}

PlanCreateParameters is the structure representing the additional parameters used to call Plan.Create

type PlanEndParameters

type PlanEndParameters struct {
	*Options
	*Plan
}

PlanEndParameters is the structure representing the additional parameters used to call Plan.End

type PlanFindParameters

type PlanFindParameters struct {
	*Options
	*Plan
}

PlanFindParameters is the structure representing the additional parameters used to call Plan.Find

type PlanSaveParameters

type PlanSaveParameters struct {
	*Options
	*Plan
}

PlanSaveParameters is the structure representing the additional parameters used to call Plan.Save

type ProcessOut

type ProcessOut struct {
	// APIVersion is the version of the API to use
	APIVersion string
	// UserAgent is the UserAgent that will be used to send the request
	UserAgent string

	// HTTPClient used to make requests
	HTTPClient *http.Client
	// 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.

func (*ProcessOut) NewAPIRequest

func (c *ProcessOut) NewAPIRequest(prefill ...*APIRequest) *APIRequest

NewAPIRequest creates a new APIRequest object

func (*ProcessOut) NewAPIVersion

func (c *ProcessOut) NewAPIVersion(prefill ...*APIVersion) *APIVersion

NewAPIVersion creates a new APIVersion object

func (*ProcessOut) NewActivity

func (c *ProcessOut) NewActivity(prefill ...*Activity) *Activity

NewActivity creates a new Activity object

func (*ProcessOut) NewAddon

func (c *ProcessOut) NewAddon(prefill ...*Addon) *Addon

NewAddon creates a new Addon object

func (*ProcessOut) NewCard

func (c *ProcessOut) NewCard(prefill ...*Card) *Card

NewCard creates a new Card object

func (*ProcessOut) NewCardInformation

func (c *ProcessOut) NewCardInformation(prefill ...*CardInformation) *CardInformation

NewCardInformation creates a new CardInformation object

func (*ProcessOut) NewCoupon

func (c *ProcessOut) NewCoupon(prefill ...*Coupon) *Coupon

NewCoupon creates a new Coupon object

func (*ProcessOut) NewCustomer

func (c *ProcessOut) NewCustomer(prefill ...*Customer) *Customer

NewCustomer creates a new Customer object

func (*ProcessOut) NewCustomerAction

func (c *ProcessOut) NewCustomerAction(prefill ...*CustomerAction) *CustomerAction

NewCustomerAction creates a new CustomerAction object

func (*ProcessOut) NewDiscount

func (c *ProcessOut) NewDiscount(prefill ...*Discount) *Discount

NewDiscount creates a new Discount object

func (*ProcessOut) NewDunningAction

func (c *ProcessOut) NewDunningAction(prefill ...*DunningAction) *DunningAction

NewDunningAction creates a new DunningAction object

func (*ProcessOut) NewEvent

func (c *ProcessOut) NewEvent(prefill ...*Event) *Event

NewEvent creates a new Event object

func (*ProcessOut) NewGateway

func (c *ProcessOut) NewGateway(prefill ...*Gateway) *Gateway

NewGateway creates a new Gateway object

func (*ProcessOut) NewGatewayConfiguration

func (c *ProcessOut) NewGatewayConfiguration(prefill ...*GatewayConfiguration) *GatewayConfiguration

NewGatewayConfiguration creates a new GatewayConfiguration object

func (*ProcessOut) NewInvoice

func (c *ProcessOut) NewInvoice(prefill ...*Invoice) *Invoice

NewInvoice creates a new Invoice object

func (*ProcessOut) NewInvoiceDetail

func (c *ProcessOut) NewInvoiceDetail(prefill ...*InvoiceDetail) *InvoiceDetail

NewInvoiceDetail creates a new InvoiceDetail object

func (*ProcessOut) NewInvoiceDevice

func (c *ProcessOut) NewInvoiceDevice(prefill ...*InvoiceDevice) *InvoiceDevice

NewInvoiceDevice creates a new InvoiceDevice object

func (*ProcessOut) NewInvoiceExternalFraudTools

func (c *ProcessOut) NewInvoiceExternalFraudTools(prefill ...*InvoiceExternalFraudTools) *InvoiceExternalFraudTools

NewInvoiceExternalFraudTools creates a new InvoiceExternalFraudTools object

func (*ProcessOut) NewInvoiceRisk

func (c *ProcessOut) NewInvoiceRisk(prefill ...*InvoiceRisk) *InvoiceRisk

NewInvoiceRisk creates a new InvoiceRisk object

func (*ProcessOut) NewInvoiceShipping

func (c *ProcessOut) NewInvoiceShipping(prefill ...*InvoiceShipping) *InvoiceShipping

NewInvoiceShipping creates a new InvoiceShipping object

func (*ProcessOut) NewPaymentDataNetworkAuthentication

func (c *ProcessOut) NewPaymentDataNetworkAuthentication(prefill ...*PaymentDataNetworkAuthentication) *PaymentDataNetworkAuthentication

NewPaymentDataNetworkAuthentication creates a new PaymentDataNetworkAuthentication object

func (*ProcessOut) NewPaymentDataThreeDSAuthentication

func (c *ProcessOut) NewPaymentDataThreeDSAuthentication(prefill ...*PaymentDataThreeDSAuthentication) *PaymentDataThreeDSAuthentication

NewPaymentDataThreeDSAuthentication creates a new PaymentDataThreeDSAuthentication object

func (*ProcessOut) NewPaymentDataThreeDSRequest

func (c *ProcessOut) NewPaymentDataThreeDSRequest(prefill ...*PaymentDataThreeDSRequest) *PaymentDataThreeDSRequest

NewPaymentDataThreeDSRequest creates a new PaymentDataThreeDSRequest object

func (*ProcessOut) NewPayout

func (c *ProcessOut) NewPayout(prefill ...*Payout) *Payout

NewPayout creates a new Payout object

func (*ProcessOut) NewPayoutItem

func (c *ProcessOut) NewPayoutItem(prefill ...*PayoutItem) *PayoutItem

NewPayoutItem creates a new PayoutItem object

func (*ProcessOut) NewPlan

func (c *ProcessOut) NewPlan(prefill ...*Plan) *Plan

NewPlan creates a new Plan object

func (*ProcessOut) NewProduct

func (c *ProcessOut) NewProduct(prefill ...*Product) *Product

NewProduct creates a new Product object

func (*ProcessOut) NewProject

func (c *ProcessOut) NewProject(prefill ...*Project) *Project

NewProject creates a new Project object

func (*ProcessOut) NewRefund

func (c *ProcessOut) NewRefund(prefill ...*Refund) *Refund

NewRefund creates a new Refund object

func (*ProcessOut) NewSubscription

func (c *ProcessOut) NewSubscription(prefill ...*Subscription) *Subscription

NewSubscription creates a new Subscription object

func (*ProcessOut) NewToken

func (c *ProcessOut) NewToken(prefill ...*Token) *Token

NewToken creates a new Token object

func (*ProcessOut) NewTransaction

func (c *ProcessOut) NewTransaction(prefill ...*Transaction) *Transaction

NewTransaction creates a new Transaction object

func (*ProcessOut) NewTransactionOperation

func (c *ProcessOut) NewTransactionOperation(prefill ...*TransactionOperation) *TransactionOperation

NewTransactionOperation creates a new TransactionOperation object

func (*ProcessOut) NewWebhook

func (c *ProcessOut) NewWebhook(prefill ...*Webhook) *Webhook

NewWebhook creates a new Webhook object

func (*ProcessOut) NewWebhookEndpoint

func (c *ProcessOut) NewWebhookEndpoint(prefill ...*WebhookEndpoint) *WebhookEndpoint

NewWebhookEndpoint creates a new WebhookEndpoint object

type Product

type Product struct {
	// ID is the iD of the product
	ID *string `json:"id,omitempty"`
	// Project is the project to which the product belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the product belongs
	ProjectID *string `json:"project_id,omitempty"`
	// URL is the uRL to which you may redirect your customer to proceed with the payment
	URL *string `json:"url,omitempty"`
	// Name is the name of the product
	Name *string `json:"name,omitempty"`
	// Amount is the amount of the product
	Amount *string `json:"amount,omitempty"`
	// Currency is the currency of the product
	Currency *string `json:"currency,omitempty"`
	// Metadata is the metadata related to the product, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// ReturnURL is the uRL where the customer will be redirected upon payment
	ReturnURL *string `json:"return_url,omitempty"`
	// CancelURL is the uRL where the customer will be redirected if the paymen was canceled
	CancelURL *string `json:"cancel_url,omitempty"`
	// Sandbox is the define whether or not the product is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the product was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Product represents the Product API object

func (Product) All

func (s Product) All(options ...ProductAllParameters) (*Iterator, error)

All allows you to get all the products.

func (Product) Create

func (s Product) Create(options ...ProductCreateParameters) (*Product, error)

Create allows you to create a new product.

func (Product) CreateInvoice

func (s Product) CreateInvoice(options ...ProductCreateInvoiceParameters) (*Invoice, error)

CreateInvoice allows you to create a new invoice from the product.

func (Product) Delete

func (s Product) Delete(options ...ProductDeleteParameters) error

Delete allows you to delete the product.

func (Product) Find

func (s Product) Find(productID string, options ...ProductFindParameters) (*Product, error)

Find allows you to find a product by its ID.

func (*Product) GetID

func (s *Product) GetID() string

GetID implements the Identiable interface

func (*Product) Prefill

func (s *Product) Prefill(c *Product) *Product

Prefil prefills the object with data provided in the parameter

func (Product) Save

func (s Product) Save(options ...ProductSaveParameters) (*Product, error)

Save allows you to save the updated product attributes.

func (*Product) SetClient

func (s *Product) SetClient(c *ProcessOut) *Product

SetClient sets the client for the Product object and its children

type ProductAllParameters

type ProductAllParameters struct {
	*Options
	*Product
}

ProductAllParameters is the structure representing the additional parameters used to call Product.All

type ProductCreateInvoiceParameters

type ProductCreateInvoiceParameters struct {
	*Options
	*Product
}

ProductCreateInvoiceParameters is the structure representing the additional parameters used to call Product.CreateInvoice

type ProductCreateParameters

type ProductCreateParameters struct {
	*Options
	*Product
}

ProductCreateParameters is the structure representing the additional parameters used to call Product.Create

type ProductDeleteParameters

type ProductDeleteParameters struct {
	*Options
	*Product
}

ProductDeleteParameters is the structure representing the additional parameters used to call Product.Delete

type ProductFindParameters

type ProductFindParameters struct {
	*Options
	*Product
}

ProductFindParameters is the structure representing the additional parameters used to call Product.Find

type ProductSaveParameters

type ProductSaveParameters struct {
	*Options
	*Product
}

ProductSaveParameters is the structure representing the additional parameters used to call Product.Save

type Project

type Project struct {
	// ID is the iD of the project
	ID *string `json:"id,omitempty"`
	// SupervisorProject is the project used to create this project
	SupervisorProject *Project `json:"supervisor_project,omitempty"`
	// SupervisorProjectID is the iD of the project used to create this project
	SupervisorProjectID *string `json:"supervisor_project_id,omitempty"`
	// APIVersion is the current API version of the project
	APIVersion *APIVersion `json:"api_version,omitempty"`
	// Name is the name of the project
	Name *string `json:"name,omitempty"`
	// LogoURL is the name of the project
	LogoURL *string `json:"logo_url,omitempty"`
	// Email is the email of the project
	Email *string `json:"email,omitempty"`
	// DefaultCurrency is the default currency of the project, used to compute analytics amounts
	DefaultCurrency *string `json:"default_currency,omitempty"`
	// PrivateKey is the private key of the project. Only returned when creating a project
	PrivateKey *string `json:"private_key,omitempty"`
	// DunningConfiguration is the dunning configuration of the project
	DunningConfiguration *[]*DunningAction `json:"dunning_configuration,omitempty"`
	// CreatedAt is the date at which the project was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Project represents the Project API object

func (Project) CreateSupervised

func (s Project) CreateSupervised(options ...ProjectCreateSupervisedParameters) (*Project, error)

CreateSupervised allows you to create a new supervised project.

func (Project) Delete

func (s Project) Delete(options ...ProjectDeleteParameters) error

Delete allows you to delete the project. Be careful! Executing this request will prevent any further interaction with the API that uses this project.

func (Project) Fetch

func (s Project) Fetch(options ...ProjectFetchParameters) (*Project, error)

Fetch allows you to fetch the current project information.

func (Project) FetchSupervised

func (s Project) FetchSupervised(options ...ProjectFetchSupervisedParameters) (*Iterator, error)

FetchSupervised allows you to get all the supervised projects.

func (*Project) GetID

func (s *Project) GetID() string

GetID implements the Identiable interface

func (*Project) Prefill

func (s *Project) Prefill(c *Project) *Project

Prefil prefills the object with data provided in the parameter

func (Project) Save

func (s Project) Save(options ...ProjectSaveParameters) (*Project, error)

Save allows you to save the updated project's attributes.

func (*Project) SetClient

func (s *Project) SetClient(c *ProcessOut) *Project

SetClient sets the client for the Project object and its children

type ProjectCreateSupervisedParameters

type ProjectCreateSupervisedParameters struct {
	*Options
	*Project
	ApplepaySettings interface{} `json:"applepay_settings"`
}

ProjectCreateSupervisedParameters is the structure representing the additional parameters used to call Project.CreateSupervised

type ProjectDeleteParameters

type ProjectDeleteParameters struct {
	*Options
	*Project
}

ProjectDeleteParameters is the structure representing the additional parameters used to call Project.Delete

type ProjectFetchParameters

type ProjectFetchParameters struct {
	*Options
	*Project
}

ProjectFetchParameters is the structure representing the additional parameters used to call Project.Fetch

type ProjectFetchSupervisedParameters

type ProjectFetchSupervisedParameters struct {
	*Options
	*Project
}

ProjectFetchSupervisedParameters is the structure representing the additional parameters used to call Project.FetchSupervised

type ProjectSaveParameters

type ProjectSaveParameters struct {
	*Options
	*Project
}

ProjectSaveParameters is the structure representing the additional parameters used to call Project.Save

type Refund

type Refund struct {
	// ID is the iD of the refund
	ID *string `json:"id,omitempty"`
	// Transaction is the transaction to which the refund is applied
	Transaction *Transaction `json:"transaction,omitempty"`
	// TransactionID is the iD of the transaction to which the refund is applied
	TransactionID *string `json:"transaction_id,omitempty"`
	// Amount is the amount to be refunded. Must not be greater than the amount still available on the transaction
	Amount *string `json:"amount,omitempty"`
	// Reason is the reason for the refund. Either customer_request, duplicate or fraud
	Reason *string `json:"reason,omitempty"`
	// Information is the custom details regarding the refund
	Information *string `json:"information,omitempty"`
	// HasFailed is the true if the refund was asynchronously failed, false otherwise
	HasFailed *bool `json:"has_failed,omitempty"`
	// Metadata is the metadata related to the refund, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Sandbox is the define whether or not the refund is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the refund was done
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Refund represents the Refund API object

func (Refund) Create

func (s Refund) Create(options ...RefundCreateParameters) error

Create allows you to create a refund for a transaction.

func (Refund) FetchTransactionRefunds

func (s Refund) FetchTransactionRefunds(transactionID string, options ...RefundFetchTransactionRefundsParameters) (*Iterator, error)

FetchTransactionRefunds allows you to get the transaction's refunds.

func (Refund) Find

func (s Refund) Find(transactionID, refundID string, options ...RefundFindParameters) (*Refund, error)

Find allows you to find a transaction's refund by its ID.

func (*Refund) GetID

func (s *Refund) GetID() string

GetID implements the Identiable interface

func (*Refund) Prefill

func (s *Refund) Prefill(c *Refund) *Refund

Prefil prefills the object with data provided in the parameter

func (*Refund) SetClient

func (s *Refund) SetClient(c *ProcessOut) *Refund

SetClient sets the client for the Refund object and its children

type RefundCreateParameters

type RefundCreateParameters struct {
	*Options
	*Refund
}

RefundCreateParameters is the structure representing the additional parameters used to call Refund.Create

type RefundFetchTransactionRefundsParameters

type RefundFetchTransactionRefundsParameters struct {
	*Options
	*Refund
}

RefundFetchTransactionRefundsParameters is the structure representing the additional parameters used to call Refund.FetchTransactionRefunds

type RefundFindParameters

type RefundFindParameters struct {
	*Options
	*Refund
}

RefundFindParameters is the structure representing the additional parameters used to call Refund.Find

type Subscription

type Subscription struct {
	// ID is the iD of the subscription
	ID *string `json:"id,omitempty"`
	// Project is the project to which the subscription belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the subscription belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Plan is the plan linked to this subscription, if any
	Plan *Plan `json:"plan,omitempty"`
	// PlanID is the iD of the plan linked to this subscription, if any
	PlanID *string `json:"plan_id,omitempty"`
	// Discounts is the list of the subscription discounts
	Discounts *[]*Discount `json:"discounts,omitempty"`
	// Addons is the list of the subscription addons
	Addons *[]*Addon `json:"addons,omitempty"`
	// Transactions is the list of the subscription transactions
	Transactions *[]*Transaction `json:"transactions,omitempty"`
	// Customer is the customer linked to the subscription
	Customer *Customer `json:"customer,omitempty"`
	// CustomerID is the iD of the customer linked to the subscription
	CustomerID *string `json:"customer_id,omitempty"`
	// Token is the token used to capture payments on this subscription
	Token *Token `json:"token,omitempty"`
	// TokenID is the iD of the token used to capture payments on this subscription
	TokenID *string `json:"token_id,omitempty"`
	// URL is the uRL to which you may redirect your customer to activate the subscription
	URL *string `json:"url,omitempty"`
	// Name is the name of the subscription
	Name *string `json:"name,omitempty"`
	// Amount is the base amount of the subscription
	Amount *string `json:"amount,omitempty"`
	// BillableAmount is the amount to be paid at each billing cycle of the subscription
	BillableAmount *string `json:"billable_amount,omitempty"`
	// DiscountedAmount is the amount discounted by discounts applied to the subscription
	DiscountedAmount *string `json:"discounted_amount,omitempty"`
	// AddonsAmount is the amount applied on top of the subscription base price with addons
	AddonsAmount *string `json:"addons_amount,omitempty"`
	// Currency is the currency of the subscription
	Currency *string `json:"currency,omitempty"`
	// Metadata is the metadata related to the subscription, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Interval is the the subscription interval, formatted in the format "1d2w3m4y" (day, week, month, year)
	Interval *string `json:"interval,omitempty"`
	// TrialEndAt is the date at which the subscription trial should end. Can be null to set no trial
	TrialEndAt *time.Time `json:"trial_end_at,omitempty"`
	// Activated is the whether or not the subscription was activated. This field does not take into account whether or not the subscription was canceled. Use the active field to know if the subscription is currently active
	Activated *bool `json:"activated,omitempty"`
	// Active is the whether or not the subscription is currently active (ie activated and not cancelled)
	Active *bool `json:"active,omitempty"`
	// CancelAt is the date at which the subscription will automatically be canceled. Can be null
	CancelAt *time.Time `json:"cancel_at,omitempty"`
	// Canceled is the whether or not the subscription was canceled. The cancellation reason can be found in the cancellation_reason field
	Canceled *bool `json:"canceled,omitempty"`
	// CancellationReason is the reason as to why the subscription was cancelled
	CancellationReason *string `json:"cancellation_reason,omitempty"`
	// PendingCancellation is the whether or not the subscription is pending cancellation (meaning a cancel_at date was set)
	PendingCancellation *bool `json:"pending_cancellation,omitempty"`
	// ReturnURL is the uRL where the customer will be redirected upon activation of the subscription
	ReturnURL *string `json:"return_url,omitempty"`
	// CancelURL is the uRL where the customer will be redirected if the subscription activation was canceled
	CancelURL *string `json:"cancel_url,omitempty"`
	// UnpaidState is the when the subscription has unpaid invoices, defines the dunning logic of the subscription (as specified in the project settings)
	UnpaidState *string `json:"unpaid_state,omitempty"`
	// Sandbox is the define whether or not the subscription is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the subscription was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// ActivatedAt is the date at which the subscription was activated. Null if the subscription hasn't been activated yet
	ActivatedAt *time.Time `json:"activated_at,omitempty"`
	// IterateAt is the next iteration date, corresponding to the next billing cycle start date
	IterateAt *time.Time `json:"iterate_at,omitempty"`
	// contains filtered or unexported fields
}

Subscription represents the Subscription API object

func (Subscription) All

func (s Subscription) All(options ...SubscriptionAllParameters) (*Iterator, error)

All allows you to get all the subscriptions.

func (Subscription) Cancel

Cancel allows you to cancel a subscription. The reason may be provided as well.

func (Subscription) Create

Create allows you to create a new subscription for the given customer.

func (Subscription) DeleteAddon

func (s Subscription) DeleteAddon(addonID string, options ...SubscriptionDeleteAddonParameters) error

DeleteAddon allows you to delete an addon applied to a subscription.

func (Subscription) DeleteDiscount

func (s Subscription) DeleteDiscount(discountID string, options ...SubscriptionDeleteDiscountParameters) error

DeleteDiscount allows you to delete a discount applied to a subscription.

func (Subscription) FetchAddons

func (s Subscription) FetchAddons(options ...SubscriptionFetchAddonsParameters) (*Iterator, error)

FetchAddons allows you to get the addons applied to the subscription.

func (Subscription) FetchCustomer

func (s Subscription) FetchCustomer(options ...SubscriptionFetchCustomerParameters) (*Customer, error)

FetchCustomer allows you to get the customer owning the subscription.

func (Subscription) FetchDiscounts

func (s Subscription) FetchDiscounts(options ...SubscriptionFetchDiscountsParameters) (*Iterator, error)

FetchDiscounts allows you to get the discounts applied to the subscription.

func (Subscription) FetchTransactions

func (s Subscription) FetchTransactions(options ...SubscriptionFetchTransactionsParameters) (*Iterator, error)

FetchTransactions allows you to get the subscriptions past transactions.

func (Subscription) Find

func (s Subscription) Find(subscriptionID string, options ...SubscriptionFindParameters) (*Subscription, error)

Find allows you to find a subscription by its ID.

func (Subscription) FindAddon

func (s Subscription) FindAddon(addonID string, options ...SubscriptionFindAddonParameters) (*Addon, error)

FindAddon allows you to find a subscription's addon by its ID.

func (Subscription) FindDiscount

func (s Subscription) FindDiscount(discountID string, options ...SubscriptionFindDiscountParameters) (*Discount, error)

FindDiscount allows you to find a subscription's discount by its ID.

func (*Subscription) GetID

func (s *Subscription) GetID() string

GetID implements the Identiable interface

func (*Subscription) Prefill

func (s *Subscription) Prefill(c *Subscription) *Subscription

Prefil prefills the object with data provided in the parameter

func (Subscription) Save

Save allows you to save the updated subscription attributes.

func (*Subscription) SetClient

func (s *Subscription) SetClient(c *ProcessOut) *Subscription

SetClient sets the client for the Subscription object and its children

type SubscriptionAllParameters

type SubscriptionAllParameters struct {
	*Options
	*Subscription
}

SubscriptionAllParameters is the structure representing the additional parameters used to call Subscription.All

type SubscriptionCancelParameters

type SubscriptionCancelParameters struct {
	*Options
	*Subscription
	CancelAtEnd interface{} `json:"cancel_at_end"`
}

SubscriptionCancelParameters is the structure representing the additional parameters used to call Subscription.Cancel

type SubscriptionCreateParameters

type SubscriptionCreateParameters struct {
	*Options
	*Subscription
	Source   interface{} `json:"source"`
	CouponID interface{} `json:"coupon_id"`
}

SubscriptionCreateParameters is the structure representing the additional parameters used to call Subscription.Create

type SubscriptionDeleteAddonParameters

type SubscriptionDeleteAddonParameters struct {
	*Options
	*Subscription
	Prorate       interface{} `json:"prorate"`
	ProrationDate interface{} `json:"proration_date"`
	Preview       interface{} `json:"preview"`
}

SubscriptionDeleteAddonParameters is the structure representing the additional parameters used to call Subscription.DeleteAddon

type SubscriptionDeleteDiscountParameters

type SubscriptionDeleteDiscountParameters struct {
	*Options
	*Subscription
}

SubscriptionDeleteDiscountParameters is the structure representing the additional parameters used to call Subscription.DeleteDiscount

type SubscriptionFetchAddonsParameters

type SubscriptionFetchAddonsParameters struct {
	*Options
	*Subscription
}

SubscriptionFetchAddonsParameters is the structure representing the additional parameters used to call Subscription.FetchAddons

type SubscriptionFetchCustomerParameters

type SubscriptionFetchCustomerParameters struct {
	*Options
	*Subscription
}

SubscriptionFetchCustomerParameters is the structure representing the additional parameters used to call Subscription.FetchCustomer

type SubscriptionFetchDiscountsParameters

type SubscriptionFetchDiscountsParameters struct {
	*Options
	*Subscription
}

SubscriptionFetchDiscountsParameters is the structure representing the additional parameters used to call Subscription.FetchDiscounts

type SubscriptionFetchTransactionsParameters

type SubscriptionFetchTransactionsParameters struct {
	*Options
	*Subscription
}

SubscriptionFetchTransactionsParameters is the structure representing the additional parameters used to call Subscription.FetchTransactions

type SubscriptionFindAddonParameters

type SubscriptionFindAddonParameters struct {
	*Options
	*Subscription
}

SubscriptionFindAddonParameters is the structure representing the additional parameters used to call Subscription.FindAddon

type SubscriptionFindDiscountParameters

type SubscriptionFindDiscountParameters struct {
	*Options
	*Subscription
}

SubscriptionFindDiscountParameters is the structure representing the additional parameters used to call Subscription.FindDiscount

type SubscriptionFindParameters

type SubscriptionFindParameters struct {
	*Options
	*Subscription
}

SubscriptionFindParameters is the structure representing the additional parameters used to call Subscription.Find

type SubscriptionSaveParameters

type SubscriptionSaveParameters struct {
	*Options
	*Subscription
	CouponID      interface{} `json:"coupon_id"`
	Source        interface{} `json:"source"`
	Prorate       interface{} `json:"prorate"`
	ProrationDate interface{} `json:"proration_date"`
	Preview       interface{} `json:"preview"`
}

SubscriptionSaveParameters is the structure representing the additional parameters used to call Subscription.Save

type Token added in v1.3.0

type Token struct {
	// ID is the iD of the customer token
	ID *string `json:"id,omitempty"`
	// Customer is the customer owning the token
	Customer *Customer `json:"customer,omitempty"`
	// CustomerID is the iD of the customer linked to the token
	CustomerID *string `json:"customer_id,omitempty"`
	// GatewayConfiguration is the gateway configuration to which the token is linked, if any
	GatewayConfiguration *GatewayConfiguration `json:"gateway_configuration,omitempty"`
	// GatewayConfigurationID is the iD of the gateway configuration to which the token is linked, if any
	GatewayConfigurationID *string `json:"gateway_configuration_id,omitempty"`
	// Card is the card used to create this token, if any
	Card *Card `json:"card,omitempty"`
	// CardID is the iD of the card used to create the token, if any
	CardID *string `json:"card_id,omitempty"`
	// Type is the type of the token. Can be card or gateway_token
	Type *string `json:"type,omitempty"`
	// Metadata is the metadata related to the token, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// IsSubscriptionOnly is the define whether or not the customer token is used on a recurring invoice
	IsSubscriptionOnly *bool `json:"is_subscription_only,omitempty"`
	// IsDefault is the true if the token it the default token of the customer, false otherwise
	IsDefault *bool `json:"is_default,omitempty"`
	// ReturnURL is the uRL where the customer will be redirected upon payment authentication (if required by tokenization method)
	ReturnURL *string `json:"return_url,omitempty"`
	// CancelURL is the uRL where the customer will be redirected if the tokenization was canceled (if required by tokenization method)
	CancelURL *string `json:"cancel_url,omitempty"`
	// Summary is the summary of the customer token, such as a description of the card used or the email of a PayPal account
	Summary *string `json:"summary,omitempty"`
	// IsChargeable is the true if the token is chargeable, false otherwise
	IsChargeable *bool `json:"is_chargeable,omitempty"`
	// CreatedAt is the date at which the customer token was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Description is the description of the created token
	Description *string `json:"description,omitempty"`
	// Invoice is the invoice used to verify this token, if any
	Invoice *Invoice `json:"invoice,omitempty"`
	// InvoiceID is the iD of the invoice used to verify that token
	InvoiceID *string `json:"invoice_id,omitempty"`
	// contains filtered or unexported fields
}

Token represents the Token API object

func (Token) Create

func (s Token) Create(options ...TokenCreateParameters) (*Token, error)

Create allows you to create a new token for the given customer ID.

func (Token) Delete

func (s Token) Delete(options ...TokenDeleteParameters) error

Delete allows you to delete a customer token

func (Token) FetchCustomerTokens

func (s Token) FetchCustomerTokens(customerID string, options ...TokenFetchCustomerTokensParameters) (*Iterator, error)

FetchCustomerTokens allows you to get the customer's tokens.

func (Token) Find

func (s Token) Find(customerID, tokenID string, options ...TokenFindParameters) (*Token, error)

Find allows you to find a customer's token by its ID.

func (*Token) GetID

func (s *Token) GetID() string

GetID implements the Identiable interface

func (*Token) Prefill

func (s *Token) Prefill(c *Token) *Token

Prefil prefills the object with data provided in the parameter

func (Token) Save

func (s Token) Save(options ...TokenSaveParameters) error

Save allows you to save the updated customer attributes.

func (*Token) SetClient

func (s *Token) SetClient(c *ProcessOut) *Token

SetClient sets the client for the Token object and its children

type TokenCreateParameters

type TokenCreateParameters struct {
	*Options
	*Token
	Source         interface{} `json:"source"`
	Settings       interface{} `json:"settings"`
	Device         interface{} `json:"device"`
	Verify         interface{} `json:"verify"`
	VerifyMetadata interface{} `json:"verify_metadata"`
	SetDefault     interface{} `json:"set_default"`
}

TokenCreateParameters is the structure representing the additional parameters used to call Token.Create

type TokenDeleteParameters

type TokenDeleteParameters struct {
	*Options
	*Token
}

TokenDeleteParameters is the structure representing the additional parameters used to call Token.Delete

type TokenFetchCustomerTokensParameters

type TokenFetchCustomerTokensParameters struct {
	*Options
	*Token
}

TokenFetchCustomerTokensParameters is the structure representing the additional parameters used to call Token.FetchCustomerTokens

type TokenFindParameters

type TokenFindParameters struct {
	*Options
	*Token
}

TokenFindParameters is the structure representing the additional parameters used to call Token.Find

type TokenSaveParameters

type TokenSaveParameters struct {
	*Options
	*Token
	Source         interface{} `json:"source"`
	Settings       interface{} `json:"settings"`
	Device         interface{} `json:"device"`
	Verify         interface{} `json:"verify"`
	VerifyMetadata interface{} `json:"verify_metadata"`
	SetDefault     interface{} `json:"set_default"`
}

TokenSaveParameters is the structure representing the additional parameters used to call Token.Save

type Transaction added in v1.3.0

type Transaction struct {
	// ID is the iD of the transaction
	ID *string `json:"id,omitempty"`
	// Project is the project to which the transaction belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the transaction belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Invoice is the invoice used to generate this transaction, if any
	Invoice *Invoice `json:"invoice,omitempty"`
	// InvoiceID is the iD of the invoice used to generate this transaction, if any
	InvoiceID *string `json:"invoice_id,omitempty"`
	// Customer is the customer that was linked to this transaction, if any
	Customer *Customer `json:"customer,omitempty"`
	// CustomerID is the iD of the customer that was linked to the transaction, if any
	CustomerID *string `json:"customer_id,omitempty"`
	// Subscription is the subscription to which this transaction belongs
	Subscription *Subscription `json:"subscription,omitempty"`
	// SubscriptionID is the iD of the subscription to which the transaction belongs, if any
	SubscriptionID *string `json:"subscription_id,omitempty"`
	// Token is the token that was used to capture the payment of the transaction, if any
	Token *Token `json:"token,omitempty"`
	// TokenID is the iD of the token was used to capture the payment of the transaction, if any
	TokenID *string `json:"token_id,omitempty"`
	// Card is the card that was used to capture the payment of the transaction, if any
	Card *Card `json:"card,omitempty"`
	// CardID is the iD of the card that was used to capture the payment of the transaction, if any
	CardID *string `json:"card_id,omitempty"`
	// GatewayConfiguration is the gateway Configuration is the last gateway configuration that was used to process the payment, if any
	GatewayConfiguration *GatewayConfiguration `json:"gateway_configuration,omitempty"`
	// GatewayConfigurationID is the iD of the last gateway configuration that was used to process the payment, if any
	GatewayConfigurationID *string `json:"gateway_configuration_id,omitempty"`
	// Operations is the operations linked to the transaction
	Operations *[]*TransactionOperation `json:"operations,omitempty"`
	// Refunds is the list of the transaction refunds
	Refunds *[]*Refund `json:"refunds,omitempty"`
	// Name is the name of the transaction
	Name *string `json:"name,omitempty"`
	// Amount is the amount requested when creating the transaction
	Amount *string `json:"amount,omitempty"`
	// AmountLocal is the amount requested when creating the transaction, in the currency of the project
	AmountLocal *string `json:"amount_local,omitempty"`
	// AuthorizedAmount is the amount that was successfully authorized on the transaction
	AuthorizedAmount *string `json:"authorized_amount,omitempty"`
	// AuthorizedAmountLocal is the amount that was successfully authorized on the transaction, in the currency of the project
	AuthorizedAmountLocal *string `json:"authorized_amount_local,omitempty"`
	// CapturedAmount is the amount that was successfully captured on the transaction
	CapturedAmount *string `json:"captured_amount,omitempty"`
	// CapturedAmountLocal is the amount that was successfully captured on the transaction, in the currency of the project
	CapturedAmountLocal *string `json:"captured_amount_local,omitempty"`
	// RefundedAmount is the amount that was successfully refunded on the transaction
	RefundedAmount *string `json:"refunded_amount,omitempty"`
	// RefundedAmountLocal is the amount that was successfully refunded on the transaction, in the currency of the project
	RefundedAmountLocal *string `json:"refunded_amount_local,omitempty"`
	// AvailableAmount is the amount available on the transaction (captured - refunded)
	AvailableAmount *string `json:"available_amount,omitempty"`
	// AvailableAmountLocal is the amount available on the transaction (captured - refunded), in the currency of the project
	AvailableAmountLocal *string `json:"available_amount_local,omitempty"`
	// Currency is the currency of the transaction
	Currency *string `json:"currency,omitempty"`
	// ErrorCode is the error code of the transaction, when the payment has failed
	ErrorCode *string `json:"error_code,omitempty"`
	// GatewayName is the name of the last gateway the transaction was attempted on (successfully or not). Use the operations list to get the full transaction's history
	GatewayName *string `json:"gateway_name,omitempty"`
	// ThreeDSStatus is the status of the potential 3-D Secure authentication
	ThreeDSStatus *string `json:"three_d_s_status,omitempty"`
	// Status is the status of the transaction
	Status *string `json:"status,omitempty"`
	// Authorized is the whether the transaction was authorized or not
	Authorized *bool `json:"authorized,omitempty"`
	// Captured is the whether the transaction was captured or not
	Captured *bool `json:"captured,omitempty"`
	// Voided is the whether the transaction was voided or not
	Voided *bool `json:"voided,omitempty"`
	// Refunded is the whether the transaction was refunded or not
	Refunded *bool `json:"refunded,omitempty"`
	// Chargedback is the whether the transaction was charged back or not
	Chargedback *bool `json:"chargedback,omitempty"`
	// ReceivedFraudNotification is the whether the transaction received a fraud notification event or not
	ReceivedFraudNotification *bool `json:"received_fraud_notification,omitempty"`
	// ReceivedRetrievalRequest is the whether the transaction received a retrieval request event or not
	ReceivedRetrievalRequest *bool `json:"received_retrieval_request,omitempty"`
	// ProcessoutFee is the processOut fee applied on the transaction
	ProcessoutFee *string `json:"processout_fee,omitempty"`
	// EstimatedFee is the gateway fee estimated before processing the payment
	EstimatedFee *string `json:"estimated_fee,omitempty"`
	// GatewayFee is the fee taken by the payment gateway to process the payment
	GatewayFee *string `json:"gateway_fee,omitempty"`
	// GatewayFeeLocal is the fee taken by the payment gateway to process the payment, in the currency of the project
	GatewayFeeLocal *string `json:"gateway_fee_local,omitempty"`
	// CurrencyFee is the currency of the fee taken on the transaction (field `gateway_fee`)
	CurrencyFee *string `json:"currency_fee,omitempty"`
	// Metadata is the metadata related to the transaction, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// Sandbox is the define whether or not the transaction is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the transaction was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// ChargedbackAt is the date at which the transaction was charged back
	ChargedbackAt *time.Time `json:"chargedback_at,omitempty"`
	// RefundedAt is the date at which the transaction was refunded
	RefundedAt *time.Time `json:"refunded_at,omitempty"`
	// contains filtered or unexported fields
}

Transaction represents the Transaction API object

func (Transaction) All

func (s Transaction) All(options ...TransactionAllParameters) (*Iterator, error)

All allows you to get all the transactions.

func (Transaction) FetchRefunds

func (s Transaction) FetchRefunds(options ...TransactionFetchRefundsParameters) (*Iterator, error)

FetchRefunds allows you to get the transaction's refunds.

func (Transaction) Find

func (s Transaction) Find(transactionID string, options ...TransactionFindParameters) (*Transaction, error)

Find allows you to find a transaction by its ID.

func (Transaction) FindRefund

func (s Transaction) FindRefund(refundID string, options ...TransactionFindRefundParameters) (*Refund, error)

FindRefund allows you to find a transaction's refund by its ID.

func (*Transaction) GetID

func (s *Transaction) GetID() string

GetID implements the Identiable interface

func (*Transaction) Prefill

func (s *Transaction) Prefill(c *Transaction) *Transaction

Prefil prefills the object with data provided in the parameter

func (*Transaction) SetClient

func (s *Transaction) SetClient(c *ProcessOut) *Transaction

SetClient sets the client for the Transaction object and its children

type TransactionAllParameters

type TransactionAllParameters struct {
	*Options
	*Transaction
}

TransactionAllParameters is the structure representing the additional parameters used to call Transaction.All

type TransactionFetchRefundsParameters

type TransactionFetchRefundsParameters struct {
	*Options
	*Transaction
}

TransactionFetchRefundsParameters is the structure representing the additional parameters used to call Transaction.FetchRefunds

type TransactionFindParameters

type TransactionFindParameters struct {
	*Options
	*Transaction
}

TransactionFindParameters is the structure representing the additional parameters used to call Transaction.Find

type TransactionFindRefundParameters

type TransactionFindRefundParameters struct {
	*Options
	*Transaction
}

TransactionFindRefundParameters is the structure representing the additional parameters used to call Transaction.FindRefund

type TransactionOperation

type TransactionOperation struct {
	// ID is the iD of the transaction operation
	ID *string `json:"id,omitempty"`
	// Transaction is the transaction to which the operation belongs
	Transaction *Transaction `json:"transaction,omitempty"`
	// TransactionID is the iD of the transaction to which the operation belongs
	TransactionID *string `json:"transaction_id,omitempty"`
	// Token is the token that was used by the operation, if any
	Token *Token `json:"token,omitempty"`
	// TokenID is the iD of the token was used by the operation, if any
	TokenID *string `json:"token_id,omitempty"`
	// Card is the card that was used by the operation, if any
	Card *Card `json:"card,omitempty"`
	// CardID is the iD of the card that was used by the operation, if any
	CardID *string `json:"card_id,omitempty"`
	// GatewayConfiguration is the gateway configuration that was used to process the operation
	GatewayConfiguration *GatewayConfiguration `json:"gateway_configuration,omitempty"`
	// GatewayConfigurationID is the iD of the gateway configuration that was used to process the operation
	GatewayConfigurationID *string `json:"gateway_configuration_id,omitempty"`
	// Amount is the amount of the operation
	Amount *string `json:"amount,omitempty"`
	// Currency is the currency of the operation
	Currency *string `json:"currency,omitempty"`
	// IsAttempt is the true if the operation is an attempt, false otherwise
	IsAttempt *bool `json:"is_attempt,omitempty"`
	// HasFailed is the true if the operation has failed, false otherwise
	HasFailed *bool `json:"has_failed,omitempty"`
	// IsAccountable is the true if the operation amount can be accounted for, false otherwise
	IsAccountable *bool `json:"is_accountable,omitempty"`
	// Type is the type of the operation, such as authorization, capture, refund or void
	Type *string `json:"type,omitempty"`
	// GatewayOperationID is the iD of the operation done through the PSP
	GatewayOperationID *string `json:"gateway_operation_id,omitempty"`
	// Arn is the acquirer Routing Number, can be used to track a payment or refund at the issuer
	Arn *string `json:"arn,omitempty"`
	// ErrorCode is the error code returned when attempting the operation, if any
	ErrorCode *string `json:"error_code,omitempty"`
	// GatewayData is the additionnal context saved when processing the transaction on the specific PSP
	GatewayData *map[string]string `json:"gateway_data,omitempty"`
	// PaymentDataThreeDSRequest is the threeDS request payment data (read-only)
	PaymentDataThreeDSRequest *PaymentDataThreeDSRequest `json:"payment_data_three_d_s_request,omitempty"`
	// PaymentDataThreeDSAuthentication is the 3-D Secure authentication payment data (read-only)
	PaymentDataThreeDSAuthentication *PaymentDataThreeDSAuthentication `json:"payment_data_three_d_s_authentication,omitempty"`
	// PaymentDataNetworkAuthentication is the network authentication payment data (read-only)
	PaymentDataNetworkAuthentication *PaymentDataNetworkAuthentication `json:"payment_data_network_authentication,omitempty"`
	// Metadata is the metadata related to the operation, in the form of a dictionary (key-value pair)
	Metadata *map[string]string `json:"metadata,omitempty"`
	// GatewayFee is the gateway fee generated by the operation
	GatewayFee *string `json:"gateway_fee,omitempty"`
	// CreatedAt is the date at which the operation was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

TransactionOperation represents the TransactionOperation API object

func (*TransactionOperation) GetID

func (s *TransactionOperation) GetID() string

GetID implements the Identiable interface

func (*TransactionOperation) Prefill

Prefil prefills the object with data provided in the parameter

func (*TransactionOperation) SetClient

SetClient sets the client for the TransactionOperation object and its children

type Webhook added in v1.3.0

type Webhook struct {
	// ID is the iD of the webhook
	ID *string `json:"id,omitempty"`
	// Project is the project to which the webhook belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the webhook belongs
	ProjectID *string `json:"project_id,omitempty"`
	// Event is the event the webhook is linked to
	Event *Event `json:"event,omitempty"`
	// EventID is the iD of the event the webhook is linked to
	EventID *string `json:"event_id,omitempty"`
	// RequestURL is the uRL to which the webhook will be posted
	RequestURL *string `json:"request_url,omitempty"`
	// RequestMethod is the method used to send the webhook (GET or POST)
	RequestMethod *string `json:"request_method,omitempty"`
	// ResponseBody is the the response body the webhook received when sending its payload
	ResponseBody *string `json:"response_body,omitempty"`
	// ResponseCode is the the response code the webhook received when sending its payload
	ResponseCode *string `json:"response_code,omitempty"`
	// ResponseHeaders is the the response headers the webhook received when sending its payload
	ResponseHeaders *string `json:"response_headers,omitempty"`
	// ResponseTimeMs is the the time it took for the webhook to send its payload
	ResponseTimeMs *int `json:"response_time_ms,omitempty"`
	// Status is the the status of the webhook. Either delivered or failed
	Status *string `json:"status,omitempty"`
	// CreatedAt is the date at which the webhook was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// ReleaseAt is the date at webhook will be/is released
	ReleaseAt *time.Time `json:"release_at,omitempty"`
	// contains filtered or unexported fields
}

Webhook represents the Webhook API object

func (*Webhook) GetID

func (s *Webhook) GetID() string

GetID implements the Identiable interface

func (*Webhook) Prefill

func (s *Webhook) Prefill(c *Webhook) *Webhook

Prefil prefills the object with data provided in the parameter

func (*Webhook) SetClient

func (s *Webhook) SetClient(c *ProcessOut) *Webhook

SetClient sets the client for the Webhook object and its children

type WebhookEndpoint

type WebhookEndpoint struct {
	// ID is the iD of the webhook endpoint
	ID *string `json:"id,omitempty"`
	// Project is the project to which the webhook endpoint belongs
	Project *Project `json:"project,omitempty"`
	// ProjectID is the iD of the project to which the webhook belongs
	ProjectID *string `json:"project_id,omitempty"`
	// URL is the uRL to which the webhook endpoint points to
	URL *string `json:"url,omitempty"`
	// EventsWhitelist is the slice of string representing the whitelisted events posted to the endpoint
	EventsWhitelist interface{} `json:"events_whitelist,omitempty"`
	// Sandbox is the define whether or not the webhook endpoint is in sandbox environment
	Sandbox *bool `json:"sandbox,omitempty"`
	// CreatedAt is the date at which the webhook endpoint was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

WebhookEndpoint represents the WebhookEndpoint API object

func (*WebhookEndpoint) GetID

func (s *WebhookEndpoint) GetID() string

GetID implements the Identiable interface

func (*WebhookEndpoint) Prefill

Prefil prefills the object with data provided in the parameter

func (*WebhookEndpoint) SetClient

func (s *WebhookEndpoint) SetClient(c *ProcessOut) *WebhookEndpoint

SetClient sets the client for the WebhookEndpoint object and its children

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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