customer

package
v80.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package customer provides the /customers APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFundingInstructions

func CreateFundingInstructions(id string, params *stripe.CustomerCreateFundingInstructionsParams) (*stripe.FundingInstructions, error)

Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time.

func Del

func Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error)

Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.

func DeleteDiscount

func DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountParams) (*stripe.Customer, error)

Removes the currently applied discount on a customer.

func Get

func Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error)

Retrieves a Customer object.

func New

func New(params *stripe.CustomerParams) (*stripe.Customer, error)

Creates a new customer object.

func RetrievePaymentMethod

func RetrievePaymentMethod(id string, params *stripe.CustomerRetrievePaymentMethodParams) (*stripe.PaymentMethod, error)

Retrieves a PaymentMethod object for a given Customer.

func Update

func Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error)

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

This request accepts mostly the same arguments as the customer creation call.

Types

type Client

type Client struct {
	B   stripe.Backend
	Key string
}

Client is used to invoke /customers APIs.

func (Client) CreateFundingInstructions

func (c Client) CreateFundingInstructions(id string, params *stripe.CustomerCreateFundingInstructionsParams) (*stripe.FundingInstructions, error)

Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time.

func (Client) Del

func (c Client) Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error)

Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.

func (Client) DeleteDiscount

func (c Client) DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountParams) (*stripe.Customer, error)

Removes the currently applied discount on a customer.

func (Client) Get

func (c Client) Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error)

Retrieves a Customer object.

func (Client) List

func (c Client) List(listParams *stripe.CustomerListParams) *Iter

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

func (Client) ListPaymentMethods

func (c Client) ListPaymentMethods(listParams *stripe.CustomerListPaymentMethodsParams) *PaymentMethodIter

Returns a list of PaymentMethods for a given Customer

func (Client) New

func (c Client) New(params *stripe.CustomerParams) (*stripe.Customer, error)

Creates a new customer object.

func (Client) RetrievePaymentMethod

func (c Client) RetrievePaymentMethod(id string, params *stripe.CustomerRetrievePaymentMethodParams) (*stripe.PaymentMethod, error)

Retrieves a PaymentMethod object for a given Customer.

func (Client) Search

func (c Client) Search(params *stripe.CustomerSearchParams) *SearchIter

Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

func (Client) Update

func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error)

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

This request accepts mostly the same arguments as the customer creation call.

type Iter

type Iter struct {
	*stripe.Iter
}

Iter is an iterator for customers.

func List

func List(params *stripe.CustomerListParams) *Iter

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

func (*Iter) Customer

func (i *Iter) Customer() *stripe.Customer

Customer returns the customer which the iterator is currently pointing to.

func (*Iter) CustomerList

func (i *Iter) CustomerList() *stripe.CustomerList

CustomerList returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.

type PaymentMethodIter

type PaymentMethodIter struct {
	*stripe.Iter
}

PaymentMethodIter is an iterator for payment methods.

func ListPaymentMethods

func ListPaymentMethods(params *stripe.CustomerListPaymentMethodsParams) *PaymentMethodIter

Returns a list of PaymentMethods for a given Customer

func (*PaymentMethodIter) PaymentMethod

func (i *PaymentMethodIter) PaymentMethod() *stripe.PaymentMethod

PaymentMethod returns the payment method which the iterator is currently pointing to.

func (*PaymentMethodIter) PaymentMethodList

func (i *PaymentMethodIter) PaymentMethodList() *stripe.PaymentMethodList

PaymentMethodList returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.

type SearchIter

type SearchIter struct {
	*stripe.SearchIter
}

SearchIter is an iterator for customers.

func Search(params *stripe.CustomerSearchParams) *SearchIter

Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

func (*SearchIter) Customer

func (i *SearchIter) Customer() *stripe.Customer

Customer returns the customer which the iterator is currently pointing to.

func (*SearchIter) CustomerSearchResult

func (i *SearchIter) CustomerSearchResult() *stripe.CustomerSearchResult

CustomerSearchResult returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.

Jump to

Keyboard shortcuts

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