charge

package
v81.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package charge provides the /charges APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(id string, params *stripe.ChargeCaptureParams) (*stripe.Charge, error)

Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.

Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.

Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture).

func Get

func Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error)

Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.

func New

func New(params *stripe.ChargeParams) (*stripe.Charge, error)

This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment.

func Update

func Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error)

Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Types

type Client

type Client struct {
	B   stripe.Backend
	Key string
}

Client is used to invoke /charges APIs.

func (Client) Capture

func (c Client) Capture(id string, params *stripe.ChargeCaptureParams) (*stripe.Charge, error)

Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.

Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.

Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture).

func (Client) Get

func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error)

Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.

func (Client) List

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

Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first.

func (Client) New

func (c Client) New(params *stripe.ChargeParams) (*stripe.Charge, error)

This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment.

func (Client) Search

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

Search for charges 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.ChargeParams) (*stripe.Charge, error)

Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

type Iter

type Iter struct {
	*stripe.Iter
}

Iter is an iterator for charges.

func List

func List(params *stripe.ChargeListParams) *Iter

Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first.

func (*Iter) Charge

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

Charge returns the charge which the iterator is currently pointing to.

func (*Iter) ChargeList

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

ChargeList 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 charges.

func Search(params *stripe.ChargeSearchParams) *SearchIter

Search for charges 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) Charge

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

Charge returns the charge which the iterator is currently pointing to.

func (*SearchIter) ChargeSearchResult

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

ChargeSearchResult 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