gocardless

package module
v2.0.0-...-52b5c14 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 20 Imported by: 0

README

Go Client Library for GoCardless Pro API CircleCI

This library provides a simple wrapper around the GoCardless API.

Getting started

Make sure your project is using Go Modules (it will have a go.mod file in its root if it already is):

go mod init
go mod tidy

Then, reference gocardless-pro-go in a Go program with import:

import (
    gocardless "github.com/gocardless/gocardless-pro-go/v2"
)

Run any of the normal go commands (build/install/test). The Go toolchain will resolve and fetch the gocardless-pro-go module automatically.

Alternatively, you can also explicitly go get the package into a project:

go get -u github.com/gocardless/gocardless-pro-go@v2.7.0

Initializing the client

The client is initialised with an access token, and is configured to use GoCardless live environment by default:

    token := "your_access_token"
    config, err := gocardless.NewConfig(token)
    if err != nil {
        fmt.Printf("got err in initialising config: %s", err.Error())
        return
    }
    client, err := gocardless.New(config)
    if err != nil {
		fmt.Printf("error in initialisating client: %s", err.Error())
		return
	}

Optionally, the client can be customised with endpoint, for ex: sandbox environment

    config, err := gocardless.NewConfig(token, gocardless.WithEndpoint(gocardless.SandboxEndpoint))
    if err != nil {
        fmt.Printf("got err in initialising config: %s", err.Error())
        return
    }
    client, err := gocardless.New(config)
    if err != nil {
		fmt.Printf("error in initialisating client: %s", err.Error())
		return
	}

the client can also be initialised with a customised http client, for ex;

    customHttpClient := &http.Client{
        Timeout: time.Second * 10,
    }
    config, err := gocardless.NewConfig(token, gocardless.WithClient(customHttpClient))
    if err != nil {
        fmt.Printf("got err in initialising config: %s", err.Error())
        return
    }
    client, err := gocardless.New(config)
    if err != nil {
		fmt.Printf("error in initialisating client: %s", err.Error())
		return
	}

Examples

Fetching resources

To fetch single item, use the Get method

    ctx := context.TODO()
    customer, err := client.Customers.Get(ctx, "CU123")
Listing resources

To fetch items in a collection, there are two options:

  • Fetching items one page at a time using List method:
    ctx := context.TODO()
    customerListParams := gocardless.CustomerListParams{}
    customers, err := client.Customers.List(ctx, customerListParams)
    for _, customer := range customers.Customers {
        fmt.Printf("customer: %v", customer)
    }
    cursor := customers.Meta.Cursors.After
    customerListParams.After = cursor
    nextPageCustomers, err := client.Customers.List(ctx, customerRemoveParams)
  • Iterating through all of the items using a All method to get a lazily paginated list. All will deal with making extra API requests to paginate through all the data for you:
    ctx := context.TODO()
    customerListParams := gocardless.CustomerListParams{}
    customerListIterator := client.Customers.All(ctx, customerListParams)
    for customerListIterator.Next() {
        customerListResult, err := customerListIterator.Value(ctx)
        if err != nil {
            fmt.Printf("got err: %s", err.Error())
        } else {
            fmt.Printf("customerListResult is %v", customerListResult)
        }
    }
Creating resources

Resources can be created with the Create method:

    ctx := context.TODO()
    customerCreateParams := gocardless.CustomerCreateParams{
        AddressLine1: "9 Acer Gardens"
        City:         "Birmingham",
        PostalCode:   "B4 7NJ",
        CountryCode:  "GB",
        Email:        "bbr@example.com",
        GivenName:    "Bender Bending",
        FamilyName:   "Rodgriguez",
    }

    customer, err := client.Customers.Create(ctx, customerCreateParams)
Updating Resources

Resources can be updates with the Update method:

    ctx := context.TODO()
    customerUpdateParams := CustomerUpdateParams{
        GivenName: "New Name",
    }

    customer, err := client.Customers.Update(ctx, "CU123", customerUpdateParams)
Removing Resources

Resources can be removed with the Remove method:

    ctx := context.TODO()
    customerRemoveParams := CustomerRemoveParams{}

    customer, err := client.Customers.Remove(ctx, "CU123", customerRemoveParams)
Retrying requests

The library will attempt to retry most failing requests automatically (with the exception of those which are not safe to retry).

GET requests are considered safe to retry, and will be retried automatically. Certain POST requests are made safe to retry by the use of an idempotency key, generated automatically by the library, so we'll automatically retry these too. Currently its retried for 3 times. If you want to override this behaviour(for example, to provide your own retry mechanism), then you can use the WithoutRetries. This will not retry and return response object.

    requestOption := gocardless.WithoutRetries()
    customersCreateResult, err := client.Customers.Create(ctx, customerCreateParams, requestOption)
Setting custom headers

You shouldn't generally need to customise the headers sent by the library, but you wish to in some cases (for example if you want to send an Accept-Language header when creating a mandate PDF).

    headers := make(map[string]string)
    headers["Accept-Language"] = "fr"
    requestOption := gocardless.WithHeaders(headers)
    customersCreateResult, err := client.Customers.Create(ctx, customerCreateParams, requestOption)

Custom headers you specify will override any headers generated by the library itself (for example, an Idempotency-Key header with a randomly-generated value or one you've configured manually). Custom headers always take precedence.

    requestOption := gocardless.WithIdempotencyKey("test-idemptency-key-123")
    customersCreateResult, err := client.Customers.Create(ctx, customerCreateParams, requestOption)
Handling webhooks

GoCardless supports webhooks, allowing you to receive real-time notifications when things happen in your account, so you can take automatic actions in response, for example:

  • When a customer cancels their mandate with the bank, suspend their club membership
  • When a payment fails due to lack of funds, mark their invoice as unpaid
  • When a customer’s subscription generates a new payment, log it in their “past payments” list

The client allows you to validate that a webhook you receive is genuinely from GoCardless, and to parse it into Event objects(defined in event_service.go) which are easy to work with:

    http.HandleFunc("/webhookEndpoint", func(w http.ResponseWriter, r *http.Request) {
        wh, err := NewWebhookHandler("secret", EventHandlerFunc(func(event gocardless.Event) error {
		    parseEvent(event)
        }))
        wh.ServeHTTP(w,r)
    })

    func parseEvents(event Event) {
        // work through list of events
    }
Error Handling

When the library returns an error defined by us rather than the stdlib, it can be converted into a gocardless.APIError using errors.As:

    billingRequest, err := client.BillingRequests.Create(ctx, billingRequestCreateParams)
	if err != nil {
		var apiErr *gocardless.APIError
		if errors.As(err, &apiErr) {
			fmt.Printf("got err: %v", apiErr.Message)
		}
		return nil, err
	}

Compatibility

This library requires go 1.16 and above.

Documentation

TODO

Contributing

This client is auto-generated from Crank, a toolchain that we hope to soon open source. Issues should for now be reported on this repository. Please do not modify the source code yourself, your changes will be overridden!

Documentation

Index

Constants

View Source
const (

	// Live environment
	LiveEndpoint = "https://api.gocardless.com"

	// Sandbox environment
	SandboxEndpoint = "https://api-sandbox.gocardless.com"
)

Variables

This section is empty.

Functions

func NewIdempotencyKey

func NewIdempotencyKey() string

NewIdempotencyKey generates a random and unique idempotency key

Types

type APIError

type APIError struct {
	Message          string            `json:"message"`
	DocumentationUrl string            `json:"documentation_url"`
	Type             string            `json:"type"`
	RequestID        string            `json:"request_id"`
	Errors           []ValidationError `json:"errors"`
	Code             int               `json:"code"`
}

func (*APIError) Error

func (err *APIError) Error() string

type BankAuthorisation

type BankAuthorisation struct {
	AuthorisationType string                  `url:"authorisation_type,omitempty" json:"authorisation_type,omitempty"`
	AuthorisedAt      string                  `url:"authorised_at,omitempty" json:"authorised_at,omitempty"`
	CreatedAt         string                  `url:"created_at,omitempty" json:"created_at,omitempty"`
	ExpiresAt         string                  `url:"expires_at,omitempty" json:"expires_at,omitempty"`
	Id                string                  `url:"id,omitempty" json:"id,omitempty"`
	LastVisitedAt     string                  `url:"last_visited_at,omitempty" json:"last_visited_at,omitempty"`
	Links             *BankAuthorisationLinks `url:"links,omitempty" json:"links,omitempty"`
	RedirectUri       string                  `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
	Url               string                  `url:"url,omitempty" json:"url,omitempty"`
}

BankAuthorisation model

type BankAuthorisationCreateParams

type BankAuthorisationCreateParams struct {
	AuthorisationType string                             `url:"authorisation_type,omitempty" json:"authorisation_type,omitempty"`
	Links             BankAuthorisationCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	RedirectUri       string                             `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
}

BankAuthorisationCreateParams parameters

type BankAuthorisationCreateParamsLinks struct {
	BillingRequest string `url:"billing_request,omitempty" json:"billing_request,omitempty"`
	Institution    string `url:"institution,omitempty" json:"institution,omitempty"`
}
type BankAuthorisationLinks struct {
	BillingRequest string `url:"billing_request,omitempty" json:"billing_request,omitempty"`
	Institution    string `url:"institution,omitempty" json:"institution,omitempty"`
}

type BankAuthorisationService

type BankAuthorisationService interface {
	Get(ctx context.Context, identity string, opts ...RequestOption) (*BankAuthorisation, error)
	Create(ctx context.Context, p BankAuthorisationCreateParams, opts ...RequestOption) (*BankAuthorisation, error)
}

type BankAuthorisationServiceImpl

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

BankAuthorisationService manages bank_authorisations

func (*BankAuthorisationServiceImpl) Create

Create Create a Bank Authorisation.

func (*BankAuthorisationServiceImpl) Get

Get Fetches a bank authorisation

type BankDetailsLookup

type BankDetailsLookup struct {
	AvailableDebitSchemes []string `url:"available_debit_schemes,omitempty" json:"available_debit_schemes,omitempty"`
	BankName              string   `url:"bank_name,omitempty" json:"bank_name,omitempty"`
	Bic                   string   `url:"bic,omitempty" json:"bic,omitempty"`
}

BankDetailsLookup model

type BankDetailsLookupCreateParams

type BankDetailsLookupCreateParams struct {
	AccountNumber string `url:"account_number,omitempty" json:"account_number,omitempty"`
	BankCode      string `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode    string `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode   string `url:"country_code,omitempty" json:"country_code,omitempty"`
	Iban          string `url:"iban,omitempty" json:"iban,omitempty"`
}

BankDetailsLookupCreateParams parameters

type BankDetailsLookupService

type BankDetailsLookupService interface {
	Create(ctx context.Context, p BankDetailsLookupCreateParams, opts ...RequestOption) (*BankDetailsLookup, error)
}

type BankDetailsLookupServiceImpl

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

BankDetailsLookupService manages bank_details_lookups

func (*BankDetailsLookupServiceImpl) Create

Create Performs a bank details lookup. As part of the lookup, a modulus check and reachability check are performed.

If your request returns an [error](#api-usage-errors) or the `available_debit_schemes` attribute is an empty array, you will not be able to collect payments from the specified bank account. GoCardless may be able to collect payments from an account even if no `bic` is returned.

Bank account details may be supplied using [local details](#appendix-local-bank-details) or an IBAN.

_ACH scheme_ For compliance reasons, an extra validation step is done using a third-party provider to make sure the customer's bank account can accept Direct Debit. If a bank account is discovered to be closed or invalid, the customer is requested to adjust the account number/routing number and succeed in this check to continue with the flow.

_Note:_ Usage of this endpoint is monitored. If your organisation relies on GoCardless for modulus or reachability checking but not for payment collection, please get in touch.

type BillingRequest

type BillingRequest struct {
	Actions         []BillingRequestActions       `url:"actions,omitempty" json:"actions,omitempty"`
	CreatedAt       string                        `url:"created_at,omitempty" json:"created_at,omitempty"`
	FallbackEnabled bool                          `url:"fallback_enabled,omitempty" json:"fallback_enabled,omitempty"`
	Id              string                        `url:"id,omitempty" json:"id,omitempty"`
	Links           *BillingRequestLinks          `url:"links,omitempty" json:"links,omitempty"`
	MandateRequest  *BillingRequestMandateRequest `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
	Metadata        map[string]interface{}        `url:"metadata,omitempty" json:"metadata,omitempty"`
	PaymentRequest  *BillingRequestPaymentRequest `url:"payment_request,omitempty" json:"payment_request,omitempty"`
	Resources       *BillingRequestResources      `url:"resources,omitempty" json:"resources,omitempty"`
	Status          string                        `url:"status,omitempty" json:"status,omitempty"`
}

BillingRequest model

type BillingRequestActions

type BillingRequestActions struct {
	AvailableCurrencies    *[]string                                    `url:"available_currencies,omitempty" json:"available_currencies,omitempty"`
	BankAuthorisation      *BillingRequestActionsBankAuthorisation      `url:"bank_authorisation,omitempty" json:"bank_authorisation,omitempty"`
	CollectCustomerDetails *BillingRequestActionsCollectCustomerDetails `url:"collect_customer_details,omitempty" json:"collect_customer_details,omitempty"`
	CompletesActions       []string                                     `url:"completes_actions,omitempty" json:"completes_actions,omitempty"`
	Required               bool                                         `url:"required,omitempty" json:"required,omitempty"`
	RequiresActions        []string                                     `url:"requires_actions,omitempty" json:"requires_actions,omitempty"`
	Status                 string                                       `url:"status,omitempty" json:"status,omitempty"`
	Type                   string                                       `url:"type,omitempty" json:"type,omitempty"`
}

type BillingRequestActionsAvailableCurrencies

type BillingRequestActionsAvailableCurrencies struct {
	Currency string `url:"currency,omitempty" json:"currency,omitempty"`
}

type BillingRequestActionsBankAuthorisation

type BillingRequestActionsBankAuthorisation struct {
	Adapter             string `url:"adapter,omitempty" json:"adapter,omitempty"`
	AuthorisationType   string `url:"authorisation_type,omitempty" json:"authorisation_type,omitempty"`
	RequiresInstitution bool   `url:"requires_institution,omitempty" json:"requires_institution,omitempty"`
}

type BillingRequestActionsCollectCustomerDetails

type BillingRequestActionsCollectCustomerDetails struct {
	DefaultCountryCode string `url:"default_country_code,omitempty" json:"default_country_code,omitempty"`
}

type BillingRequestCancelParams

type BillingRequestCancelParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

BillingRequestCancelParams parameters

type BillingRequestChooseCurrencyParams

type BillingRequestChooseCurrencyParams struct {
	Currency string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

BillingRequestChooseCurrencyParams parameters

type BillingRequestCollectBankAccountParams

type BillingRequestCollectBankAccountParams struct {
	AccountHolderName   string                 `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber       string                 `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountNumberSuffix string                 `url:"account_number_suffix,omitempty" json:"account_number_suffix,omitempty"`
	AccountType         string                 `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankCode            string                 `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode          string                 `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode         string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency            string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Iban                string                 `url:"iban,omitempty" json:"iban,omitempty"`
	Metadata            map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

BillingRequestCollectBankAccountParams parameters

type BillingRequestCollectCustomerDetailsParams

type BillingRequestCollectCustomerDetailsParams struct {
	Customer              *BillingRequestCollectCustomerDetailsParamsCustomer              `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBillingDetail *BillingRequestCollectCustomerDetailsParamsCustomerBillingDetail `url:"customer_billing_detail,omitempty" json:"customer_billing_detail,omitempty"`
}

BillingRequestCollectCustomerDetailsParams parameters

type BillingRequestCollectCustomerDetailsParamsCustomer

type BillingRequestCollectCustomerDetailsParamsCustomer struct {
	CompanyName string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	Email       string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName  string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName   string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Language    string                 `url:"language,omitempty" json:"language,omitempty"`
	Metadata    map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PhoneNumber string                 `url:"phone_number,omitempty" json:"phone_number,omitempty"`
}

type BillingRequestCollectCustomerDetailsParamsCustomerBillingDetail

type BillingRequestCollectCustomerDetailsParamsCustomerBillingDetail struct {
	AddressLine1          string `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string `url:"city,omitempty" json:"city,omitempty"`
	CountryCode           string `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	IpAddress             string `url:"ip_address,omitempty" json:"ip_address,omitempty"`
	PostalCode            string `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type BillingRequestConfirmPayerDetailsParams

type BillingRequestConfirmPayerDetailsParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

BillingRequestConfirmPayerDetailsParams parameters

type BillingRequestCreateParams

type BillingRequestCreateParams struct {
	FallbackEnabled bool                                      `url:"fallback_enabled,omitempty" json:"fallback_enabled,omitempty"`
	Links           *BillingRequestCreateParamsLinks          `url:"links,omitempty" json:"links,omitempty"`
	MandateRequest  *BillingRequestCreateParamsMandateRequest `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
	Metadata        map[string]interface{}                    `url:"metadata,omitempty" json:"metadata,omitempty"`
	PaymentRequest  *BillingRequestCreateParamsPaymentRequest `url:"payment_request,omitempty" json:"payment_request,omitempty"`
}

BillingRequestCreateParams parameters

type BillingRequestCreateParamsLinks struct {
	Creditor            string `url:"creditor,omitempty" json:"creditor,omitempty"`
	Customer            string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
}

type BillingRequestCreateParamsMandateRequest

type BillingRequestCreateParamsMandateRequest struct {
	Constraints *BillingRequestCreateParamsMandateRequestConstraints `url:"constraints,omitempty" json:"constraints,omitempty"`
	Currency    string                                               `url:"currency,omitempty" json:"currency,omitempty"`
	Description string                                               `url:"description,omitempty" json:"description,omitempty"`
	Metadata    map[string]interface{}                               `url:"metadata,omitempty" json:"metadata,omitempty"`
	Reference   string                                               `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme      string                                               `url:"scheme,omitempty" json:"scheme,omitempty"`
	Verify      string                                               `url:"verify,omitempty" json:"verify,omitempty"`
}

type BillingRequestCreateParamsMandateRequestConstraints

type BillingRequestCreateParamsMandateRequestConstraints struct {
	EndDate             string                                                              `url:"end_date,omitempty" json:"end_date,omitempty"`
	MaxAmountPerPayment int                                                                 `url:"max_amount_per_payment,omitempty" json:"max_amount_per_payment,omitempty"`
	PeriodicLimits      []BillingRequestCreateParamsMandateRequestConstraintsPeriodicLimits `url:"periodic_limits,omitempty" json:"periodic_limits,omitempty"`
	StartDate           string                                                              `url:"start_date,omitempty" json:"start_date,omitempty"`
}

type BillingRequestCreateParamsMandateRequestConstraintsPeriodicLimits

type BillingRequestCreateParamsMandateRequestConstraintsPeriodicLimits struct {
	Alignment      string `url:"alignment,omitempty" json:"alignment,omitempty"`
	MaxPayments    int    `url:"max_payments,omitempty" json:"max_payments,omitempty"`
	MaxTotalAmount int    `url:"max_total_amount,omitempty" json:"max_total_amount,omitempty"`
	Period         string `url:"period,omitempty" json:"period,omitempty"`
}

type BillingRequestCreateParamsPaymentRequest

type BillingRequestCreateParamsPaymentRequest struct {
	Amount      int                    `url:"amount,omitempty" json:"amount,omitempty"`
	AppFee      int                    `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Currency    string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Description string                 `url:"description,omitempty" json:"description,omitempty"`
	Metadata    map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	Scheme      string                 `url:"scheme,omitempty" json:"scheme,omitempty"`
}

type BillingRequestFallbackParams

type BillingRequestFallbackParams struct {
}

BillingRequestFallbackParams parameters

type BillingRequestFlow

type BillingRequestFlow struct {
	AuthorisationUrl     string                                  `url:"authorisation_url,omitempty" json:"authorisation_url,omitempty"`
	AutoFulfil           bool                                    `url:"auto_fulfil,omitempty" json:"auto_fulfil,omitempty"`
	CreatedAt            string                                  `url:"created_at,omitempty" json:"created_at,omitempty"`
	ExitUri              string                                  `url:"exit_uri,omitempty" json:"exit_uri,omitempty"`
	ExpiresAt            string                                  `url:"expires_at,omitempty" json:"expires_at,omitempty"`
	Id                   string                                  `url:"id,omitempty" json:"id,omitempty"`
	Language             string                                  `url:"language,omitempty" json:"language,omitempty"`
	Links                *BillingRequestFlowLinks                `url:"links,omitempty" json:"links,omitempty"`
	LockBankAccount      bool                                    `url:"lock_bank_account,omitempty" json:"lock_bank_account,omitempty"`
	LockCurrency         bool                                    `url:"lock_currency,omitempty" json:"lock_currency,omitempty"`
	LockCustomerDetails  bool                                    `url:"lock_customer_details,omitempty" json:"lock_customer_details,omitempty"`
	PrefilledBankAccount *BillingRequestFlowPrefilledBankAccount `url:"prefilled_bank_account,omitempty" json:"prefilled_bank_account,omitempty"`
	PrefilledCustomer    *BillingRequestFlowPrefilledCustomer    `url:"prefilled_customer,omitempty" json:"prefilled_customer,omitempty"`
	RedirectUri          string                                  `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
	SessionToken         string                                  `url:"session_token,omitempty" json:"session_token,omitempty"`
	ShowRedirectButtons  bool                                    `url:"show_redirect_buttons,omitempty" json:"show_redirect_buttons,omitempty"`
}

BillingRequestFlow model

type BillingRequestFlowCreateParams

type BillingRequestFlowCreateParams struct {
	AutoFulfil           bool                                                `url:"auto_fulfil,omitempty" json:"auto_fulfil,omitempty"`
	ExitUri              string                                              `url:"exit_uri,omitempty" json:"exit_uri,omitempty"`
	Language             string                                              `url:"language,omitempty" json:"language,omitempty"`
	Links                BillingRequestFlowCreateParamsLinks                 `url:"links,omitempty" json:"links,omitempty"`
	LockBankAccount      bool                                                `url:"lock_bank_account,omitempty" json:"lock_bank_account,omitempty"`
	LockCurrency         bool                                                `url:"lock_currency,omitempty" json:"lock_currency,omitempty"`
	LockCustomerDetails  bool                                                `url:"lock_customer_details,omitempty" json:"lock_customer_details,omitempty"`
	PrefilledBankAccount *BillingRequestFlowCreateParamsPrefilledBankAccount `url:"prefilled_bank_account,omitempty" json:"prefilled_bank_account,omitempty"`
	PrefilledCustomer    *BillingRequestFlowCreateParamsPrefilledCustomer    `url:"prefilled_customer,omitempty" json:"prefilled_customer,omitempty"`
	RedirectUri          string                                              `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
	ShowRedirectButtons  bool                                                `url:"show_redirect_buttons,omitempty" json:"show_redirect_buttons,omitempty"`
}

BillingRequestFlowCreateParams parameters

type BillingRequestFlowCreateParamsLinks struct {
	BillingRequest string `url:"billing_request,omitempty" json:"billing_request,omitempty"`
}

type BillingRequestFlowCreateParamsPrefilledBankAccount

type BillingRequestFlowCreateParamsPrefilledBankAccount struct {
	AccountType string `url:"account_type,omitempty" json:"account_type,omitempty"`
}

type BillingRequestFlowCreateParamsPrefilledCustomer

type BillingRequestFlowCreateParamsPrefilledCustomer struct {
	AddressLine1          string `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string `url:"given_name,omitempty" json:"given_name,omitempty"`
	PostalCode            string `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type BillingRequestFlowInitialiseParams

type BillingRequestFlowInitialiseParams struct {
}

BillingRequestFlowInitialiseParams parameters

type BillingRequestFlowLinks struct {
	BillingRequest string `url:"billing_request,omitempty" json:"billing_request,omitempty"`
}

type BillingRequestFlowPrefilledBankAccount

type BillingRequestFlowPrefilledBankAccount struct {
	AccountType string `url:"account_type,omitempty" json:"account_type,omitempty"`
}

type BillingRequestFlowPrefilledCustomer

type BillingRequestFlowPrefilledCustomer struct {
	AddressLine1          string `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string `url:"given_name,omitempty" json:"given_name,omitempty"`
	PostalCode            string `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type BillingRequestFlowService

type BillingRequestFlowService interface {
	Create(ctx context.Context, p BillingRequestFlowCreateParams, opts ...RequestOption) (*BillingRequestFlow, error)
	Initialise(ctx context.Context, identity string, p BillingRequestFlowInitialiseParams, opts ...RequestOption) (*BillingRequestFlow, error)
}

type BillingRequestFlowServiceImpl

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

BillingRequestFlowService manages billing_request_flows

func (*BillingRequestFlowServiceImpl) Create

Create Creates a new billing request flow.

func (*BillingRequestFlowServiceImpl) Initialise

Initialise Returns the flow having generated a fresh session token which can be used to power integrations that manipulate the flow.

type BillingRequestFulfilParams

type BillingRequestFulfilParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

BillingRequestFulfilParams parameters

type BillingRequestLinks struct {
	BankAuthorisation     string `url:"bank_authorisation,omitempty" json:"bank_authorisation,omitempty"`
	Creditor              string `url:"creditor,omitempty" json:"creditor,omitempty"`
	Customer              string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount   string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	CustomerBillingDetail string `url:"customer_billing_detail,omitempty" json:"customer_billing_detail,omitempty"`
	MandateRequest        string `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
	MandateRequestMandate string `url:"mandate_request_mandate,omitempty" json:"mandate_request_mandate,omitempty"`
	Organisation          string `url:"organisation,omitempty" json:"organisation,omitempty"`
	PaymentRequest        string `url:"payment_request,omitempty" json:"payment_request,omitempty"`
	PaymentRequestPayment string `url:"payment_request_payment,omitempty" json:"payment_request_payment,omitempty"`
}

type BillingRequestListPagingIterator

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

func (*BillingRequestListPagingIterator) Next

func (*BillingRequestListPagingIterator) Value

type BillingRequestListParams

type BillingRequestListParams struct {
	After     string `url:"after,omitempty" json:"after,omitempty"`
	Before    string `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt string `url:"created_at,omitempty" json:"created_at,omitempty"`
	Customer  string `url:"customer,omitempty" json:"customer,omitempty"`
	Limit     int    `url:"limit,omitempty" json:"limit,omitempty"`
	Status    string `url:"status,omitempty" json:"status,omitempty"`
}

BillingRequestListParams parameters

type BillingRequestListResult

type BillingRequestListResult struct {
	BillingRequests []BillingRequest             `json:"billing_requests"`
	Meta            BillingRequestListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type BillingRequestListResultMeta

type BillingRequestListResultMeta struct {
	Cursors *BillingRequestListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                  `url:"limit,omitempty" json:"limit,omitempty"`
}

type BillingRequestListResultMetaCursors

type BillingRequestListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type BillingRequestMandateRequest

type BillingRequestMandateRequest struct {
	Constraints *BillingRequestMandateRequestConstraints `url:"constraints,omitempty" json:"constraints,omitempty"`
	Currency    string                                   `url:"currency,omitempty" json:"currency,omitempty"`
	Description string                                   `url:"description,omitempty" json:"description,omitempty"`
	Links       *BillingRequestMandateRequestLinks       `url:"links,omitempty" json:"links,omitempty"`
	Metadata    map[string]interface{}                   `url:"metadata,omitempty" json:"metadata,omitempty"`
	Scheme      string                                   `url:"scheme,omitempty" json:"scheme,omitempty"`
	Verify      string                                   `url:"verify,omitempty" json:"verify,omitempty"`
}

type BillingRequestMandateRequestConstraints

type BillingRequestMandateRequestConstraints struct {
	EndDate             string                                                  `url:"end_date,omitempty" json:"end_date,omitempty"`
	MaxAmountPerPayment int                                                     `url:"max_amount_per_payment,omitempty" json:"max_amount_per_payment,omitempty"`
	PeriodicLimits      []BillingRequestMandateRequestConstraintsPeriodicLimits `url:"periodic_limits,omitempty" json:"periodic_limits,omitempty"`
	StartDate           string                                                  `url:"start_date,omitempty" json:"start_date,omitempty"`
}

type BillingRequestMandateRequestConstraintsPeriodicLimits

type BillingRequestMandateRequestConstraintsPeriodicLimits struct {
	Alignment      string `url:"alignment,omitempty" json:"alignment,omitempty"`
	MaxPayments    int    `url:"max_payments,omitempty" json:"max_payments,omitempty"`
	MaxTotalAmount int    `url:"max_total_amount,omitempty" json:"max_total_amount,omitempty"`
	Period         string `url:"period,omitempty" json:"period,omitempty"`
}
type BillingRequestMandateRequestLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type BillingRequestNotifyParams

type BillingRequestNotifyParams struct {
	NotificationType string `url:"notification_type,omitempty" json:"notification_type,omitempty"`
	RedirectUri      string `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
}

BillingRequestNotifyParams parameters

type BillingRequestPaymentRequest

type BillingRequestPaymentRequest struct {
	Amount      int                                `url:"amount,omitempty" json:"amount,omitempty"`
	AppFee      int                                `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Currency    string                             `url:"currency,omitempty" json:"currency,omitempty"`
	Description string                             `url:"description,omitempty" json:"description,omitempty"`
	Links       *BillingRequestPaymentRequestLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata    map[string]interface{}             `url:"metadata,omitempty" json:"metadata,omitempty"`
	Scheme      string                             `url:"scheme,omitempty" json:"scheme,omitempty"`
}
type BillingRequestPaymentRequestLinks struct {
	Payment string `url:"payment,omitempty" json:"payment,omitempty"`
}

type BillingRequestResources

type BillingRequestResources struct {
	Customer              *BillingRequestResourcesCustomer              `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount   *BillingRequestResourcesCustomerBankAccount   `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	CustomerBillingDetail *BillingRequestResourcesCustomerBillingDetail `url:"customer_billing_detail,omitempty" json:"customer_billing_detail,omitempty"`
}

type BillingRequestResourcesCustomer

type BillingRequestResourcesCustomer struct {
	CompanyName string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CreatedAt   string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Email       string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName  string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName   string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Id          string                 `url:"id,omitempty" json:"id,omitempty"`
	Language    string                 `url:"language,omitempty" json:"language,omitempty"`
	Metadata    map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PhoneNumber string                 `url:"phone_number,omitempty" json:"phone_number,omitempty"`
}

type BillingRequestResourcesCustomerBankAccount

type BillingRequestResourcesCustomerBankAccount struct {
	AccountHolderName   string                                           `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumberEnding string                                           `url:"account_number_ending,omitempty" json:"account_number_ending,omitempty"`
	AccountType         string                                           `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankName            string                                           `url:"bank_name,omitempty" json:"bank_name,omitempty"`
	CountryCode         string                                           `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreatedAt           string                                           `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency            string                                           `url:"currency,omitempty" json:"currency,omitempty"`
	Enabled             bool                                             `url:"enabled,omitempty" json:"enabled,omitempty"`
	Id                  string                                           `url:"id,omitempty" json:"id,omitempty"`
	Links               *BillingRequestResourcesCustomerBankAccountLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata            map[string]interface{}                           `url:"metadata,omitempty" json:"metadata,omitempty"`
}
type BillingRequestResourcesCustomerBankAccountLinks struct {
	Customer string `url:"customer,omitempty" json:"customer,omitempty"`
}

type BillingRequestResourcesCustomerBillingDetail

type BillingRequestResourcesCustomerBillingDetail struct {
	AddressLine1          string   `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string   `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string   `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string   `url:"city,omitempty" json:"city,omitempty"`
	CountryCode           string   `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreatedAt             string   `url:"created_at,omitempty" json:"created_at,omitempty"`
	DanishIdentityNumber  string   `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Id                    string   `url:"id,omitempty" json:"id,omitempty"`
	IpAddress             string   `url:"ip_address,omitempty" json:"ip_address,omitempty"`
	PostalCode            string   `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string   `url:"region,omitempty" json:"region,omitempty"`
	Schemes               []string `url:"schemes,omitempty" json:"schemes,omitempty"`
	SwedishIdentityNumber string   `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type BillingRequestService

type BillingRequestService interface {
	List(ctx context.Context, p BillingRequestListParams, opts ...RequestOption) (*BillingRequestListResult, error)
	All(ctx context.Context, p BillingRequestListParams, opts ...RequestOption) *BillingRequestListPagingIterator
	Create(ctx context.Context, p BillingRequestCreateParams, opts ...RequestOption) (*BillingRequest, error)
	Get(ctx context.Context, identity string, opts ...RequestOption) (*BillingRequest, error)
	CollectCustomerDetails(ctx context.Context, identity string, p BillingRequestCollectCustomerDetailsParams, opts ...RequestOption) (*BillingRequest, error)
	CollectBankAccount(ctx context.Context, identity string, p BillingRequestCollectBankAccountParams, opts ...RequestOption) (*BillingRequest, error)
	Fulfil(ctx context.Context, identity string, p BillingRequestFulfilParams, opts ...RequestOption) (*BillingRequest, error)
	ChooseCurrency(ctx context.Context, identity string, p BillingRequestChooseCurrencyParams, opts ...RequestOption) (*BillingRequest, error)
	ConfirmPayerDetails(ctx context.Context, identity string, p BillingRequestConfirmPayerDetailsParams, opts ...RequestOption) (*BillingRequest, error)
	Cancel(ctx context.Context, identity string, p BillingRequestCancelParams, opts ...RequestOption) (*BillingRequest, error)
	Notify(ctx context.Context, identity string, p BillingRequestNotifyParams, opts ...RequestOption) (*BillingRequest, error)
	Fallback(ctx context.Context, identity string, p BillingRequestFallbackParams, opts ...RequestOption) (*BillingRequest, error)
}

type BillingRequestServiceImpl

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

BillingRequestService manages billing_requests

func (*BillingRequestServiceImpl) Cancel

Cancel Immediately cancels a billing request, causing all billing request flows to expire.

func (*BillingRequestServiceImpl) ChooseCurrency

ChooseCurrency This will allow for the updating of the currency and subsequently the scheme if needed for a Billing Request. This will only be available for mandate only flows which do not have the lock_currency flag set to true on the Billing Request Flow. It will also not support any request which has a payments request.

func (*BillingRequestServiceImpl) CollectBankAccount

CollectBankAccount If the billing request has a pending <code>collect_bank_account</code> action, this endpoint can be used to collect the details in order to complete it.

The endpoint takes the same payload as Customer Bank Accounts, but check the bank account is valid for the billing request scheme before creating and attaching it.

_ACH scheme_ For compliance reasons, an extra validation step is done using a third-party provider to make sure the customer's bank account can accept Direct Debit. If a bank account is discovered to be closed or invalid, the customer is requested to adjust the account number/routing number and succeed in this check to continue with the flow.

func (*BillingRequestServiceImpl) CollectCustomerDetails

CollectCustomerDetails If the billing request has a pending <code>collect_customer_details</code> action, this endpoint can be used to collect the details in order to complete it.

The endpoint takes the same payload as Customers, but checks that the customer fields are populated correctly for the billing request scheme.

Whatever is provided to this endpoint is used to update the referenced customer, and will take effect immediately after the request is successful.

func (*BillingRequestServiceImpl) ConfirmPayerDetails

ConfirmPayerDetails This is needed when you have a mandate request. As a scheme compliance rule we are required to allow the payer to crosscheck the details entered by them and confirm it.

func (*BillingRequestServiceImpl) Create

Create

func (*BillingRequestServiceImpl) Fallback

Fallback Triggers a fallback from the open-banking flow to direct debit. Note, the billing request must have fallback enabled.

func (*BillingRequestServiceImpl) Fulfil

Fulfil If a billing request is ready to be fulfilled, call this endpoint to cause it to fulfil, executing the payment.

func (*BillingRequestServiceImpl) Get

Get Fetches a billing request

func (*BillingRequestServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your billing requests.

func (*BillingRequestServiceImpl) Notify

Notify Notifies the customer linked to the billing request, asking them to authorise it. Currently, the customer can only be notified by email.

type BillingRequestTemplate

type BillingRequestTemplate struct {
	AuthorisationUrl          string                 `url:"authorisation_url,omitempty" json:"authorisation_url,omitempty"`
	CreatedAt                 string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Id                        string                 `url:"id,omitempty" json:"id,omitempty"`
	MandateRequestCurrency    string                 `url:"mandate_request_currency,omitempty" json:"mandate_request_currency,omitempty"`
	MandateRequestDescription string                 `url:"mandate_request_description,omitempty" json:"mandate_request_description,omitempty"`
	MandateRequestMetadata    map[string]interface{} `url:"mandate_request_metadata,omitempty" json:"mandate_request_metadata,omitempty"`
	MandateRequestScheme      string                 `url:"mandate_request_scheme,omitempty" json:"mandate_request_scheme,omitempty"`
	MandateRequestVerify      string                 `url:"mandate_request_verify,omitempty" json:"mandate_request_verify,omitempty"`
	Metadata                  map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name                      string                 `url:"name,omitempty" json:"name,omitempty"`
	PaymentRequestAmount      int                    `url:"payment_request_amount,omitempty" json:"payment_request_amount,omitempty"`
	PaymentRequestCurrency    string                 `url:"payment_request_currency,omitempty" json:"payment_request_currency,omitempty"`
	PaymentRequestDescription string                 `url:"payment_request_description,omitempty" json:"payment_request_description,omitempty"`
	PaymentRequestMetadata    map[string]interface{} `url:"payment_request_metadata,omitempty" json:"payment_request_metadata,omitempty"`
	PaymentRequestScheme      string                 `url:"payment_request_scheme,omitempty" json:"payment_request_scheme,omitempty"`
	RedirectUri               string                 `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
	UpdatedAt                 string                 `url:"updated_at,omitempty" json:"updated_at,omitempty"`
}

BillingRequestTemplate model

type BillingRequestTemplateCreateParams

type BillingRequestTemplateCreateParams struct {
	Links                     *BillingRequestTemplateCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	MandateRequestCurrency    string                                   `url:"mandate_request_currency,omitempty" json:"mandate_request_currency,omitempty"`
	MandateRequestDescription string                                   `url:"mandate_request_description,omitempty" json:"mandate_request_description,omitempty"`
	MandateRequestMetadata    map[string]interface{}                   `url:"mandate_request_metadata,omitempty" json:"mandate_request_metadata,omitempty"`
	MandateRequestScheme      string                                   `url:"mandate_request_scheme,omitempty" json:"mandate_request_scheme,omitempty"`
	MandateRequestVerify      string                                   `url:"mandate_request_verify,omitempty" json:"mandate_request_verify,omitempty"`
	Metadata                  map[string]interface{}                   `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name                      string                                   `url:"name,omitempty" json:"name,omitempty"`
	PaymentRequestAmount      int                                      `url:"payment_request_amount,omitempty" json:"payment_request_amount,omitempty"`
	PaymentRequestCurrency    string                                   `url:"payment_request_currency,omitempty" json:"payment_request_currency,omitempty"`
	PaymentRequestDescription string                                   `url:"payment_request_description,omitempty" json:"payment_request_description,omitempty"`
	PaymentRequestMetadata    map[string]interface{}                   `url:"payment_request_metadata,omitempty" json:"payment_request_metadata,omitempty"`
	PaymentRequestScheme      string                                   `url:"payment_request_scheme,omitempty" json:"payment_request_scheme,omitempty"`
	RedirectUri               string                                   `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
}

BillingRequestTemplateCreateParams parameters

type BillingRequestTemplateCreateParamsLinks struct {
	Creditor string `url:"creditor,omitempty" json:"creditor,omitempty"`
}

type BillingRequestTemplateListPagingIterator

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

func (*BillingRequestTemplateListPagingIterator) Next

func (*BillingRequestTemplateListPagingIterator) Value

type BillingRequestTemplateListParams

type BillingRequestTemplateListParams struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
	Limit  int    `url:"limit,omitempty" json:"limit,omitempty"`
}

BillingRequestTemplateListParams parameters

type BillingRequestTemplateListResult

type BillingRequestTemplateListResult struct {
	BillingRequestTemplates []BillingRequestTemplate             `json:"billing_request_templates"`
	Meta                    BillingRequestTemplateListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type BillingRequestTemplateListResultMeta

type BillingRequestTemplateListResultMeta struct {
	Cursors *BillingRequestTemplateListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                          `url:"limit,omitempty" json:"limit,omitempty"`
}

type BillingRequestTemplateListResultMetaCursors

type BillingRequestTemplateListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type BillingRequestTemplateServiceImpl

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

BillingRequestTemplateService manages billing_request_templates

func (*BillingRequestTemplateServiceImpl) Create

Create

func (*BillingRequestTemplateServiceImpl) Get

Get Fetches a Billing Request Template

func (*BillingRequestTemplateServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your Billing Request Templates.

func (*BillingRequestTemplateServiceImpl) Update

Update Updates a Billing Request Template, which will affect all future Billing Requests created by this template.

type BillingRequestTemplateUpdateParams

type BillingRequestTemplateUpdateParams struct {
	MandateRequestCurrency    string                 `url:"mandate_request_currency,omitempty" json:"mandate_request_currency,omitempty"`
	MandateRequestDescription string                 `url:"mandate_request_description,omitempty" json:"mandate_request_description,omitempty"`
	MandateRequestMetadata    map[string]interface{} `url:"mandate_request_metadata,omitempty" json:"mandate_request_metadata,omitempty"`
	MandateRequestScheme      string                 `url:"mandate_request_scheme,omitempty" json:"mandate_request_scheme,omitempty"`
	MandateRequestVerify      string                 `url:"mandate_request_verify,omitempty" json:"mandate_request_verify,omitempty"`
	Metadata                  map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name                      string                 `url:"name,omitempty" json:"name,omitempty"`
	PaymentRequestAmount      int                    `url:"payment_request_amount,omitempty" json:"payment_request_amount,omitempty"`
	PaymentRequestCurrency    string                 `url:"payment_request_currency,omitempty" json:"payment_request_currency,omitempty"`
	PaymentRequestDescription string                 `url:"payment_request_description,omitempty" json:"payment_request_description,omitempty"`
	PaymentRequestMetadata    map[string]interface{} `url:"payment_request_metadata,omitempty" json:"payment_request_metadata,omitempty"`
	PaymentRequestScheme      string                 `url:"payment_request_scheme,omitempty" json:"payment_request_scheme,omitempty"`
	RedirectUri               string                 `url:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
}

BillingRequestTemplateUpdateParams parameters

type Block

type Block struct {
	Active            bool   `url:"active,omitempty" json:"active,omitempty"`
	BlockType         string `url:"block_type,omitempty" json:"block_type,omitempty"`
	CreatedAt         string `url:"created_at,omitempty" json:"created_at,omitempty"`
	Id                string `url:"id,omitempty" json:"id,omitempty"`
	ReasonDescription string `url:"reason_description,omitempty" json:"reason_description,omitempty"`
	ReasonType        string `url:"reason_type,omitempty" json:"reason_type,omitempty"`
	ResourceReference string `url:"resource_reference,omitempty" json:"resource_reference,omitempty"`
	UpdatedAt         string `url:"updated_at,omitempty" json:"updated_at,omitempty"`
}

Block model

type BlockBlockByRefParams

type BlockBlockByRefParams struct {
	Active            bool   `url:"active,omitempty" json:"active,omitempty"`
	ReasonDescription string `url:"reason_description,omitempty" json:"reason_description,omitempty"`
	ReasonType        string `url:"reason_type,omitempty" json:"reason_type,omitempty"`
	ReferenceType     string `url:"reference_type,omitempty" json:"reference_type,omitempty"`
	ReferenceValue    string `url:"reference_value,omitempty" json:"reference_value,omitempty"`
}

BlockBlockByRefParams parameters

type BlockBlockByRefResult

type BlockBlockByRefResult struct {
	Blocks []Block                   `json:"blocks"`
	Meta   BlockBlockByRefResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type BlockBlockByRefResultMeta

type BlockBlockByRefResultMeta struct {
	Cursors *BlockBlockByRefResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                               `url:"limit,omitempty" json:"limit,omitempty"`
}

type BlockBlockByRefResultMetaCursors

type BlockBlockByRefResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type BlockCreateParams

type BlockCreateParams struct {
	Active            bool   `url:"active,omitempty" json:"active,omitempty"`
	BlockType         string `url:"block_type,omitempty" json:"block_type,omitempty"`
	ReasonDescription string `url:"reason_description,omitempty" json:"reason_description,omitempty"`
	ReasonType        string `url:"reason_type,omitempty" json:"reason_type,omitempty"`
	ResourceReference string `url:"resource_reference,omitempty" json:"resource_reference,omitempty"`
}

BlockCreateParams parameters

type BlockListPagingIterator

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

func (*BlockListPagingIterator) Next

func (c *BlockListPagingIterator) Next() bool

func (*BlockListPagingIterator) Value

type BlockListParams

type BlockListParams struct {
	After      string `url:"after,omitempty" json:"after,omitempty"`
	Before     string `url:"before,omitempty" json:"before,omitempty"`
	Block      string `url:"block,omitempty" json:"block,omitempty"`
	BlockType  string `url:"block_type,omitempty" json:"block_type,omitempty"`
	CreatedAt  string `url:"created_at,omitempty" json:"created_at,omitempty"`
	Limit      int    `url:"limit,omitempty" json:"limit,omitempty"`
	ReasonType string `url:"reason_type,omitempty" json:"reason_type,omitempty"`
	UpdatedAt  string `url:"updated_at,omitempty" json:"updated_at,omitempty"`
}

BlockListParams parameters

type BlockListResult

type BlockListResult struct {
	Blocks []Block             `json:"blocks"`
	Meta   BlockListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type BlockListResultMeta

type BlockListResultMeta struct {
	Cursors *BlockListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                         `url:"limit,omitempty" json:"limit,omitempty"`
}

type BlockListResultMetaCursors

type BlockListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type BlockService

type BlockService interface {
	Create(ctx context.Context, p BlockCreateParams, opts ...RequestOption) (*Block, error)
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Block, error)
	List(ctx context.Context, p BlockListParams, opts ...RequestOption) (*BlockListResult, error)
	All(ctx context.Context, p BlockListParams, opts ...RequestOption) *BlockListPagingIterator
	Disable(ctx context.Context, identity string, opts ...RequestOption) (*Block, error)
	Enable(ctx context.Context, identity string, opts ...RequestOption) (*Block, error)
	BlockByRef(ctx context.Context, p BlockBlockByRefParams, opts ...RequestOption) (
		*BlockBlockByRefResult, error)
}

type BlockServiceImpl

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

BlockService manages blocks

func (*BlockServiceImpl) All

func (*BlockServiceImpl) BlockByRef

BlockByRef Creates new blocks for a given reference. By default blocks will be active. Returns 201 if at least one block was created. Returns 200 if there were no new blocks created.

func (*BlockServiceImpl) Create

Create Creates a new Block of a given type. By default it will be active.

func (*BlockServiceImpl) Disable

func (s *BlockServiceImpl) Disable(ctx context.Context, identity string, opts ...RequestOption) (*Block, error)

Disable Disables a block so that it no longer will prevent mandate creation.

func (*BlockServiceImpl) Enable

func (s *BlockServiceImpl) Enable(ctx context.Context, identity string, opts ...RequestOption) (*Block, error)

Enable Enables a previously disabled block so that it will prevent mandate creation

func (*BlockServiceImpl) Get

func (s *BlockServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Block, error)

Get Retrieves the details of an existing block.

func (*BlockServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your blocks.

type Config

type Config interface {
	Token() string
	Endpoint() string
	Client() *http.Client
}

func NewConfig

func NewConfig(token string, configOpts ...ConfigOption) (Config, error)

type ConfigOption

type ConfigOption func(Config) error

ConfigOption used to initialise the client

func WithClient

func WithClient(client *http.Client) ConfigOption

WithClient configures the net/http client

func WithEndpoint

func WithEndpoint(endpoint string) ConfigOption

WithEndpoint configures the endpoint hosting the API

type Creditor

type Creditor struct {
	Activated                           bool                        `url:"activated,omitempty" json:"activated,omitempty"`
	AddressLine1                        string                      `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2                        string                      `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3                        string                      `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	CanCreateRefunds                    bool                        `url:"can_create_refunds,omitempty" json:"can_create_refunds,omitempty"`
	City                                string                      `url:"city,omitempty" json:"city,omitempty"`
	CountryCode                         string                      `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreatedAt                           string                      `url:"created_at,omitempty" json:"created_at,omitempty"`
	CreditorType                        string                      `url:"creditor_type,omitempty" json:"creditor_type,omitempty"`
	CustomPaymentPagesEnabled           bool                        `url:"custom_payment_pages_enabled,omitempty" json:"custom_payment_pages_enabled,omitempty"`
	FxPayoutCurrency                    string                      `url:"fx_payout_currency,omitempty" json:"fx_payout_currency,omitempty"`
	Id                                  string                      `url:"id,omitempty" json:"id,omitempty"`
	Links                               *CreditorLinks              `url:"links,omitempty" json:"links,omitempty"`
	LogoUrl                             string                      `url:"logo_url,omitempty" json:"logo_url,omitempty"`
	MandateImportsEnabled               bool                        `url:"mandate_imports_enabled,omitempty" json:"mandate_imports_enabled,omitempty"`
	MerchantResponsibleForNotifications bool                        `url:"merchant_responsible_for_notifications,omitempty" json:"merchant_responsible_for_notifications,omitempty"`
	Name                                string                      `url:"name,omitempty" json:"name,omitempty"`
	PostalCode                          string                      `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                              string                      `url:"region,omitempty" json:"region,omitempty"`
	SchemeIdentifiers                   []CreditorSchemeIdentifiers `url:"scheme_identifiers,omitempty" json:"scheme_identifiers,omitempty"`
	VerificationStatus                  string                      `url:"verification_status,omitempty" json:"verification_status,omitempty"`
}

Creditor model

type CreditorBankAccount

type CreditorBankAccount struct {
	AccountHolderName   string                    `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumberEnding string                    `url:"account_number_ending,omitempty" json:"account_number_ending,omitempty"`
	AccountType         string                    `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankName            string                    `url:"bank_name,omitempty" json:"bank_name,omitempty"`
	CountryCode         string                    `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreatedAt           string                    `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency            string                    `url:"currency,omitempty" json:"currency,omitempty"`
	Enabled             bool                      `url:"enabled,omitempty" json:"enabled,omitempty"`
	Id                  string                    `url:"id,omitempty" json:"id,omitempty"`
	Links               *CreditorBankAccountLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata            map[string]interface{}    `url:"metadata,omitempty" json:"metadata,omitempty"`
}

CreditorBankAccount model

type CreditorBankAccountCreateParams

type CreditorBankAccountCreateParams struct {
	AccountHolderName         string                               `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber             string                               `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountType               string                               `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankCode                  string                               `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode                string                               `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode               string                               `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency                  string                               `url:"currency,omitempty" json:"currency,omitempty"`
	Iban                      string                               `url:"iban,omitempty" json:"iban,omitempty"`
	Links                     CreditorBankAccountCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata                  map[string]interface{}               `url:"metadata,omitempty" json:"metadata,omitempty"`
	SetAsDefaultPayoutAccount bool                                 `url:"set_as_default_payout_account,omitempty" json:"set_as_default_payout_account,omitempty"`
}

CreditorBankAccountCreateParams parameters

type CreditorBankAccountCreateParamsLinks struct {
	Creditor string `url:"creditor,omitempty" json:"creditor,omitempty"`
}
type CreditorBankAccountLinks struct {
	Creditor string `url:"creditor,omitempty" json:"creditor,omitempty"`
}

type CreditorBankAccountListPagingIterator

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

func (*CreditorBankAccountListPagingIterator) Next

func (*CreditorBankAccountListPagingIterator) Value

type CreditorBankAccountListParams

type CreditorBankAccountListParams struct {
	After     string                                  `url:"after,omitempty" json:"after,omitempty"`
	Before    string                                  `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt *CreditorBankAccountListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Creditor  string                                  `url:"creditor,omitempty" json:"creditor,omitempty"`
	Enabled   bool                                    `url:"enabled,omitempty" json:"enabled,omitempty"`
	Limit     int                                     `url:"limit,omitempty" json:"limit,omitempty"`
}

CreditorBankAccountListParams parameters

type CreditorBankAccountListParamsCreatedAt

type CreditorBankAccountListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type CreditorBankAccountListResult

type CreditorBankAccountListResult struct {
	CreditorBankAccounts []CreditorBankAccount             `json:"creditor_bank_accounts"`
	Meta                 CreditorBankAccountListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type CreditorBankAccountListResultMeta

type CreditorBankAccountListResultMeta struct {
	Cursors *CreditorBankAccountListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                       `url:"limit,omitempty" json:"limit,omitempty"`
}

type CreditorBankAccountListResultMetaCursors

type CreditorBankAccountListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type CreditorBankAccountServiceImpl

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

CreditorBankAccountService manages creditor_bank_accounts

func (*CreditorBankAccountServiceImpl) Create

Create Creates a new creditor bank account object.

func (*CreditorBankAccountServiceImpl) Disable

Disable Immediately disables the bank account, no money can be paid out to a disabled account.

This will return a `disable_failed` error if the bank account has already been disabled.

A disabled bank account can be re-enabled by creating a new bank account resource with the same details.

func (*CreditorBankAccountServiceImpl) Get

Get Retrieves the details of an existing creditor bank account.

func (*CreditorBankAccountServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditor bank accounts.

type CreditorCreateParams

type CreditorCreateParams struct {
	AddressLine1 string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2 string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3 string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City         string                 `url:"city,omitempty" json:"city,omitempty"`
	CountryCode  string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreditorType string                 `url:"creditor_type,omitempty" json:"creditor_type,omitempty"`
	Links        map[string]interface{} `url:"links,omitempty" json:"links,omitempty"`
	Name         string                 `url:"name,omitempty" json:"name,omitempty"`
	PostalCode   string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region       string                 `url:"region,omitempty" json:"region,omitempty"`
}

CreditorCreateParams parameters

type CreditorGetParams

type CreditorGetParams struct {
}

CreditorGetParams parameters

type CreditorLinks struct {
	DefaultAudPayoutAccount string `url:"default_aud_payout_account,omitempty" json:"default_aud_payout_account,omitempty"`
	DefaultCadPayoutAccount string `url:"default_cad_payout_account,omitempty" json:"default_cad_payout_account,omitempty"`
	DefaultDkkPayoutAccount string `url:"default_dkk_payout_account,omitempty" json:"default_dkk_payout_account,omitempty"`
	DefaultEurPayoutAccount string `url:"default_eur_payout_account,omitempty" json:"default_eur_payout_account,omitempty"`
	DefaultGbpPayoutAccount string `url:"default_gbp_payout_account,omitempty" json:"default_gbp_payout_account,omitempty"`
	DefaultNzdPayoutAccount string `url:"default_nzd_payout_account,omitempty" json:"default_nzd_payout_account,omitempty"`
	DefaultSekPayoutAccount string `url:"default_sek_payout_account,omitempty" json:"default_sek_payout_account,omitempty"`
	DefaultUsdPayoutAccount string `url:"default_usd_payout_account,omitempty" json:"default_usd_payout_account,omitempty"`
}

type CreditorListPagingIterator

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

func (*CreditorListPagingIterator) Next

func (c *CreditorListPagingIterator) Next() bool

func (*CreditorListPagingIterator) Value

type CreditorListParams

type CreditorListParams struct {
	After     string                       `url:"after,omitempty" json:"after,omitempty"`
	Before    string                       `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt *CreditorListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Limit     int                          `url:"limit,omitempty" json:"limit,omitempty"`
}

CreditorListParams parameters

type CreditorListParamsCreatedAt

type CreditorListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type CreditorListResult

type CreditorListResult struct {
	Creditors []Creditor             `json:"creditors"`
	Meta      CreditorListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type CreditorListResultMeta

type CreditorListResultMeta struct {
	Cursors *CreditorListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                            `url:"limit,omitempty" json:"limit,omitempty"`
}

type CreditorListResultMetaCursors

type CreditorListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type CreditorSchemeIdentifiers

type CreditorSchemeIdentifiers struct {
	AddressLine1               string `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2               string `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3               string `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	CanSpecifyMandateReference bool   `url:"can_specify_mandate_reference,omitempty" json:"can_specify_mandate_reference,omitempty"`
	City                       string `url:"city,omitempty" json:"city,omitempty"`
	CountryCode                string `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency                   string `url:"currency,omitempty" json:"currency,omitempty"`
	Email                      string `url:"email,omitempty" json:"email,omitempty"`
	MinimumAdvanceNotice       int    `url:"minimum_advance_notice,omitempty" json:"minimum_advance_notice,omitempty"`
	Name                       string `url:"name,omitempty" json:"name,omitempty"`
	PhoneNumber                string `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode                 string `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Reference                  string `url:"reference,omitempty" json:"reference,omitempty"`
	Region                     string `url:"region,omitempty" json:"region,omitempty"`
	Scheme                     string `url:"scheme,omitempty" json:"scheme,omitempty"`
}

type CreditorServiceImpl

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

CreditorService manages creditors

func (*CreditorServiceImpl) All

func (*CreditorServiceImpl) Create

Create Creates a new creditor.

func (*CreditorServiceImpl) Get

Get Retrieves the details of an existing creditor.

func (*CreditorServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditors.

func (*CreditorServiceImpl) Update

func (s *CreditorServiceImpl) Update(ctx context.Context, identity string, p CreditorUpdateParams, opts ...RequestOption) (*Creditor, error)

Update Updates a creditor object. Supports all of the fields supported when creating a creditor.

type CreditorUpdateParams

type CreditorUpdateParams struct {
	AddressLine1 string                     `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2 string                     `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3 string                     `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City         string                     `url:"city,omitempty" json:"city,omitempty"`
	CountryCode  string                     `url:"country_code,omitempty" json:"country_code,omitempty"`
	Links        *CreditorUpdateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Name         string                     `url:"name,omitempty" json:"name,omitempty"`
	PostalCode   string                     `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region       string                     `url:"region,omitempty" json:"region,omitempty"`
}

CreditorUpdateParams parameters

type CreditorUpdateParamsLinks struct {
	DefaultAudPayoutAccount string `url:"default_aud_payout_account,omitempty" json:"default_aud_payout_account,omitempty"`
	DefaultCadPayoutAccount string `url:"default_cad_payout_account,omitempty" json:"default_cad_payout_account,omitempty"`
	DefaultDkkPayoutAccount string `url:"default_dkk_payout_account,omitempty" json:"default_dkk_payout_account,omitempty"`
	DefaultEurPayoutAccount string `url:"default_eur_payout_account,omitempty" json:"default_eur_payout_account,omitempty"`
	DefaultGbpPayoutAccount string `url:"default_gbp_payout_account,omitempty" json:"default_gbp_payout_account,omitempty"`
	DefaultNzdPayoutAccount string `url:"default_nzd_payout_account,omitempty" json:"default_nzd_payout_account,omitempty"`
	DefaultSekPayoutAccount string `url:"default_sek_payout_account,omitempty" json:"default_sek_payout_account,omitempty"`
	DefaultUsdPayoutAccount string `url:"default_usd_payout_account,omitempty" json:"default_usd_payout_account,omitempty"`
}

type CurrencyExchangeRate

type CurrencyExchangeRate struct {
	Rate   string `url:"rate,omitempty" json:"rate,omitempty"`
	Source string `url:"source,omitempty" json:"source,omitempty"`
	Target string `url:"target,omitempty" json:"target,omitempty"`
	Time   string `url:"time,omitempty" json:"time,omitempty"`
}

CurrencyExchangeRate model

type CurrencyExchangeRateListPagingIterator

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

func (*CurrencyExchangeRateListPagingIterator) Next

func (*CurrencyExchangeRateListPagingIterator) Value

type CurrencyExchangeRateListParams

type CurrencyExchangeRateListParams struct {
	After     string                                   `url:"after,omitempty" json:"after,omitempty"`
	Before    string                                   `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt *CurrencyExchangeRateListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Limit     int                                      `url:"limit,omitempty" json:"limit,omitempty"`
	Source    string                                   `url:"source,omitempty" json:"source,omitempty"`
	Target    string                                   `url:"target,omitempty" json:"target,omitempty"`
}

CurrencyExchangeRateListParams parameters

type CurrencyExchangeRateListParamsCreatedAt

type CurrencyExchangeRateListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type CurrencyExchangeRateListResult

type CurrencyExchangeRateListResult struct {
	CurrencyExchangeRates []CurrencyExchangeRate             `json:"currency_exchange_rates"`
	Meta                  CurrencyExchangeRateListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type CurrencyExchangeRateListResultMeta

type CurrencyExchangeRateListResultMeta struct {
	Cursors *CurrencyExchangeRateListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                        `url:"limit,omitempty" json:"limit,omitempty"`
}

type CurrencyExchangeRateListResultMetaCursors

type CurrencyExchangeRateListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type CurrencyExchangeRateServiceImpl

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

CurrencyExchangeRateService manages currency_exchange_rates

func (*CurrencyExchangeRateServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all exchange rates.

type Customer

type Customer struct {
	AddressLine1          string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string                 `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreatedAt             string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	DanishIdentityNumber  string                 `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Id                    string                 `url:"id,omitempty" json:"id,omitempty"`
	Language              string                 `url:"language,omitempty" json:"language,omitempty"`
	Metadata              map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PhoneNumber           string                 `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode            string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                 `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string                 `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

Customer model

type CustomerBankAccount

type CustomerBankAccount struct {
	AccountHolderName   string                    `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumberEnding string                    `url:"account_number_ending,omitempty" json:"account_number_ending,omitempty"`
	AccountType         string                    `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankName            string                    `url:"bank_name,omitempty" json:"bank_name,omitempty"`
	CountryCode         string                    `url:"country_code,omitempty" json:"country_code,omitempty"`
	CreatedAt           string                    `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency            string                    `url:"currency,omitempty" json:"currency,omitempty"`
	Enabled             bool                      `url:"enabled,omitempty" json:"enabled,omitempty"`
	Id                  string                    `url:"id,omitempty" json:"id,omitempty"`
	Links               *CustomerBankAccountLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata            map[string]interface{}    `url:"metadata,omitempty" json:"metadata,omitempty"`
}

CustomerBankAccount model

type CustomerBankAccountCreateParams

type CustomerBankAccountCreateParams struct {
	AccountHolderName string                               `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber     string                               `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountType       string                               `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankCode          string                               `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode        string                               `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode       string                               `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency          string                               `url:"currency,omitempty" json:"currency,omitempty"`
	Iban              string                               `url:"iban,omitempty" json:"iban,omitempty"`
	Links             CustomerBankAccountCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata          map[string]interface{}               `url:"metadata,omitempty" json:"metadata,omitempty"`
}

CustomerBankAccountCreateParams parameters

type CustomerBankAccountCreateParamsLinks struct {
	Customer                 string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccountToken string `url:"customer_bank_account_token,omitempty" json:"customer_bank_account_token,omitempty"`
}
type CustomerBankAccountLinks struct {
	Customer string `url:"customer,omitempty" json:"customer,omitempty"`
}

type CustomerBankAccountListPagingIterator

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

func (*CustomerBankAccountListPagingIterator) Next

func (*CustomerBankAccountListPagingIterator) Value

type CustomerBankAccountListParams

type CustomerBankAccountListParams struct {
	After     string                                  `url:"after,omitempty" json:"after,omitempty"`
	Before    string                                  `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt *CustomerBankAccountListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Customer  string                                  `url:"customer,omitempty" json:"customer,omitempty"`
	Enabled   bool                                    `url:"enabled,omitempty" json:"enabled,omitempty"`
	Limit     int                                     `url:"limit,omitempty" json:"limit,omitempty"`
}

CustomerBankAccountListParams parameters

type CustomerBankAccountListParamsCreatedAt

type CustomerBankAccountListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type CustomerBankAccountListResult

type CustomerBankAccountListResult struct {
	CustomerBankAccounts []CustomerBankAccount             `json:"customer_bank_accounts"`
	Meta                 CustomerBankAccountListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type CustomerBankAccountListResultMeta

type CustomerBankAccountListResultMeta struct {
	Cursors *CustomerBankAccountListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                       `url:"limit,omitempty" json:"limit,omitempty"`
}

type CustomerBankAccountListResultMetaCursors

type CustomerBankAccountListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type CustomerBankAccountServiceImpl

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

CustomerBankAccountService manages customer_bank_accounts

func (*CustomerBankAccountServiceImpl) Create

Create Creates a new customer bank account object.

There are three different ways to supply bank account details:

- [Local details](#appendix-local-bank-details)

- IBAN

- [Customer Bank Account Tokens](#javascript-flow-create-a-customer-bank-account-token)

For more information on the different fields required in each country, see [local bank details](#appendix-local-bank-details).

func (*CustomerBankAccountServiceImpl) Disable

Disable Immediately cancels all associated mandates and cancellable payments.

This will return a `disable_failed` error if the bank account has already been disabled.

A disabled bank account can be re-enabled by creating a new bank account resource with the same details.

func (*CustomerBankAccountServiceImpl) Get

Get Retrieves the details of an existing bank account.

func (*CustomerBankAccountServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your bank accounts.

func (*CustomerBankAccountServiceImpl) Update

Update Updates a customer bank account object. Only the metadata parameter is allowed.

type CustomerBankAccountUpdateParams

type CustomerBankAccountUpdateParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

CustomerBankAccountUpdateParams parameters

type CustomerCreateParams

type CustomerCreateParams struct {
	AddressLine1          string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string                 `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string                 `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Language              string                 `url:"language,omitempty" json:"language,omitempty"`
	Metadata              map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PhoneNumber           string                 `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode            string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                 `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string                 `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

CustomerCreateParams parameters

type CustomerListPagingIterator

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

func (*CustomerListPagingIterator) Next

func (c *CustomerListPagingIterator) Next() bool

func (*CustomerListPagingIterator) Value

type CustomerListParams

type CustomerListParams struct {
	After         string                       `url:"after,omitempty" json:"after,omitempty"`
	Before        string                       `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt     *CustomerListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency      string                       `url:"currency,omitempty" json:"currency,omitempty"`
	Limit         int                          `url:"limit,omitempty" json:"limit,omitempty"`
	SortDirection string                       `url:"sort_direction,omitempty" json:"sort_direction,omitempty"`
	SortField     string                       `url:"sort_field,omitempty" json:"sort_field,omitempty"`
}

CustomerListParams parameters

type CustomerListParamsCreatedAt

type CustomerListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type CustomerListResult

type CustomerListResult struct {
	Customers []Customer             `json:"customers"`
	Meta      CustomerListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type CustomerListResultMeta

type CustomerListResultMeta struct {
	Cursors *CustomerListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                            `url:"limit,omitempty" json:"limit,omitempty"`
}

type CustomerListResultMetaCursors

type CustomerListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type CustomerNotification

type CustomerNotification struct {
	ActionTaken   string                     `url:"action_taken,omitempty" json:"action_taken,omitempty"`
	ActionTakenAt string                     `url:"action_taken_at,omitempty" json:"action_taken_at,omitempty"`
	ActionTakenBy string                     `url:"action_taken_by,omitempty" json:"action_taken_by,omitempty"`
	Id            string                     `url:"id,omitempty" json:"id,omitempty"`
	Links         *CustomerNotificationLinks `url:"links,omitempty" json:"links,omitempty"`
	Type          string                     `url:"type,omitempty" json:"type,omitempty"`
}

CustomerNotification model

type CustomerNotificationHandleParams

type CustomerNotificationHandleParams struct {
}

CustomerNotificationHandleParams parameters

type CustomerNotificationLinks struct {
	Customer     string `url:"customer,omitempty" json:"customer,omitempty"`
	Event        string `url:"event,omitempty" json:"event,omitempty"`
	Mandate      string `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payment      string `url:"payment,omitempty" json:"payment,omitempty"`
	Refund       string `url:"refund,omitempty" json:"refund,omitempty"`
	Subscription string `url:"subscription,omitempty" json:"subscription,omitempty"`
}

type CustomerNotificationService

type CustomerNotificationService interface {
	Handle(ctx context.Context, identity string, p CustomerNotificationHandleParams, opts ...RequestOption) (*CustomerNotification, error)
}

type CustomerNotificationServiceImpl

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

CustomerNotificationService manages customer_notifications

func (*CustomerNotificationServiceImpl) Handle

Handle "Handling" a notification means that you have sent the notification yourself (and don't want GoCardless to send it). If the notification has already been actioned, or the deadline to notify has passed, this endpoint will return an `already_actioned` error and you should not take further action. This endpoint takes no additional parameters.

type CustomerRemoveParams

type CustomerRemoveParams struct {
}

CustomerRemoveParams parameters

type CustomerService

type CustomerService interface {
	Create(ctx context.Context, p CustomerCreateParams, opts ...RequestOption) (*Customer, error)
	List(ctx context.Context, p CustomerListParams, opts ...RequestOption) (*CustomerListResult, error)
	All(ctx context.Context, p CustomerListParams, opts ...RequestOption) *CustomerListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Customer, error)
	Update(ctx context.Context, identity string, p CustomerUpdateParams, opts ...RequestOption) (*Customer, error)
	Remove(ctx context.Context, identity string, p CustomerRemoveParams, opts ...RequestOption) (*Customer, error)
}

type CustomerServiceImpl

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

CustomerService manages customers

func (*CustomerServiceImpl) All

func (*CustomerServiceImpl) Create

Create Creates a new customer object.

func (*CustomerServiceImpl) Get

func (s *CustomerServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Customer, error)

Get Retrieves the details of an existing customer.

func (*CustomerServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your customers.

func (*CustomerServiceImpl) Remove

func (s *CustomerServiceImpl) Remove(ctx context.Context, identity string, p CustomerRemoveParams, opts ...RequestOption) (*Customer, error)

Remove Removed customers will not appear in search results or lists of customers (in our API or exports), and it will not be possible to load an individually removed customer by ID.

<p class="restricted-notice"><strong>The action of removing a customer cannot be reversed, so please use with care.</strong></p>

func (*CustomerServiceImpl) Update

func (s *CustomerServiceImpl) Update(ctx context.Context, identity string, p CustomerUpdateParams, opts ...RequestOption) (*Customer, error)

Update Updates a customer object. Supports all of the fields supported when creating a customer.

type CustomerUpdateParams

type CustomerUpdateParams struct {
	AddressLine1          string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string                 `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string                 `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Language              string                 `url:"language,omitempty" json:"language,omitempty"`
	Metadata              map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PhoneNumber           string                 `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode            string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                 `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string                 `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

CustomerUpdateParams parameters

type ErrorLinks struct {
	ConflictingResourceID string `json:"conflicting_resource_id"`
}

type Event

type Event struct {
	Action                string                       `url:"action,omitempty" json:"action,omitempty"`
	CreatedAt             string                       `url:"created_at,omitempty" json:"created_at,omitempty"`
	CustomerNotifications []EventCustomerNotifications `url:"customer_notifications,omitempty" json:"customer_notifications,omitempty"`
	Details               *EventDetails                `url:"details,omitempty" json:"details,omitempty"`
	Id                    string                       `url:"id,omitempty" json:"id,omitempty"`
	Links                 *EventLinks                  `url:"links,omitempty" json:"links,omitempty"`
	Metadata              map[string]interface{}       `url:"metadata,omitempty" json:"metadata,omitempty"`
	ResourceType          string                       `url:"resource_type,omitempty" json:"resource_type,omitempty"`
}

Event model

type EventCustomerNotifications

type EventCustomerNotifications struct {
	Deadline  string `url:"deadline,omitempty" json:"deadline,omitempty"`
	Id        string `url:"id,omitempty" json:"id,omitempty"`
	Mandatory bool   `url:"mandatory,omitempty" json:"mandatory,omitempty"`
	Type      string `url:"type,omitempty" json:"type,omitempty"`
}

type EventDetails

type EventDetails struct {
	BankAccountId    string `url:"bank_account_id,omitempty" json:"bank_account_id,omitempty"`
	Cause            string `url:"cause,omitempty" json:"cause,omitempty"`
	Currency         string `url:"currency,omitempty" json:"currency,omitempty"`
	Description      string `url:"description,omitempty" json:"description,omitempty"`
	NotRetriedReason string `url:"not_retried_reason,omitempty" json:"not_retried_reason,omitempty"`
	Origin           string `url:"origin,omitempty" json:"origin,omitempty"`
	Property         string `url:"property,omitempty" json:"property,omitempty"`
	ReasonCode       string `url:"reason_code,omitempty" json:"reason_code,omitempty"`
	Scheme           string `url:"scheme,omitempty" json:"scheme,omitempty"`
	WillAttemptRetry bool   `url:"will_attempt_retry,omitempty" json:"will_attempt_retry,omitempty"`
}

type EventHandler

type EventHandler interface {
	HandleEvent(context.Context, Event) error
}

EventHandler is the interface that must be implemented to handle events from a webhook.

type EventHandlerFunc

type EventHandlerFunc func(context.Context, Event) error

EventHandlerFunc can be used to convert a function into an EventHandler

func (EventHandlerFunc) HandleEvent

func (h EventHandlerFunc) HandleEvent(ctx context.Context, e Event) error

HandleEvent will call the EventHandlerFunc function

type EventLinks struct {
	BankAuthorisation           string `url:"bank_authorisation,omitempty" json:"bank_authorisation,omitempty"`
	BillingRequest              string `url:"billing_request,omitempty" json:"billing_request,omitempty"`
	BillingRequestFlow          string `url:"billing_request_flow,omitempty" json:"billing_request_flow,omitempty"`
	Creditor                    string `url:"creditor,omitempty" json:"creditor,omitempty"`
	Customer                    string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount         string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	InstalmentSchedule          string `url:"instalment_schedule,omitempty" json:"instalment_schedule,omitempty"`
	Mandate                     string `url:"mandate,omitempty" json:"mandate,omitempty"`
	MandateRequestMandate       string `url:"mandate_request_mandate,omitempty" json:"mandate_request_mandate,omitempty"`
	NewCustomerBankAccount      string `url:"new_customer_bank_account,omitempty" json:"new_customer_bank_account,omitempty"`
	NewMandate                  string `url:"new_mandate,omitempty" json:"new_mandate,omitempty"`
	Organisation                string `url:"organisation,omitempty" json:"organisation,omitempty"`
	ParentEvent                 string `url:"parent_event,omitempty" json:"parent_event,omitempty"`
	PayerAuthorisation          string `url:"payer_authorisation,omitempty" json:"payer_authorisation,omitempty"`
	Payment                     string `url:"payment,omitempty" json:"payment,omitempty"`
	PaymentRequestPayment       string `url:"payment_request_payment,omitempty" json:"payment_request_payment,omitempty"`
	Payout                      string `url:"payout,omitempty" json:"payout,omitempty"`
	PreviousCustomerBankAccount string `url:"previous_customer_bank_account,omitempty" json:"previous_customer_bank_account,omitempty"`
	Refund                      string `url:"refund,omitempty" json:"refund,omitempty"`
	Subscription                string `url:"subscription,omitempty" json:"subscription,omitempty"`
}

type EventListPagingIterator

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

func (*EventListPagingIterator) Next

func (c *EventListPagingIterator) Next() bool

func (*EventListPagingIterator) Value

type EventListParams

type EventListParams struct {
	Action             string                    `url:"action,omitempty" json:"action,omitempty"`
	After              string                    `url:"after,omitempty" json:"after,omitempty"`
	Before             string                    `url:"before,omitempty" json:"before,omitempty"`
	BillingRequest     string                    `url:"billing_request,omitempty" json:"billing_request,omitempty"`
	CreatedAt          *EventListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Include            string                    `url:"include,omitempty" json:"include,omitempty"`
	InstalmentSchedule string                    `url:"instalment_schedule,omitempty" json:"instalment_schedule,omitempty"`
	Limit              int                       `url:"limit,omitempty" json:"limit,omitempty"`
	Mandate            string                    `url:"mandate,omitempty" json:"mandate,omitempty"`
	ParentEvent        string                    `url:"parent_event,omitempty" json:"parent_event,omitempty"`
	PayerAuthorisation string                    `url:"payer_authorisation,omitempty" json:"payer_authorisation,omitempty"`
	Payment            string                    `url:"payment,omitempty" json:"payment,omitempty"`
	Payout             string                    `url:"payout,omitempty" json:"payout,omitempty"`
	Refund             string                    `url:"refund,omitempty" json:"refund,omitempty"`
	ResourceType       string                    `url:"resource_type,omitempty" json:"resource_type,omitempty"`
	Subscription       string                    `url:"subscription,omitempty" json:"subscription,omitempty"`
}

EventListParams parameters

type EventListParamsCreatedAt

type EventListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type EventListResult

type EventListResult struct {
	Events []Event             `json:"events"`
	Meta   EventListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type EventListResultMeta

type EventListResultMeta struct {
	Cursors *EventListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                         `url:"limit,omitempty" json:"limit,omitempty"`
}

type EventListResultMetaCursors

type EventListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type EventService

type EventService interface {
	List(ctx context.Context, p EventListParams, opts ...RequestOption) (*EventListResult, error)
	All(ctx context.Context, p EventListParams, opts ...RequestOption) *EventListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Event, error)
}

type EventServiceImpl

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

EventService manages events

func (*EventServiceImpl) All

func (*EventServiceImpl) Get

func (s *EventServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Event, error)

Get Retrieves the details of a single event.

func (*EventServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your events.

type InstalmentSchedule

type InstalmentSchedule struct {
	CreatedAt     string                   `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency      string                   `url:"currency,omitempty" json:"currency,omitempty"`
	Id            string                   `url:"id,omitempty" json:"id,omitempty"`
	Links         *InstalmentScheduleLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata      map[string]interface{}   `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name          string                   `url:"name,omitempty" json:"name,omitempty"`
	PaymentErrors map[string]interface{}   `url:"payment_errors,omitempty" json:"payment_errors,omitempty"`
	Status        string                   `url:"status,omitempty" json:"status,omitempty"`
	TotalAmount   int                      `url:"total_amount,omitempty" json:"total_amount,omitempty"`
}

InstalmentSchedule model

type InstalmentScheduleCancelParams

type InstalmentScheduleCancelParams struct {
}

InstalmentScheduleCancelParams parameters

type InstalmentScheduleCreateWithDatesParams

type InstalmentScheduleCreateWithDatesParams struct {
	AppFee           int                                                  `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Currency         string                                               `url:"currency,omitempty" json:"currency,omitempty"`
	Instalments      []InstalmentScheduleCreateWithDatesParamsInstalments `url:"instalments,omitempty" json:"instalments,omitempty"`
	Links            InstalmentScheduleCreateWithDatesParamsLinks         `url:"links,omitempty" json:"links,omitempty"`
	Metadata         map[string]interface{}                               `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name             string                                               `url:"name,omitempty" json:"name,omitempty"`
	PaymentReference string                                               `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
	RetryIfPossible  bool                                                 `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
	TotalAmount      int                                                  `url:"total_amount,omitempty" json:"total_amount,omitempty"`
}

InstalmentScheduleCreateWithDatesParams parameters

type InstalmentScheduleCreateWithDatesParamsInstalments

type InstalmentScheduleCreateWithDatesParamsInstalments struct {
	Amount      int    `url:"amount,omitempty" json:"amount,omitempty"`
	ChargeDate  string `url:"charge_date,omitempty" json:"charge_date,omitempty"`
	Description string `url:"description,omitempty" json:"description,omitempty"`
}
type InstalmentScheduleCreateWithDatesParamsLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type InstalmentScheduleCreateWithScheduleParams

type InstalmentScheduleCreateWithScheduleParams struct {
	AppFee           int                                                   `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Currency         string                                                `url:"currency,omitempty" json:"currency,omitempty"`
	Instalments      InstalmentScheduleCreateWithScheduleParamsInstalments `url:"instalments,omitempty" json:"instalments,omitempty"`
	Links            InstalmentScheduleCreateWithScheduleParamsLinks       `url:"links,omitempty" json:"links,omitempty"`
	Metadata         map[string]interface{}                                `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name             string                                                `url:"name,omitempty" json:"name,omitempty"`
	PaymentReference string                                                `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
	RetryIfPossible  bool                                                  `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
	TotalAmount      int                                                   `url:"total_amount,omitempty" json:"total_amount,omitempty"`
}

InstalmentScheduleCreateWithScheduleParams parameters

type InstalmentScheduleCreateWithScheduleParamsInstalments

type InstalmentScheduleCreateWithScheduleParamsInstalments struct {
	Amounts      []int  `url:"amounts,omitempty" json:"amounts,omitempty"`
	Interval     int    `url:"interval,omitempty" json:"interval,omitempty"`
	IntervalUnit string `url:"interval_unit,omitempty" json:"interval_unit,omitempty"`
	StartDate    string `url:"start_date,omitempty" json:"start_date,omitempty"`
}
type InstalmentScheduleCreateWithScheduleParamsLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}
type InstalmentScheduleLinks struct {
	Customer string   `url:"customer,omitempty" json:"customer,omitempty"`
	Mandate  string   `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payments []string `url:"payments,omitempty" json:"payments,omitempty"`
}

type InstalmentScheduleListPagingIterator

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

func (*InstalmentScheduleListPagingIterator) Next

func (*InstalmentScheduleListPagingIterator) Value

type InstalmentScheduleListParams

type InstalmentScheduleListParams struct {
	After     string                                 `url:"after,omitempty" json:"after,omitempty"`
	Before    string                                 `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt *InstalmentScheduleListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Customer  string                                 `url:"customer,omitempty" json:"customer,omitempty"`
	Limit     int                                    `url:"limit,omitempty" json:"limit,omitempty"`
	Mandate   string                                 `url:"mandate,omitempty" json:"mandate,omitempty"`
	Status    []string                               `url:"status,omitempty" json:"status,omitempty"`
}

InstalmentScheduleListParams parameters

type InstalmentScheduleListParamsCreatedAt

type InstalmentScheduleListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type InstalmentScheduleListResult

type InstalmentScheduleListResult struct {
	InstalmentSchedules []InstalmentSchedule             `json:"instalment_schedules"`
	Meta                InstalmentScheduleListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type InstalmentScheduleListResultMeta

type InstalmentScheduleListResultMeta struct {
	Cursors *InstalmentScheduleListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                      `url:"limit,omitempty" json:"limit,omitempty"`
}

type InstalmentScheduleListResultMetaCursors

type InstalmentScheduleListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type InstalmentScheduleServiceImpl

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

InstalmentScheduleService manages instalment_schedules

func (*InstalmentScheduleServiceImpl) Cancel

Cancel Immediately cancels an instalment schedule; no further payments will be collected for it.

This will fail with a `cancellation_failed` error if the instalment schedule is already cancelled or has completed.

func (*InstalmentScheduleServiceImpl) CreateWithDates

CreateWithDates Creates a new instalment schedule object, along with the associated payments. This API is recommended if you know the specific dates you wish to charge. Otherwise, please check out the [scheduling version](#instalment-schedules-create-with-schedule).

The `instalments` property is an array of payment properties (`amount` and `charge_date`).

It can take quite a while to create the associated payments, so the API will return the status as `pending` initially. When processing has completed, a subsequent GET request for the instalment schedule will either have the status `success` and link to the created payments, or the status `error` and detailed information about the failures.

func (*InstalmentScheduleServiceImpl) CreateWithSchedule

CreateWithSchedule Creates a new instalment schedule object, along with the associated payments. This API is recommended if you wish to use the GoCardless scheduling logic. For finer control over the individual dates, please check out the [alternative version](#instalment-schedules-create-with-dates).

It can take quite a while to create the associated payments, so the API will return the status as `pending` initially. When processing has completed, a subsequent GET request for the instalment schedule will either have the status `success` and link to the created payments, or the status `error` and detailed information about the failures.

func (*InstalmentScheduleServiceImpl) Get

Get Retrieves the details of an existing instalment schedule.

func (*InstalmentScheduleServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your instalment schedules.

func (*InstalmentScheduleServiceImpl) Update

Update Updates an instalment schedule. This accepts only the metadata parameter.

type InstalmentScheduleUpdateParams

type InstalmentScheduleUpdateParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

InstalmentScheduleUpdateParams parameters

type Institution

type Institution struct {
	BankRedirect bool   `url:"bank_redirect,omitempty" json:"bank_redirect,omitempty"`
	CountryCode  string `url:"country_code,omitempty" json:"country_code,omitempty"`
	IconUrl      string `url:"icon_url,omitempty" json:"icon_url,omitempty"`
	Id           string `url:"id,omitempty" json:"id,omitempty"`
	LogoUrl      string `url:"logo_url,omitempty" json:"logo_url,omitempty"`
	Name         string `url:"name,omitempty" json:"name,omitempty"`
}

Institution model

type InstitutionListParams

type InstitutionListParams struct {
	CountryCode string `url:"country_code,omitempty" json:"country_code,omitempty"`
}

InstitutionListParams parameters

type InstitutionListResult

type InstitutionListResult struct {
	Institutions []Institution             `json:"institutions"`
	Meta         InstitutionListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type InstitutionListResultMeta

type InstitutionListResultMeta struct {
	Cursors *InstitutionListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                               `url:"limit,omitempty" json:"limit,omitempty"`
}

type InstitutionListResultMetaCursors

type InstitutionListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type InstitutionService

type InstitutionService interface {
	List(ctx context.Context, p InstitutionListParams, opts ...RequestOption) (*InstitutionListResult, error)
}

type InstitutionServiceImpl

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

InstitutionService manages institutions

func (*InstitutionServiceImpl) List

List Returns a list of supported institutions.

type Mandate

type Mandate struct {
	ConsentParameters       *MandateConsentParameters `url:"consent_parameters,omitempty" json:"consent_parameters,omitempty"`
	CreatedAt               string                    `url:"created_at,omitempty" json:"created_at,omitempty"`
	Id                      string                    `url:"id,omitempty" json:"id,omitempty"`
	Links                   *MandateLinks             `url:"links,omitempty" json:"links,omitempty"`
	Metadata                map[string]interface{}    `url:"metadata,omitempty" json:"metadata,omitempty"`
	NextPossibleChargeDate  string                    `url:"next_possible_charge_date,omitempty" json:"next_possible_charge_date,omitempty"`
	PaymentsRequireApproval bool                      `url:"payments_require_approval,omitempty" json:"payments_require_approval,omitempty"`
	Reference               string                    `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme                  string                    `url:"scheme,omitempty" json:"scheme,omitempty"`
	Status                  string                    `url:"status,omitempty" json:"status,omitempty"`
}

Mandate model

type MandateCancelParams

type MandateCancelParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

MandateCancelParams parameters

type MandateConsentParameters

type MandateConsentParameters struct {
	EndDate             string                            `url:"end_date,omitempty" json:"end_date,omitempty"`
	MaxAmountPerPayment int                               `url:"max_amount_per_payment,omitempty" json:"max_amount_per_payment,omitempty"`
	Periods             []MandateConsentParametersPeriods `url:"periods,omitempty" json:"periods,omitempty"`
	StartDate           string                            `url:"start_date,omitempty" json:"start_date,omitempty"`
}

type MandateConsentParametersPeriods

type MandateConsentParametersPeriods struct {
	MaxAmountPerPeriod   int    `url:"max_amount_per_period,omitempty" json:"max_amount_per_period,omitempty"`
	MaxPaymentsPerPeriod int    `url:"max_payments_per_period,omitempty" json:"max_payments_per_period,omitempty"`
	Period               string `url:"period,omitempty" json:"period,omitempty"`
}

type MandateCreateParams

type MandateCreateParams struct {
	Links          MandateCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata       map[string]interface{}   `url:"metadata,omitempty" json:"metadata,omitempty"`
	PayerIpAddress string                   `url:"payer_ip_address,omitempty" json:"payer_ip_address,omitempty"`
	Reference      string                   `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme         string                   `url:"scheme,omitempty" json:"scheme,omitempty"`
}

MandateCreateParams parameters

type MandateCreateParamsLinks struct {
	Creditor            string `url:"creditor,omitempty" json:"creditor,omitempty"`
	CustomerBankAccount string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
}

type MandateImport

type MandateImport struct {
	CreatedAt string `url:"created_at,omitempty" json:"created_at,omitempty"`
	Id        string `url:"id,omitempty" json:"id,omitempty"`
	Scheme    string `url:"scheme,omitempty" json:"scheme,omitempty"`
	Status    string `url:"status,omitempty" json:"status,omitempty"`
}

MandateImport model

type MandateImportCancelParams

type MandateImportCancelParams struct {
}

MandateImportCancelParams parameters

type MandateImportCreateParams

type MandateImportCreateParams struct {
	Scheme string `url:"scheme,omitempty" json:"scheme,omitempty"`
}

MandateImportCreateParams parameters

type MandateImportEntry

type MandateImportEntry struct {
	CreatedAt        string                   `url:"created_at,omitempty" json:"created_at,omitempty"`
	Links            *MandateImportEntryLinks `url:"links,omitempty" json:"links,omitempty"`
	RecordIdentifier string                   `url:"record_identifier,omitempty" json:"record_identifier,omitempty"`
}

MandateImportEntry model

type MandateImportEntryCreateParams

type MandateImportEntryCreateParams struct {
	Amendment        *MandateImportEntryCreateParamsAmendment  `url:"amendment,omitempty" json:"amendment,omitempty"`
	BankAccount      MandateImportEntryCreateParamsBankAccount `url:"bank_account,omitempty" json:"bank_account,omitempty"`
	Customer         MandateImportEntryCreateParamsCustomer    `url:"customer,omitempty" json:"customer,omitempty"`
	Links            MandateImportEntryCreateParamsLinks       `url:"links,omitempty" json:"links,omitempty"`
	RecordIdentifier string                                    `url:"record_identifier,omitempty" json:"record_identifier,omitempty"`
}

MandateImportEntryCreateParams parameters

type MandateImportEntryCreateParamsAmendment

type MandateImportEntryCreateParamsAmendment struct {
	OriginalCreditorId       string `url:"original_creditor_id,omitempty" json:"original_creditor_id,omitempty"`
	OriginalCreditorName     string `url:"original_creditor_name,omitempty" json:"original_creditor_name,omitempty"`
	OriginalMandateReference string `url:"original_mandate_reference,omitempty" json:"original_mandate_reference,omitempty"`
}

type MandateImportEntryCreateParamsBankAccount

type MandateImportEntryCreateParamsBankAccount struct {
	AccountHolderName string `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber     string `url:"account_number,omitempty" json:"account_number,omitempty"`
	BankCode          string `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode        string `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode       string `url:"country_code,omitempty" json:"country_code,omitempty"`
	Iban              string `url:"iban,omitempty" json:"iban,omitempty"`
}

type MandateImportEntryCreateParamsCustomer

type MandateImportEntryCreateParamsCustomer struct {
	AddressLine1          string `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string `url:"given_name,omitempty" json:"given_name,omitempty"`
	Language              string `url:"language,omitempty" json:"language,omitempty"`
	PhoneNumber           string `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode            string `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}
type MandateImportEntryCreateParamsLinks struct {
	MandateImport string `url:"mandate_import,omitempty" json:"mandate_import,omitempty"`
}
type MandateImportEntryLinks struct {
	Customer            string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	Mandate             string `url:"mandate,omitempty" json:"mandate,omitempty"`
	MandateImport       string `url:"mandate_import,omitempty" json:"mandate_import,omitempty"`
}

type MandateImportEntryListPagingIterator

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

func (*MandateImportEntryListPagingIterator) Next

func (*MandateImportEntryListPagingIterator) Value

type MandateImportEntryListParams

type MandateImportEntryListParams struct {
	After         string `url:"after,omitempty" json:"after,omitempty"`
	Before        string `url:"before,omitempty" json:"before,omitempty"`
	Limit         int    `url:"limit,omitempty" json:"limit,omitempty"`
	MandateImport string `url:"mandate_import,omitempty" json:"mandate_import,omitempty"`
}

MandateImportEntryListParams parameters

type MandateImportEntryListResult

type MandateImportEntryListResult struct {
	MandateImportEntries []MandateImportEntry             `json:"mandate_import_entries"`
	Meta                 MandateImportEntryListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type MandateImportEntryListResultMeta

type MandateImportEntryListResultMeta struct {
	Cursors *MandateImportEntryListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                      `url:"limit,omitempty" json:"limit,omitempty"`
}

type MandateImportEntryListResultMetaCursors

type MandateImportEntryListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type MandateImportEntryServiceImpl

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

MandateImportEntryService manages mandate_import_entries

func (*MandateImportEntryServiceImpl) Create

Create For an existing [mandate import](#core-endpoints-mandate-imports), this endpoint can be used to add individual mandates to be imported into GoCardless.

You can add no more than 30,000 rows to a single mandate import. If you attempt to go over this limit, the API will return a `record_limit_exceeded` error.

func (*MandateImportEntryServiceImpl) List

List For an existing mandate import, this endpoint lists all of the entries attached.

After a mandate import has been submitted, you can use this endpoint to associate records in your system (using the `record_identifier` that you provided when creating the mandate import).

type MandateImportGetParams

type MandateImportGetParams struct {
}

MandateImportGetParams parameters

type MandateImportService

type MandateImportService interface {
	Create(ctx context.Context, p MandateImportCreateParams, opts ...RequestOption) (*MandateImport, error)
	Get(ctx context.Context, identity string, p MandateImportGetParams, opts ...RequestOption) (*MandateImport, error)
	Submit(ctx context.Context, identity string, p MandateImportSubmitParams, opts ...RequestOption) (*MandateImport, error)
	Cancel(ctx context.Context, identity string, p MandateImportCancelParams, opts ...RequestOption) (*MandateImport, error)
}

type MandateImportServiceImpl

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

MandateImportService manages mandate_imports

func (*MandateImportServiceImpl) Cancel

Cancel Cancels the mandate import, which aborts the import process and stops the mandates being set up in GoCardless. Once the import has been cancelled, it can no longer have entries added to it. Mandate imports which have already been submitted or processed cannot be cancelled.

func (*MandateImportServiceImpl) Create

Create Mandate imports are first created, before mandates are added one-at-a-time, so this endpoint merely signals the start of the import process. Once you've finished adding entries to an import, you should [submit](#mandate-imports-submit-a-mandate-import) it.

func (*MandateImportServiceImpl) Get

Get Returns a single mandate import.

func (*MandateImportServiceImpl) Submit

Submit Submits the mandate import, which allows it to be processed by a member of the GoCardless team. Once the import has been submitted, it can no longer have entries added to it.

In our sandbox environment, to aid development, we automatically process mandate imports approximately 10 seconds after they are submitted. This will allow you to test both the "submitted" response and wait for the webhook to confirm the processing has begun.

type MandateImportSubmitParams

type MandateImportSubmitParams struct {
}

MandateImportSubmitParams parameters

type MandateLinks struct {
	Creditor            string `url:"creditor,omitempty" json:"creditor,omitempty"`
	Customer            string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	NewMandate          string `url:"new_mandate,omitempty" json:"new_mandate,omitempty"`
}

type MandateListPagingIterator

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

func (*MandateListPagingIterator) Next

func (c *MandateListPagingIterator) Next() bool

func (*MandateListPagingIterator) Value

type MandateListParams

type MandateListParams struct {
	After               string                      `url:"after,omitempty" json:"after,omitempty"`
	Before              string                      `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt           *MandateListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Creditor            string                      `url:"creditor,omitempty" json:"creditor,omitempty"`
	Customer            string                      `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount string                      `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	Limit               int                         `url:"limit,omitempty" json:"limit,omitempty"`
	MandateType         string                      `url:"mandate_type,omitempty" json:"mandate_type,omitempty"`
	Reference           string                      `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme              []string                    `url:"scheme,omitempty" json:"scheme,omitempty"`
	Status              []string                    `url:"status,omitempty" json:"status,omitempty"`
}

MandateListParams parameters

type MandateListParamsCreatedAt

type MandateListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type MandateListResult

type MandateListResult struct {
	Mandates []Mandate             `json:"mandates"`
	Meta     MandateListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type MandateListResultMeta

type MandateListResultMeta struct {
	Cursors *MandateListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                           `url:"limit,omitempty" json:"limit,omitempty"`
}

type MandateListResultMetaCursors

type MandateListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type MandatePdf

type MandatePdf struct {
	ExpiresAt string `url:"expires_at,omitempty" json:"expires_at,omitempty"`
	Url       string `url:"url,omitempty" json:"url,omitempty"`
}

MandatePdf model

type MandatePdfCreateParams

type MandatePdfCreateParams struct {
	AccountHolderName     string                       `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber         string                       `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountType           string                       `url:"account_type,omitempty" json:"account_type,omitempty"`
	AddressLine1          string                       `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                       `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                       `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	BankCode              string                       `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	Bic                   string                       `url:"bic,omitempty" json:"bic,omitempty"`
	BranchCode            string                       `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	City                  string                       `url:"city,omitempty" json:"city,omitempty"`
	CountryCode           string                       `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string                       `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Iban                  string                       `url:"iban,omitempty" json:"iban,omitempty"`
	Links                 *MandatePdfCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	MandateReference      string                       `url:"mandate_reference,omitempty" json:"mandate_reference,omitempty"`
	PayerIpAddress        string                       `url:"payer_ip_address,omitempty" json:"payer_ip_address,omitempty"`
	PhoneNumber           string                       `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode            string                       `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                       `url:"region,omitempty" json:"region,omitempty"`
	Scheme                string                       `url:"scheme,omitempty" json:"scheme,omitempty"`
	SignatureDate         string                       `url:"signature_date,omitempty" json:"signature_date,omitempty"`
	SubscriptionAmount    int                          `url:"subscription_amount,omitempty" json:"subscription_amount,omitempty"`
	SubscriptionFrequency string                       `url:"subscription_frequency,omitempty" json:"subscription_frequency,omitempty"`
	SwedishIdentityNumber string                       `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

MandatePdfCreateParams parameters

type MandatePdfCreateParamsLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type MandatePdfService

type MandatePdfService interface {
	Create(ctx context.Context, p MandatePdfCreateParams, opts ...RequestOption) (*MandatePdf, error)
}

type MandatePdfServiceImpl

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

MandatePdfService manages mandate_pdfs

func (*MandatePdfServiceImpl) Create

Create Generates a PDF mandate and returns its temporary URL.

Customer and bank account details can be left blank (for a blank mandate), provided manually, or inferred from the ID of an existing [mandate](#core-endpoints-mandates).

By default, we'll generate PDF mandates in English.

To generate a PDF mandate in another language, set the `Accept-Language` header when creating the PDF mandate to the relevant [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code supported for the scheme.

| Scheme | Supported languages

|

| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------- | | ACH | English (`en`)

|

| Autogiro | English (`en`), Swedish (`sv`)

|

| Bacs | English (`en`)

|

| BECS | English (`en`)

|

| BECS NZ | English (`en`)

|

| Betalingsservice | Danish (`da`), English (`en`)

|

| PAD | English (`en`)

|

| SEPA Core | Danish (`da`), Dutch (`nl`), English (`en`), French (`fr`), German (`de`), Italian (`it`), Portuguese (`pt`), Spanish (`es`), Swedish (`sv`) |

type MandateReinstateParams

type MandateReinstateParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

MandateReinstateParams parameters

type MandateService

type MandateService interface {
	Create(ctx context.Context, p MandateCreateParams, opts ...RequestOption) (*Mandate, error)
	List(ctx context.Context, p MandateListParams, opts ...RequestOption) (*MandateListResult, error)
	All(ctx context.Context, p MandateListParams, opts ...RequestOption) *MandateListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Mandate, error)
	Update(ctx context.Context, identity string, p MandateUpdateParams, opts ...RequestOption) (*Mandate, error)
	Cancel(ctx context.Context, identity string, p MandateCancelParams, opts ...RequestOption) (*Mandate, error)
	Reinstate(ctx context.Context, identity string, p MandateReinstateParams, opts ...RequestOption) (*Mandate, error)
}

type MandateServiceImpl

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

MandateService manages mandates

func (*MandateServiceImpl) All

func (*MandateServiceImpl) Cancel

func (s *MandateServiceImpl) Cancel(ctx context.Context, identity string, p MandateCancelParams, opts ...RequestOption) (*Mandate, error)

Cancel Immediately cancels a mandate and all associated cancellable payments. Any metadata supplied to this endpoint will be stored on the mandate cancellation event it causes.

This will fail with a `cancellation_failed` error if the mandate is already cancelled.

func (*MandateServiceImpl) Create

Create Creates a new mandate object.

func (*MandateServiceImpl) Get

func (s *MandateServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Mandate, error)

Get Retrieves the details of an existing mandate.

func (*MandateServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your mandates.

func (*MandateServiceImpl) Reinstate

func (s *MandateServiceImpl) Reinstate(ctx context.Context, identity string, p MandateReinstateParams, opts ...RequestOption) (*Mandate, error)

Reinstate <a name="mandate_not_inactive"></a>Reinstates a cancelled or expired mandate to the banks. You will receive a `resubmission_requested` webhook, but after that reinstating the mandate follows the same process as its initial creation, so you will receive a `submitted` webhook, followed by a `reinstated` or `failed` webhook up to two working days later. Any metadata supplied to this endpoint will be stored on the `resubmission_requested` event it causes.

This will fail with a `mandate_not_inactive` error if the mandate is already being submitted, or is active.

Mandates can be resubmitted up to 10 times.

func (*MandateServiceImpl) Update

func (s *MandateServiceImpl) Update(ctx context.Context, identity string, p MandateUpdateParams, opts ...RequestOption) (*Mandate, error)

Update Updates a mandate object. This accepts only the metadata parameter.

type MandateUpdateParams

type MandateUpdateParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

MandateUpdateParams parameters

type PagingIterator

type PagingIterator interface {
	Next() bool
	Value(context.Context) interface{}
}

type PayerAuthorisation

type PayerAuthorisation struct {
	BankAccount      *PayerAuthorisationBankAccount       `url:"bank_account,omitempty" json:"bank_account,omitempty"`
	CreatedAt        string                               `url:"created_at,omitempty" json:"created_at,omitempty"`
	Customer         *PayerAuthorisationCustomer          `url:"customer,omitempty" json:"customer,omitempty"`
	Id               string                               `url:"id,omitempty" json:"id,omitempty"`
	IncompleteFields []PayerAuthorisationIncompleteFields `url:"incomplete_fields,omitempty" json:"incomplete_fields,omitempty"`
	Links            *PayerAuthorisationLinks             `url:"links,omitempty" json:"links,omitempty"`
	Mandate          *PayerAuthorisationMandate           `url:"mandate,omitempty" json:"mandate,omitempty"`
	Status           string                               `url:"status,omitempty" json:"status,omitempty"`
}

PayerAuthorisation model

type PayerAuthorisationBankAccount

type PayerAuthorisationBankAccount struct {
	AccountHolderName   string                 `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber       string                 `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountNumberEnding string                 `url:"account_number_ending,omitempty" json:"account_number_ending,omitempty"`
	AccountNumberSuffix string                 `url:"account_number_suffix,omitempty" json:"account_number_suffix,omitempty"`
	AccountType         string                 `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankCode            string                 `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode          string                 `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode         string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency            string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Iban                string                 `url:"iban,omitempty" json:"iban,omitempty"`
	Metadata            map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

type PayerAuthorisationCreateParams

type PayerAuthorisationCreateParams struct {
	BankAccount PayerAuthorisationCreateParamsBankAccount `url:"bank_account,omitempty" json:"bank_account,omitempty"`
	Customer    PayerAuthorisationCreateParamsCustomer    `url:"customer,omitempty" json:"customer,omitempty"`
	Mandate     PayerAuthorisationCreateParamsMandate     `url:"mandate,omitempty" json:"mandate,omitempty"`
}

PayerAuthorisationCreateParams parameters

type PayerAuthorisationCreateParamsBankAccount

type PayerAuthorisationCreateParamsBankAccount struct {
	AccountHolderName   string                 `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber       string                 `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountNumberEnding string                 `url:"account_number_ending,omitempty" json:"account_number_ending,omitempty"`
	AccountNumberSuffix string                 `url:"account_number_suffix,omitempty" json:"account_number_suffix,omitempty"`
	AccountType         string                 `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankCode            string                 `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode          string                 `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode         string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency            string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Iban                string                 `url:"iban,omitempty" json:"iban,omitempty"`
	Metadata            map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

type PayerAuthorisationCreateParamsCustomer

type PayerAuthorisationCreateParamsCustomer struct {
	AddressLine1          string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string                 `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string                 `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Locale                string                 `url:"locale,omitempty" json:"locale,omitempty"`
	Metadata              map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PostalCode            string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                 `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string                 `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type PayerAuthorisationCreateParamsMandate

type PayerAuthorisationCreateParamsMandate struct {
	Metadata       map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PayerIpAddress string                 `url:"payer_ip_address,omitempty" json:"payer_ip_address,omitempty"`
	Reference      string                 `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme         string                 `url:"scheme,omitempty" json:"scheme,omitempty"`
}

type PayerAuthorisationCustomer

type PayerAuthorisationCustomer struct {
	AddressLine1          string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string                 `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string                 `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Locale                string                 `url:"locale,omitempty" json:"locale,omitempty"`
	Metadata              map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PostalCode            string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                 `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string                 `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type PayerAuthorisationIncompleteFields

type PayerAuthorisationIncompleteFields struct {
	Field          string `url:"field,omitempty" json:"field,omitempty"`
	Message        string `url:"message,omitempty" json:"message,omitempty"`
	RequestPointer string `url:"request_pointer,omitempty" json:"request_pointer,omitempty"`
}
type PayerAuthorisationLinks struct {
	BankAccount string `url:"bank_account,omitempty" json:"bank_account,omitempty"`
	Customer    string `url:"customer,omitempty" json:"customer,omitempty"`
	Mandate     string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type PayerAuthorisationMandate

type PayerAuthorisationMandate struct {
	Metadata       map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PayerIpAddress string                 `url:"payer_ip_address,omitempty" json:"payer_ip_address,omitempty"`
	Reference      string                 `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme         string                 `url:"scheme,omitempty" json:"scheme,omitempty"`
}

type PayerAuthorisationService

type PayerAuthorisationService interface {
	Get(ctx context.Context, identity string, opts ...RequestOption) (*PayerAuthorisation, error)
	Create(ctx context.Context, p PayerAuthorisationCreateParams, opts ...RequestOption) (*PayerAuthorisation, error)
	Update(ctx context.Context, identity string, p PayerAuthorisationUpdateParams, opts ...RequestOption) (*PayerAuthorisation, error)
	Submit(ctx context.Context, identity string, opts ...RequestOption) (*PayerAuthorisation, error)
	Confirm(ctx context.Context, identity string, opts ...RequestOption) (*PayerAuthorisation, error)
}

type PayerAuthorisationServiceImpl

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

PayerAuthorisationService manages payer_authorisations

func (*PayerAuthorisationServiceImpl) Confirm

Confirm Confirms the Payer Authorisation, indicating that the resources are ready to be created. A Payer Authorisation cannot be confirmed if it hasn't been submitted yet.

<p class="notice">

The main use of the confirm endpoint is to enable integrators to

acknowledge the end of the setup process.

They might want to make the payers go through some other steps after they

go through our flow or make them go through the necessary verification mechanism (upcoming feature). </p>

func (*PayerAuthorisationServiceImpl) Create

Create Creates a Payer Authorisation. The resource is saved to the database even if incomplete. An empty array of incomplete_fields means that the resource is valid. The ID of the resource is used for the other actions. This endpoint has been designed this way so you do not need to save any payer data on your servers or the browser while still being able to implement a progressive solution, such as a multi-step form.

func (*PayerAuthorisationServiceImpl) Get

Get Retrieves the details of a single existing Payer Authorisation. It can be used for polling the status of a Payer Authorisation.

func (*PayerAuthorisationServiceImpl) Submit

Submit Submits all the data previously pushed to this PayerAuthorisation for verification. This time, a 200 HTTP status is returned if the resource is valid and a 422 error response in case of validation errors. After it is successfully submitted, the Payer Authorisation can no longer be edited.

func (*PayerAuthorisationServiceImpl) Update

Update Updates a Payer Authorisation. Updates the Payer Authorisation with the request data. Can be invoked as many times as needed. Only fields present in the request will be modified. An empty array of incomplete_fields means that the resource is valid. This endpoint has been designed this way so you do not need to save any payer data on your servers or the browser while still being able to implement a progressive solution, such a multi-step form. <p class="notice"> Note that in order to update the `metadata` attribute values it must be sent completely as it overrides the previously existing values. </p>

type PayerAuthorisationUpdateParams

type PayerAuthorisationUpdateParams struct {
	BankAccount PayerAuthorisationUpdateParamsBankAccount `url:"bank_account,omitempty" json:"bank_account,omitempty"`
	Customer    PayerAuthorisationUpdateParamsCustomer    `url:"customer,omitempty" json:"customer,omitempty"`
	Mandate     PayerAuthorisationUpdateParamsMandate     `url:"mandate,omitempty" json:"mandate,omitempty"`
}

PayerAuthorisationUpdateParams parameters

type PayerAuthorisationUpdateParamsBankAccount

type PayerAuthorisationUpdateParamsBankAccount struct {
	AccountHolderName   string                 `url:"account_holder_name,omitempty" json:"account_holder_name,omitempty"`
	AccountNumber       string                 `url:"account_number,omitempty" json:"account_number,omitempty"`
	AccountNumberEnding string                 `url:"account_number_ending,omitempty" json:"account_number_ending,omitempty"`
	AccountNumberSuffix string                 `url:"account_number_suffix,omitempty" json:"account_number_suffix,omitempty"`
	AccountType         string                 `url:"account_type,omitempty" json:"account_type,omitempty"`
	BankCode            string                 `url:"bank_code,omitempty" json:"bank_code,omitempty"`
	BranchCode          string                 `url:"branch_code,omitempty" json:"branch_code,omitempty"`
	CountryCode         string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	Currency            string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Iban                string                 `url:"iban,omitempty" json:"iban,omitempty"`
	Metadata            map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

type PayerAuthorisationUpdateParamsCustomer

type PayerAuthorisationUpdateParamsCustomer struct {
	AddressLine1          string                 `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string                 `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string                 `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string                 `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string                 `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string                 `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string                 `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string                 `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string                 `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string                 `url:"given_name,omitempty" json:"given_name,omitempty"`
	Locale                string                 `url:"locale,omitempty" json:"locale,omitempty"`
	Metadata              map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PostalCode            string                 `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string                 `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string                 `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}

type PayerAuthorisationUpdateParamsMandate

type PayerAuthorisationUpdateParamsMandate struct {
	Metadata       map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PayerIpAddress string                 `url:"payer_ip_address,omitempty" json:"payer_ip_address,omitempty"`
	Reference      string                 `url:"reference,omitempty" json:"reference,omitempty"`
	Scheme         string                 `url:"scheme,omitempty" json:"scheme,omitempty"`
}

type Payment

type Payment struct {
	Amount          int                    `url:"amount,omitempty" json:"amount,omitempty"`
	AmountRefunded  int                    `url:"amount_refunded,omitempty" json:"amount_refunded,omitempty"`
	ChargeDate      string                 `url:"charge_date,omitempty" json:"charge_date,omitempty"`
	CreatedAt       string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency        string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Description     string                 `url:"description,omitempty" json:"description,omitempty"`
	Fx              *PaymentFx             `url:"fx,omitempty" json:"fx,omitempty"`
	Id              string                 `url:"id,omitempty" json:"id,omitempty"`
	Links           *PaymentLinks          `url:"links,omitempty" json:"links,omitempty"`
	Metadata        map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	Reference       string                 `url:"reference,omitempty" json:"reference,omitempty"`
	RetryIfPossible bool                   `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
	Status          string                 `url:"status,omitempty" json:"status,omitempty"`
}

Payment model

type PaymentCancelParams

type PaymentCancelParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

PaymentCancelParams parameters

type PaymentCreateParams

type PaymentCreateParams struct {
	Amount          int                      `url:"amount,omitempty" json:"amount,omitempty"`
	AppFee          int                      `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	ChargeDate      string                   `url:"charge_date,omitempty" json:"charge_date,omitempty"`
	Currency        string                   `url:"currency,omitempty" json:"currency,omitempty"`
	Description     string                   `url:"description,omitempty" json:"description,omitempty"`
	Links           PaymentCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata        map[string]interface{}   `url:"metadata,omitempty" json:"metadata,omitempty"`
	Reference       string                   `url:"reference,omitempty" json:"reference,omitempty"`
	RetryIfPossible bool                     `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
}

PaymentCreateParams parameters

type PaymentCreateParamsLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type PaymentFx

type PaymentFx struct {
	EstimatedExchangeRate string `url:"estimated_exchange_rate,omitempty" json:"estimated_exchange_rate,omitempty"`
	ExchangeRate          string `url:"exchange_rate,omitempty" json:"exchange_rate,omitempty"`
	FxAmount              int    `url:"fx_amount,omitempty" json:"fx_amount,omitempty"`
	FxCurrency            string `url:"fx_currency,omitempty" json:"fx_currency,omitempty"`
}
type PaymentLinks struct {
	Creditor           string `url:"creditor,omitempty" json:"creditor,omitempty"`
	InstalmentSchedule string `url:"instalment_schedule,omitempty" json:"instalment_schedule,omitempty"`
	Mandate            string `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payout             string `url:"payout,omitempty" json:"payout,omitempty"`
	Subscription       string `url:"subscription,omitempty" json:"subscription,omitempty"`
}

type PaymentListPagingIterator

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

func (*PaymentListPagingIterator) Next

func (c *PaymentListPagingIterator) Next() bool

func (*PaymentListPagingIterator) Value

type PaymentListParams

type PaymentListParams struct {
	After         string                       `url:"after,omitempty" json:"after,omitempty"`
	Before        string                       `url:"before,omitempty" json:"before,omitempty"`
	ChargeDate    *PaymentListParamsChargeDate `url:"charge_date,omitempty" json:"charge_date,omitempty"`
	CreatedAt     *PaymentListParamsCreatedAt  `url:"created_at,omitempty" json:"created_at,omitempty"`
	Creditor      string                       `url:"creditor,omitempty" json:"creditor,omitempty"`
	Currency      string                       `url:"currency,omitempty" json:"currency,omitempty"`
	Customer      string                       `url:"customer,omitempty" json:"customer,omitempty"`
	Limit         int                          `url:"limit,omitempty" json:"limit,omitempty"`
	Mandate       string                       `url:"mandate,omitempty" json:"mandate,omitempty"`
	SortDirection string                       `url:"sort_direction,omitempty" json:"sort_direction,omitempty"`
	SortField     string                       `url:"sort_field,omitempty" json:"sort_field,omitempty"`
	Status        string                       `url:"status,omitempty" json:"status,omitempty"`
	Subscription  string                       `url:"subscription,omitempty" json:"subscription,omitempty"`
}

PaymentListParams parameters

type PaymentListParamsChargeDate

type PaymentListParamsChargeDate struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type PaymentListParamsCreatedAt

type PaymentListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type PaymentListResult

type PaymentListResult struct {
	Payments []Payment             `json:"payments"`
	Meta     PaymentListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type PaymentListResultMeta

type PaymentListResultMeta struct {
	Cursors *PaymentListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                           `url:"limit,omitempty" json:"limit,omitempty"`
}

type PaymentListResultMetaCursors

type PaymentListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type PaymentRetryParams

type PaymentRetryParams struct {
	ChargeDate string                 `url:"charge_date,omitempty" json:"charge_date,omitempty"`
	Metadata   map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

PaymentRetryParams parameters

type PaymentService

type PaymentService interface {
	Create(ctx context.Context, p PaymentCreateParams, opts ...RequestOption) (*Payment, error)
	List(ctx context.Context, p PaymentListParams, opts ...RequestOption) (*PaymentListResult, error)
	All(ctx context.Context, p PaymentListParams, opts ...RequestOption) *PaymentListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Payment, error)
	Update(ctx context.Context, identity string, p PaymentUpdateParams, opts ...RequestOption) (*Payment, error)
	Cancel(ctx context.Context, identity string, p PaymentCancelParams, opts ...RequestOption) (*Payment, error)
	Retry(ctx context.Context, identity string, p PaymentRetryParams, opts ...RequestOption) (*Payment, error)
}

type PaymentServiceImpl

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

PaymentService manages payments

func (*PaymentServiceImpl) All

func (*PaymentServiceImpl) Cancel

func (s *PaymentServiceImpl) Cancel(ctx context.Context, identity string, p PaymentCancelParams, opts ...RequestOption) (*Payment, error)

Cancel Cancels the payment if it has not already been submitted to the banks. Any metadata supplied to this endpoint will be stored on the payment cancellation event it causes.

This will fail with a `cancellation_failed` error unless the payment's status is `pending_submission`.

func (*PaymentServiceImpl) Create

Create <a name="mandate_is_inactive"></a>Creates a new payment object.

This fails with a `mandate_is_inactive` error if the linked [mandate](#core-endpoints-mandates) is cancelled or has failed. Payments can be created against mandates with status of: `pending_customer_approval`, `pending_submission`, `submitted`, and `active`.

func (*PaymentServiceImpl) Get

func (s *PaymentServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Payment, error)

Get Retrieves the details of a single existing payment.

func (*PaymentServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payments.

func (*PaymentServiceImpl) Retry

func (s *PaymentServiceImpl) Retry(ctx context.Context, identity string, p PaymentRetryParams, opts ...RequestOption) (*Payment, error)

Retry <a name="retry_failed"></a>Retries a failed payment if the underlying mandate is active. You will receive a `resubmission_requested` webhook, but after that retrying the payment follows the same process as its initial creation, so you will receive a `submitted` webhook, followed by a `confirmed` or `failed` event. Any metadata supplied to this endpoint will be stored against the payment submission event it causes.

This will return a `retry_failed` error if the payment has not failed.

Payments can be retried up to 3 times.

func (*PaymentServiceImpl) Update

func (s *PaymentServiceImpl) Update(ctx context.Context, identity string, p PaymentUpdateParams, opts ...RequestOption) (*Payment, error)

Update Updates a payment object. This accepts only the metadata parameter.

type PaymentUpdateParams

type PaymentUpdateParams struct {
	Metadata        map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	RetryIfPossible bool                   `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
}

PaymentUpdateParams parameters

type Payout

type Payout struct {
	Amount       int                    `url:"amount,omitempty" json:"amount,omitempty"`
	ArrivalDate  string                 `url:"arrival_date,omitempty" json:"arrival_date,omitempty"`
	CreatedAt    string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency     string                 `url:"currency,omitempty" json:"currency,omitempty"`
	DeductedFees int                    `url:"deducted_fees,omitempty" json:"deducted_fees,omitempty"`
	Fx           *PayoutFx              `url:"fx,omitempty" json:"fx,omitempty"`
	Id           string                 `url:"id,omitempty" json:"id,omitempty"`
	Links        *PayoutLinks           `url:"links,omitempty" json:"links,omitempty"`
	Metadata     map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PayoutType   string                 `url:"payout_type,omitempty" json:"payout_type,omitempty"`
	Reference    string                 `url:"reference,omitempty" json:"reference,omitempty"`
	Status       string                 `url:"status,omitempty" json:"status,omitempty"`
	TaxCurrency  string                 `url:"tax_currency,omitempty" json:"tax_currency,omitempty"`
}

Payout model

type PayoutFx

type PayoutFx struct {
	EstimatedExchangeRate string `url:"estimated_exchange_rate,omitempty" json:"estimated_exchange_rate,omitempty"`
	ExchangeRate          string `url:"exchange_rate,omitempty" json:"exchange_rate,omitempty"`
	FxAmount              int    `url:"fx_amount,omitempty" json:"fx_amount,omitempty"`
	FxCurrency            string `url:"fx_currency,omitempty" json:"fx_currency,omitempty"`
}

type PayoutItem

type PayoutItem struct {
	Amount string            `url:"amount,omitempty" json:"amount,omitempty"`
	Links  *PayoutItemLinks  `url:"links,omitempty" json:"links,omitempty"`
	Taxes  []PayoutItemTaxes `url:"taxes,omitempty" json:"taxes,omitempty"`
	Type   string            `url:"type,omitempty" json:"type,omitempty"`
}

PayoutItem model

type PayoutItemLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payment string `url:"payment,omitempty" json:"payment,omitempty"`
	Refund  string `url:"refund,omitempty" json:"refund,omitempty"`
}

type PayoutItemListPagingIterator

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

func (*PayoutItemListPagingIterator) Next

func (*PayoutItemListPagingIterator) Value

type PayoutItemListParams

type PayoutItemListParams struct {
	After                 string `url:"after,omitempty" json:"after,omitempty"`
	Before                string `url:"before,omitempty" json:"before,omitempty"`
	Include2020TaxCutover string `url:"include_2020_tax_cutover,omitempty" json:"include_2020_tax_cutover,omitempty"`
	Limit                 int    `url:"limit,omitempty" json:"limit,omitempty"`
	Payout                string `url:"payout,omitempty" json:"payout,omitempty"`
}

PayoutItemListParams parameters

type PayoutItemListResult

type PayoutItemListResult struct {
	PayoutItems []PayoutItem             `json:"payout_items"`
	Meta        PayoutItemListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type PayoutItemListResultMeta

type PayoutItemListResultMeta struct {
	Cursors *PayoutItemListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                              `url:"limit,omitempty" json:"limit,omitempty"`
}

type PayoutItemListResultMetaCursors

type PayoutItemListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type PayoutItemServiceImpl

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

PayoutItemService manages payout_items

func (*PayoutItemServiceImpl) All

func (*PayoutItemServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of items in the payout.

<div class="notice notice--warning u-block">

<strong>Note</strong>: From 1 March 2023 onwards, we will only serve

requests for payout items created in the last 6 months. Requests for older payouts will return an HTTP status <code>410 Gone</code>. </div>

type PayoutItemTaxes

type PayoutItemTaxes struct {
	Amount              string `url:"amount,omitempty" json:"amount,omitempty"`
	Currency            string `url:"currency,omitempty" json:"currency,omitempty"`
	DestinationAmount   string `url:"destination_amount,omitempty" json:"destination_amount,omitempty"`
	DestinationCurrency string `url:"destination_currency,omitempty" json:"destination_currency,omitempty"`
	ExchangeRate        string `url:"exchange_rate,omitempty" json:"exchange_rate,omitempty"`
	TaxRateId           string `url:"tax_rate_id,omitempty" json:"tax_rate_id,omitempty"`
}
type PayoutLinks struct {
	Creditor            string `url:"creditor,omitempty" json:"creditor,omitempty"`
	CreditorBankAccount string `url:"creditor_bank_account,omitempty" json:"creditor_bank_account,omitempty"`
}

type PayoutListPagingIterator

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

func (*PayoutListPagingIterator) Next

func (c *PayoutListPagingIterator) Next() bool

func (*PayoutListPagingIterator) Value

type PayoutListParams

type PayoutListParams struct {
	After               string                     `url:"after,omitempty" json:"after,omitempty"`
	Before              string                     `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt           *PayoutListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Creditor            string                     `url:"creditor,omitempty" json:"creditor,omitempty"`
	CreditorBankAccount string                     `url:"creditor_bank_account,omitempty" json:"creditor_bank_account,omitempty"`
	Currency            string                     `url:"currency,omitempty" json:"currency,omitempty"`
	Limit               int                        `url:"limit,omitempty" json:"limit,omitempty"`
	Metadata            map[string]interface{}     `url:"metadata,omitempty" json:"metadata,omitempty"`
	PayoutType          string                     `url:"payout_type,omitempty" json:"payout_type,omitempty"`
	Reference           string                     `url:"reference,omitempty" json:"reference,omitempty"`
	Status              string                     `url:"status,omitempty" json:"status,omitempty"`
}

PayoutListParams parameters

type PayoutListParamsCreatedAt

type PayoutListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type PayoutListResult

type PayoutListResult struct {
	Payouts []Payout             `json:"payouts"`
	Meta    PayoutListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type PayoutListResultMeta

type PayoutListResultMeta struct {
	Cursors *PayoutListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                          `url:"limit,omitempty" json:"limit,omitempty"`
}

type PayoutListResultMetaCursors

type PayoutListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type PayoutService

type PayoutService interface {
	List(ctx context.Context, p PayoutListParams, opts ...RequestOption) (*PayoutListResult, error)
	All(ctx context.Context, p PayoutListParams, opts ...RequestOption) *PayoutListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Payout, error)
	Update(ctx context.Context, identity string, p PayoutUpdateParams, opts ...RequestOption) (*Payout, error)
}

type PayoutServiceImpl

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

PayoutService manages payouts

func (*PayoutServiceImpl) All

func (*PayoutServiceImpl) Get

func (s *PayoutServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Payout, error)

Get Retrieves the details of a single payout. For an example of how to reconcile the transactions in a payout, see [this guide](#events-reconciling-payouts-with-events).

func (*PayoutServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payouts.

func (*PayoutServiceImpl) Update

func (s *PayoutServiceImpl) Update(ctx context.Context, identity string, p PayoutUpdateParams, opts ...RequestOption) (*Payout, error)

Update Updates a payout object. This accepts only the metadata parameter.

type PayoutUpdateParams

type PayoutUpdateParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

PayoutUpdateParams parameters

type RedirectFlow

type RedirectFlow struct {
	ConfirmationUrl    string                 `url:"confirmation_url,omitempty" json:"confirmation_url,omitempty"`
	CreatedAt          string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Description        string                 `url:"description,omitempty" json:"description,omitempty"`
	Id                 string                 `url:"id,omitempty" json:"id,omitempty"`
	Links              *RedirectFlowLinks     `url:"links,omitempty" json:"links,omitempty"`
	MandateReference   string                 `url:"mandate_reference,omitempty" json:"mandate_reference,omitempty"`
	Metadata           map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	RedirectUrl        string                 `url:"redirect_url,omitempty" json:"redirect_url,omitempty"`
	Scheme             string                 `url:"scheme,omitempty" json:"scheme,omitempty"`
	SessionToken       string                 `url:"session_token,omitempty" json:"session_token,omitempty"`
	SuccessRedirectUrl string                 `url:"success_redirect_url,omitempty" json:"success_redirect_url,omitempty"`
}

RedirectFlow model

type RedirectFlowCompleteParams

type RedirectFlowCompleteParams struct {
	SessionToken string `url:"session_token,omitempty" json:"session_token,omitempty"`
}

RedirectFlowCompleteParams parameters

type RedirectFlowCreateParams

type RedirectFlowCreateParams struct {
	Description          string                                        `url:"description,omitempty" json:"description,omitempty"`
	Links                *RedirectFlowCreateParamsLinks                `url:"links,omitempty" json:"links,omitempty"`
	Metadata             map[string]interface{}                        `url:"metadata,omitempty" json:"metadata,omitempty"`
	PrefilledBankAccount *RedirectFlowCreateParamsPrefilledBankAccount `url:"prefilled_bank_account,omitempty" json:"prefilled_bank_account,omitempty"`
	PrefilledCustomer    *RedirectFlowCreateParamsPrefilledCustomer    `url:"prefilled_customer,omitempty" json:"prefilled_customer,omitempty"`
	Scheme               string                                        `url:"scheme,omitempty" json:"scheme,omitempty"`
	SessionToken         string                                        `url:"session_token,omitempty" json:"session_token,omitempty"`
	SuccessRedirectUrl   string                                        `url:"success_redirect_url,omitempty" json:"success_redirect_url,omitempty"`
}

RedirectFlowCreateParams parameters

type RedirectFlowCreateParamsLinks struct {
	Creditor string `url:"creditor,omitempty" json:"creditor,omitempty"`
}

type RedirectFlowCreateParamsPrefilledBankAccount

type RedirectFlowCreateParamsPrefilledBankAccount struct {
	AccountType string `url:"account_type,omitempty" json:"account_type,omitempty"`
}

type RedirectFlowCreateParamsPrefilledCustomer

type RedirectFlowCreateParamsPrefilledCustomer struct {
	AddressLine1          string `url:"address_line1,omitempty" json:"address_line1,omitempty"`
	AddressLine2          string `url:"address_line2,omitempty" json:"address_line2,omitempty"`
	AddressLine3          string `url:"address_line3,omitempty" json:"address_line3,omitempty"`
	City                  string `url:"city,omitempty" json:"city,omitempty"`
	CompanyName           string `url:"company_name,omitempty" json:"company_name,omitempty"`
	CountryCode           string `url:"country_code,omitempty" json:"country_code,omitempty"`
	DanishIdentityNumber  string `url:"danish_identity_number,omitempty" json:"danish_identity_number,omitempty"`
	Email                 string `url:"email,omitempty" json:"email,omitempty"`
	FamilyName            string `url:"family_name,omitempty" json:"family_name,omitempty"`
	GivenName             string `url:"given_name,omitempty" json:"given_name,omitempty"`
	Language              string `url:"language,omitempty" json:"language,omitempty"`
	PhoneNumber           string `url:"phone_number,omitempty" json:"phone_number,omitempty"`
	PostalCode            string `url:"postal_code,omitempty" json:"postal_code,omitempty"`
	Region                string `url:"region,omitempty" json:"region,omitempty"`
	SwedishIdentityNumber string `url:"swedish_identity_number,omitempty" json:"swedish_identity_number,omitempty"`
}
type RedirectFlowLinks struct {
	BillingRequest      string `url:"billing_request,omitempty" json:"billing_request,omitempty"`
	Creditor            string `url:"creditor,omitempty" json:"creditor,omitempty"`
	Customer            string `url:"customer,omitempty" json:"customer,omitempty"`
	CustomerBankAccount string `url:"customer_bank_account,omitempty" json:"customer_bank_account,omitempty"`
	Mandate             string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type RedirectFlowService

type RedirectFlowService interface {
	Create(ctx context.Context, p RedirectFlowCreateParams, opts ...RequestOption) (*RedirectFlow, error)
	Get(ctx context.Context, identity string, opts ...RequestOption) (*RedirectFlow, error)
	Complete(ctx context.Context, identity string, p RedirectFlowCompleteParams, opts ...RequestOption) (*RedirectFlow, error)
}

type RedirectFlowServiceImpl

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

RedirectFlowService manages redirect_flows

func (*RedirectFlowServiceImpl) Complete

Complete This creates a [customer](#core-endpoints-customers), [customer bank account](#core-endpoints-customer-bank-accounts), and [mandate](#core-endpoints-mandates) using the details supplied by your customer and returns the ID of the created mandate.

This will return a `redirect_flow_incomplete` error if your customer has not yet been redirected back to your site, and a `redirect_flow_already_completed` error if your integration has already completed this flow. It will return a `bad_request` error if the `session_token` differs to the one supplied when the redirect flow was created.

func (*RedirectFlowServiceImpl) Create

Create Creates a redirect flow object which can then be used to redirect your customer to the GoCardless hosted payment pages.

func (*RedirectFlowServiceImpl) Get

func (s *RedirectFlowServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*RedirectFlow, error)

Get Returns all details about a single redirect flow

type Refund

type Refund struct {
	Amount    int                    `url:"amount,omitempty" json:"amount,omitempty"`
	CreatedAt string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency  string                 `url:"currency,omitempty" json:"currency,omitempty"`
	Fx        *RefundFx              `url:"fx,omitempty" json:"fx,omitempty"`
	Id        string                 `url:"id,omitempty" json:"id,omitempty"`
	Links     *RefundLinks           `url:"links,omitempty" json:"links,omitempty"`
	Metadata  map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	Reference string                 `url:"reference,omitempty" json:"reference,omitempty"`
	Status    string                 `url:"status,omitempty" json:"status,omitempty"`
}

Refund model

type RefundCreateParams

type RefundCreateParams struct {
	Amount                  int                     `url:"amount,omitempty" json:"amount,omitempty"`
	Links                   RefundCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata                map[string]interface{}  `url:"metadata,omitempty" json:"metadata,omitempty"`
	Reference               string                  `url:"reference,omitempty" json:"reference,omitempty"`
	TotalAmountConfirmation int                     `url:"total_amount_confirmation,omitempty" json:"total_amount_confirmation,omitempty"`
}

RefundCreateParams parameters

type RefundCreateParamsLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payment string `url:"payment,omitempty" json:"payment,omitempty"`
}

type RefundFx

type RefundFx struct {
	EstimatedExchangeRate string `url:"estimated_exchange_rate,omitempty" json:"estimated_exchange_rate,omitempty"`
	ExchangeRate          string `url:"exchange_rate,omitempty" json:"exchange_rate,omitempty"`
	FxAmount              int    `url:"fx_amount,omitempty" json:"fx_amount,omitempty"`
	FxCurrency            string `url:"fx_currency,omitempty" json:"fx_currency,omitempty"`
}
type RefundLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payment string `url:"payment,omitempty" json:"payment,omitempty"`
}

type RefundListPagingIterator

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

func (*RefundListPagingIterator) Next

func (c *RefundListPagingIterator) Next() bool

func (*RefundListPagingIterator) Value

type RefundListParams

type RefundListParams struct {
	After      string                     `url:"after,omitempty" json:"after,omitempty"`
	Before     string                     `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt  *RefundListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Limit      int                        `url:"limit,omitempty" json:"limit,omitempty"`
	Mandate    string                     `url:"mandate,omitempty" json:"mandate,omitempty"`
	Payment    string                     `url:"payment,omitempty" json:"payment,omitempty"`
	RefundType string                     `url:"refund_type,omitempty" json:"refund_type,omitempty"`
}

RefundListParams parameters

type RefundListParamsCreatedAt

type RefundListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type RefundListResult

type RefundListResult struct {
	Refunds []Refund             `json:"refunds"`
	Meta    RefundListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type RefundListResultMeta

type RefundListResultMeta struct {
	Cursors *RefundListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                          `url:"limit,omitempty" json:"limit,omitempty"`
}

type RefundListResultMetaCursors

type RefundListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type RefundService

type RefundService interface {
	Create(ctx context.Context, p RefundCreateParams, opts ...RequestOption) (*Refund, error)
	List(ctx context.Context, p RefundListParams, opts ...RequestOption) (*RefundListResult, error)
	All(ctx context.Context, p RefundListParams, opts ...RequestOption) *RefundListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Refund, error)
	Update(ctx context.Context, identity string, p RefundUpdateParams, opts ...RequestOption) (*Refund, error)
}

type RefundServiceImpl

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

RefundService manages refunds

func (*RefundServiceImpl) All

func (*RefundServiceImpl) Create

Create Creates a new refund object.

This fails with:<a name="total_amount_confirmation_invalid"></a><a name="number_of_refunds_exceeded"></a><a name="available_refund_amount_insufficient"></a>

- `total_amount_confirmation_invalid` if the confirmation amount doesn't match the total amount refunded for the payment. This safeguard is there to prevent two processes from creating refunds without awareness of each other.

- `number_of_refunds_exceeded` if five or more refunds have already been created against the payment.

- `available_refund_amount_insufficient` if the creditor does not have sufficient balance for refunds available to cover the cost of the requested refund.

func (*RefundServiceImpl) Get

func (s *RefundServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Refund, error)

Get Retrieves all details for a single refund

func (*RefundServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your refunds.

func (*RefundServiceImpl) Update

func (s *RefundServiceImpl) Update(ctx context.Context, identity string, p RefundUpdateParams, opts ...RequestOption) (*Refund, error)

Update Updates a refund object.

type RefundUpdateParams

type RefundUpdateParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

RefundUpdateParams parameters

type RequestOption

type RequestOption func(*requestOptions) error

RequestOption is used to configure a given request

func WithHeaders

func WithHeaders(headers map[string]string) RequestOption

WithHeaders sets headers to be sent for this request

func WithIdempotencyKey

func WithIdempotencyKey(key string) RequestOption

WithIdempotencyKey sets an idempotency key so multiple calls to a non-idempotent endpoint with the same key are actually idempotent

func WithRetries

func WithRetries(n int) RequestOption

WithRetries sets the amount of total retries to make for the request

func WithoutRetries

func WithoutRetries() RequestOption

WithoutRetries disables retries for this request

type ScenarioSimulator

type ScenarioSimulator struct {
	Id string `url:"id,omitempty" json:"id,omitempty"`
}

ScenarioSimulator model

type ScenarioSimulatorRunParams

type ScenarioSimulatorRunParams struct {
	Links *ScenarioSimulatorRunParamsLinks `url:"links,omitempty" json:"links,omitempty"`
}

ScenarioSimulatorRunParams parameters

type ScenarioSimulatorRunParamsLinks struct {
	Resource string `url:"resource,omitempty" json:"resource,omitempty"`
}

type ScenarioSimulatorService

type ScenarioSimulatorService interface {
	Run(ctx context.Context, identity string, p ScenarioSimulatorRunParams, opts ...RequestOption) (*ScenarioSimulator, error)
}

type ScenarioSimulatorServiceImpl

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

ScenarioSimulatorService manages scenario_simulators

func (*ScenarioSimulatorServiceImpl) Run

Run Runs the specific scenario simulator against the specific resource

type Service

type Service struct {
	BankAuthorisations      BankAuthorisationService
	BankDetailsLookups      BankDetailsLookupService
	BillingRequests         BillingRequestService
	BillingRequestFlows     BillingRequestFlowService
	BillingRequestTemplates BillingRequestTemplateService
	Blocks                  BlockService
	Creditors               CreditorService
	CreditorBankAccounts    CreditorBankAccountService
	CurrencyExchangeRates   CurrencyExchangeRateService
	Customers               CustomerService
	CustomerBankAccounts    CustomerBankAccountService
	CustomerNotifications   CustomerNotificationService
	Events                  EventService
	InstalmentSchedules     InstalmentScheduleService
	Institutions            InstitutionService
	Mandates                MandateService
	MandateImports          MandateImportService
	MandateImportEntries    MandateImportEntryService
	MandatePdfs             MandatePdfService
	PayerAuthorisations     PayerAuthorisationService
	Payments                PaymentService
	Payouts                 PayoutService
	PayoutItems             PayoutItemService
	RedirectFlows           RedirectFlowService
	Refunds                 RefundService
	ScenarioSimulators      ScenarioSimulatorService
	Subscriptions           SubscriptionService
	TaxRates                TaxRateService
	Webhooks                WebhookService
}

func New

func New(config Config) (*Service, error)

type Subscription

type Subscription struct {
	Amount                        int                            `url:"amount,omitempty" json:"amount,omitempty"`
	AppFee                        int                            `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Count                         int                            `url:"count,omitempty" json:"count,omitempty"`
	CreatedAt                     string                         `url:"created_at,omitempty" json:"created_at,omitempty"`
	Currency                      string                         `url:"currency,omitempty" json:"currency,omitempty"`
	DayOfMonth                    int                            `url:"day_of_month,omitempty" json:"day_of_month,omitempty"`
	EarliestChargeDateAfterResume string                         `url:"earliest_charge_date_after_resume,omitempty" json:"earliest_charge_date_after_resume,omitempty"`
	EndDate                       string                         `url:"end_date,omitempty" json:"end_date,omitempty"`
	Id                            string                         `url:"id,omitempty" json:"id,omitempty"`
	Interval                      int                            `url:"interval,omitempty" json:"interval,omitempty"`
	IntervalUnit                  string                         `url:"interval_unit,omitempty" json:"interval_unit,omitempty"`
	Links                         *SubscriptionLinks             `url:"links,omitempty" json:"links,omitempty"`
	Metadata                      map[string]interface{}         `url:"metadata,omitempty" json:"metadata,omitempty"`
	Month                         string                         `url:"month,omitempty" json:"month,omitempty"`
	Name                          string                         `url:"name,omitempty" json:"name,omitempty"`
	PaymentReference              string                         `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
	RetryIfPossible               bool                           `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
	StartDate                     string                         `url:"start_date,omitempty" json:"start_date,omitempty"`
	Status                        string                         `url:"status,omitempty" json:"status,omitempty"`
	UpcomingPayments              []SubscriptionUpcomingPayments `url:"upcoming_payments,omitempty" json:"upcoming_payments,omitempty"`
}

Subscription model

type SubscriptionCancelParams

type SubscriptionCancelParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

SubscriptionCancelParams parameters

type SubscriptionCreateParams

type SubscriptionCreateParams struct {
	Amount           int                           `url:"amount,omitempty" json:"amount,omitempty"`
	AppFee           int                           `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Count            int                           `url:"count,omitempty" json:"count,omitempty"`
	Currency         string                        `url:"currency,omitempty" json:"currency,omitempty"`
	DayOfMonth       int                           `url:"day_of_month,omitempty" json:"day_of_month,omitempty"`
	EndDate          string                        `url:"end_date,omitempty" json:"end_date,omitempty"`
	Interval         int                           `url:"interval,omitempty" json:"interval,omitempty"`
	IntervalUnit     string                        `url:"interval_unit,omitempty" json:"interval_unit,omitempty"`
	Links            SubscriptionCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
	Metadata         map[string]interface{}        `url:"metadata,omitempty" json:"metadata,omitempty"`
	Month            string                        `url:"month,omitempty" json:"month,omitempty"`
	Name             string                        `url:"name,omitempty" json:"name,omitempty"`
	PaymentReference string                        `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
	RetryIfPossible  bool                          `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
	StartDate        string                        `url:"start_date,omitempty" json:"start_date,omitempty"`
}

SubscriptionCreateParams parameters

type SubscriptionCreateParamsLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}
type SubscriptionLinks struct {
	Mandate string `url:"mandate,omitempty" json:"mandate,omitempty"`
}

type SubscriptionListPagingIterator

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

func (*SubscriptionListPagingIterator) Next

func (*SubscriptionListPagingIterator) Value

type SubscriptionListParams

type SubscriptionListParams struct {
	After     string                           `url:"after,omitempty" json:"after,omitempty"`
	Before    string                           `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt *SubscriptionListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	Customer  string                           `url:"customer,omitempty" json:"customer,omitempty"`
	Limit     int                              `url:"limit,omitempty" json:"limit,omitempty"`
	Mandate   string                           `url:"mandate,omitempty" json:"mandate,omitempty"`
	Status    []string                         `url:"status,omitempty" json:"status,omitempty"`
}

SubscriptionListParams parameters

type SubscriptionListParamsCreatedAt

type SubscriptionListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type SubscriptionListResult

type SubscriptionListResult struct {
	Subscriptions []Subscription             `json:"subscriptions"`
	Meta          SubscriptionListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type SubscriptionListResultMeta

type SubscriptionListResultMeta struct {
	Cursors *SubscriptionListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                                `url:"limit,omitempty" json:"limit,omitempty"`
}

type SubscriptionListResultMetaCursors

type SubscriptionListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type SubscriptionPauseParams

type SubscriptionPauseParams struct {
	Metadata    map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	PauseCycles int                    `url:"pause_cycles,omitempty" json:"pause_cycles,omitempty"`
}

SubscriptionPauseParams parameters

type SubscriptionResumeParams

type SubscriptionResumeParams struct {
	Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
}

SubscriptionResumeParams parameters

type SubscriptionServiceImpl

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

SubscriptionService manages subscriptions

func (*SubscriptionServiceImpl) All

func (*SubscriptionServiceImpl) Cancel

Cancel Immediately cancels a subscription; no more payments will be created under it. Any metadata supplied to this endpoint will be stored on the payment cancellation event it causes.

This will fail with a cancellation_failed error if the subscription is already cancelled or finished.

func (*SubscriptionServiceImpl) Create

Create Creates a new subscription object

func (*SubscriptionServiceImpl) Get

func (s *SubscriptionServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Subscription, error)

Get Retrieves the details of a single subscription.

func (*SubscriptionServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your subscriptions. Please note if the subscriptions are related to customers who have been removed, they will not be shown in the response.

func (*SubscriptionServiceImpl) Pause

Pause Pause a subscription object. No payments will be created until it is resumed.

This can only be used when a subscription is collecting a fixed number of payments (created using `count`), when they continue forever (created without `count` or `end_date`) or the subscription is already paused for a number of cycles.

When `pause_cycles` is omitted the subscription is paused until the [resume endpoint](#subscriptions-resume-a-subscription) is called. If the subscription is collecting a fixed number of payments, `end_date` will be set to `null`. When paused indefinitely, `upcoming_payments` will be empty.

When `pause_cycles` is provided the subscription will be paused for the number of cycles requested. If the subscription is collecting a fixed number of payments, `end_date` will be set to a new value. When paused for a number of cycles, `upcoming_payments` will still contain the upcoming charge dates.

This fails with:

- `forbidden` if the subscription was created by an app and you are not authenticated as that app, or if the subscription was not created by an app and you are authenticated as an app

- `validation_failed` if invalid data is provided when attempting to pause a subscription.

- `subscription_paused_cannot_update_cycles` if the subscription is already paused for a number of cycles and the request provides a value for `pause_cycle`.

- `subscription_cannot_be_paused` if the subscription cannot be paused.

- `subscription_already_ended` if the subscription has taken all payments.

- `pause_cycles_must_be_greater_than_or_equal_to` if the provided value for `pause_cycles` cannot be satisfied.

func (*SubscriptionServiceImpl) Resume

Resume Resume a subscription object. Payments will start to be created again based on the subscriptions recurrence rules. The `charge_date` on the next payment will be the same as the subscriptions `earliest_charge_date_after_resume`

This fails with:

- `forbidden` if the subscription was created by an app and you are not authenticated as that app, or if the subscription was not created by an app and you are authenticated as an app

- `validation_failed` if invalid data is provided when attempting to resume a subscription.

- `subscription_not_paused` if the subscription is not paused.

func (*SubscriptionServiceImpl) Update

Update Updates a subscription object.

This fails with:

- `validation_failed` if invalid data is provided when attempting to update a subscription.

- `subscription_not_active` if the subscription is no longer active.

- `subscription_already_ended` if the subscription has taken all payments.

- `mandate_payments_require_approval` if the amount is being changed and the mandate requires approval.

- `number_of_subscription_amendments_exceeded` error if the subscription amount has already been changed 10 times.

- `forbidden` if the amount is being changed, and the subscription was created by an app and you are not authenticated as that app, or if the subscription was not created by an app and you are authenticated as an app

- `resource_created_by_another_app` if the app fee is being changed, and the subscription was created by an app other than the app you are authenticated as

type SubscriptionUpcomingPayments

type SubscriptionUpcomingPayments struct {
	Amount     int    `url:"amount,omitempty" json:"amount,omitempty"`
	ChargeDate string `url:"charge_date,omitempty" json:"charge_date,omitempty"`
}

type SubscriptionUpdateParams

type SubscriptionUpdateParams struct {
	Amount           int                    `url:"amount,omitempty" json:"amount,omitempty"`
	AppFee           int                    `url:"app_fee,omitempty" json:"app_fee,omitempty"`
	Metadata         map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
	Name             string                 `url:"name,omitempty" json:"name,omitempty"`
	PaymentReference string                 `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
	RetryIfPossible  bool                   `url:"retry_if_possible,omitempty" json:"retry_if_possible,omitempty"`
}

SubscriptionUpdateParams parameters

type TaxRate

type TaxRate struct {
	EndDate      string `url:"end_date,omitempty" json:"end_date,omitempty"`
	Id           string `url:"id,omitempty" json:"id,omitempty"`
	Jurisdiction string `url:"jurisdiction,omitempty" json:"jurisdiction,omitempty"`
	Percentage   string `url:"percentage,omitempty" json:"percentage,omitempty"`
	StartDate    string `url:"start_date,omitempty" json:"start_date,omitempty"`
	Type         string `url:"type,omitempty" json:"type,omitempty"`
}

TaxRate model

type TaxRateListPagingIterator

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

func (*TaxRateListPagingIterator) Next

func (c *TaxRateListPagingIterator) Next() bool

func (*TaxRateListPagingIterator) Value

type TaxRateListParams

type TaxRateListParams struct {
	After        string `url:"after,omitempty" json:"after,omitempty"`
	Before       string `url:"before,omitempty" json:"before,omitempty"`
	Jurisdiction string `url:"jurisdiction,omitempty" json:"jurisdiction,omitempty"`
}

TaxRateListParams parameters

type TaxRateListResult

type TaxRateListResult struct {
	TaxRates []TaxRate             `json:"tax_rates"`
	Meta     TaxRateListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type TaxRateListResultMeta

type TaxRateListResultMeta struct {
	Cursors *TaxRateListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                           `url:"limit,omitempty" json:"limit,omitempty"`
}

type TaxRateListResultMetaCursors

type TaxRateListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type TaxRateService

type TaxRateService interface {
	List(ctx context.Context, p TaxRateListParams, opts ...RequestOption) (*TaxRateListResult, error)
	All(ctx context.Context, p TaxRateListParams, opts ...RequestOption) *TaxRateListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*TaxRate, error)
}

type TaxRateServiceImpl

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

TaxRateService manages tax_rates

func (*TaxRateServiceImpl) All

func (*TaxRateServiceImpl) Get

func (s *TaxRateServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*TaxRate, error)

Get Retrieves the details of a tax rate.

func (*TaxRateServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all tax rates.

type ValidationError

type ValidationError struct {
	Message        string     `json:"message"`
	Field          string     `json:"field"`
	RequestPointer string     `json:"request_pointer"`
	Links          ErrorLinks `json:"links"`
}

type Webhook

type Webhook struct {
	CreatedAt                       string                 `url:"created_at,omitempty" json:"created_at,omitempty"`
	Id                              string                 `url:"id,omitempty" json:"id,omitempty"`
	IsTest                          bool                   `url:"is_test,omitempty" json:"is_test,omitempty"`
	RequestBody                     string                 `url:"request_body,omitempty" json:"request_body,omitempty"`
	RequestHeaders                  map[string]interface{} `url:"request_headers,omitempty" json:"request_headers,omitempty"`
	ResponseBody                    string                 `url:"response_body,omitempty" json:"response_body,omitempty"`
	ResponseBodyTruncated           bool                   `url:"response_body_truncated,omitempty" json:"response_body_truncated,omitempty"`
	ResponseCode                    int                    `url:"response_code,omitempty" json:"response_code,omitempty"`
	ResponseHeaders                 map[string]interface{} `url:"response_headers,omitempty" json:"response_headers,omitempty"`
	ResponseHeadersContentTruncated bool                   `url:"response_headers_content_truncated,omitempty" json:"response_headers_content_truncated,omitempty"`
	ResponseHeadersCountTruncated   bool                   `url:"response_headers_count_truncated,omitempty" json:"response_headers_count_truncated,omitempty"`
	Successful                      bool                   `url:"successful,omitempty" json:"successful,omitempty"`
	Url                             string                 `url:"url,omitempty" json:"url,omitempty"`
}

Webhook model

type WebhookHandler

type WebhookHandler struct {
	EventHandler
	// contains filtered or unexported fields
}

WebhookHandler allows you to process incoming events from webhooks.

func NewWebhookHandler

func NewWebhookHandler(secret string, h EventHandler) (*WebhookHandler, error)

NewWebhookHandler instantiates a WebhookHandler which can be mounted as a net/http Handler.

func (*WebhookHandler) ServeHTTP

func (h *WebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP processes incoming webhooks and dispatches events to the corresponsing handlers.

type WebhookListPagingIterator

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

func (*WebhookListPagingIterator) Next

func (c *WebhookListPagingIterator) Next() bool

func (*WebhookListPagingIterator) Value

type WebhookListParams

type WebhookListParams struct {
	After      string                      `url:"after,omitempty" json:"after,omitempty"`
	Before     string                      `url:"before,omitempty" json:"before,omitempty"`
	CreatedAt  *WebhookListParamsCreatedAt `url:"created_at,omitempty" json:"created_at,omitempty"`
	IsTest     bool                        `url:"is_test,omitempty" json:"is_test,omitempty"`
	Limit      int                         `url:"limit,omitempty" json:"limit,omitempty"`
	Successful bool                        `url:"successful,omitempty" json:"successful,omitempty"`
}

WebhookListParams parameters

type WebhookListParamsCreatedAt

type WebhookListParamsCreatedAt struct {
	Gt  string `url:"gt,omitempty" json:"gt,omitempty"`
	Gte string `url:"gte,omitempty" json:"gte,omitempty"`
	Lt  string `url:"lt,omitempty" json:"lt,omitempty"`
	Lte string `url:"lte,omitempty" json:"lte,omitempty"`
}

type WebhookListResult

type WebhookListResult struct {
	Webhooks []Webhook             `json:"webhooks"`
	Meta     WebhookListResultMeta `url:"meta,omitempty" json:"meta,omitempty"`
}

type WebhookListResultMeta

type WebhookListResultMeta struct {
	Cursors *WebhookListResultMetaCursors `url:"cursors,omitempty" json:"cursors,omitempty"`
	Limit   int                           `url:"limit,omitempty" json:"limit,omitempty"`
}

type WebhookListResultMetaCursors

type WebhookListResultMetaCursors struct {
	After  string `url:"after,omitempty" json:"after,omitempty"`
	Before string `url:"before,omitempty" json:"before,omitempty"`
}

type WebhookService

type WebhookService interface {
	List(ctx context.Context, p WebhookListParams, opts ...RequestOption) (*WebhookListResult, error)
	All(ctx context.Context, p WebhookListParams, opts ...RequestOption) *WebhookListPagingIterator
	Get(ctx context.Context, identity string, opts ...RequestOption) (*Webhook, error)
	Retry(ctx context.Context, identity string, opts ...RequestOption) (*Webhook, error)
}

type WebhookServiceImpl

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

WebhookService manages webhooks

func (*WebhookServiceImpl) All

func (*WebhookServiceImpl) Get

func (s *WebhookServiceImpl) Get(ctx context.Context, identity string, opts ...RequestOption) (*Webhook, error)

Get Retrieves the details of an existing webhook.

func (*WebhookServiceImpl) List

List Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your webhooks.

func (*WebhookServiceImpl) Retry

func (s *WebhookServiceImpl) Retry(ctx context.Context, identity string, opts ...RequestOption) (*Webhook, error)

Retry Requests for a previous webhook to be sent again

Jump to

Keyboard shortcuts

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