stripe

package
v0.0.0-...-8bff5d1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachMethod

func AttachMethod(customerID, methodID string) (*stripe.PaymentMethod, error)

AttachMethod attaches a PaymentMethod object to a Customer.

func CancelIntent

func CancelIntent(intentID string) error

CancelIntent cancels the purchase.

func CancelPayout

func CancelPayout(payoutID string) (*stripe.Payout, error)

CancelPayout cancels a payout. Funds will be refunded to the available balance.

func CaptureIntent

func CaptureIntent(intentID string) error

CaptureIntent captures the funds of an existing uncaptured PaymentIntent

when its status is requires_capture.

func ConfirmIntent

func ConfirmIntent(intentID string, source *stripe.Source) error

ConfirmIntent confirms that your customer intends to pay with current or provided payment method.

func CreateIntent

func CreateIntent(id, cartID, currency string, total int64, card Card) (*stripe.PaymentIntent, error)

CreateIntent creates a payment intent object.

func CreateMethod

func CreateMethod(card Card) (string, error)

CreateMethod creates a new payment method.

func CreatePayout

func CreatePayout(amount int) (*stripe.Payout, error)

CreatePayout sends funds to the bank account.

func CreateRefund

func CreateRefund(intentID string) (*stripe.Refund, error)

CreateRefund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.

func DetachMethod

func DetachMethod(methodID string) (*stripe.PaymentMethod, error)

DetachMethod detaches a PaymentMethod object from a Customer.

func GetBalance

func GetBalance() (*stripe.Balance, error)

GetBalance retrieves the current account balance, based on the authentication that was used to make the request.

func GetEvent

func GetEvent(eventID string) (*stripe.Event, error)

GetEvent retrieves the details of an event.

func GetPayout

func GetPayout(payoutID string) (*stripe.Payout, error)

GetPayout retrieves the details of an existing payout.

func GetRefund

func GetRefund(refundID string) (*stripe.Refund, error)

GetRefund retrieves the details of an existing refund.

func GetTxBalance

func GetTxBalance(txID string) (*stripe.BalanceTransaction, error)

GetTxBalance retrieves the balance transaction with the given ID.

func ListEvents

func ListEvents() []*stripe.Event

ListEvents returns a list of events going back up to 30 days.

func ListIntents

func ListIntents() []*stripe.PaymentIntent

ListIntents returns a list of PaymentIntents.

func ListMethods

func ListMethods(customerID string) []*stripe.PaymentMethod

ListMethods returns a list of PaymentMethods for a given Customer.

func ListPayouts

func ListPayouts() []*stripe.Payout

ListPayouts returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you.

func ListRefunds

func ListRefunds() []*stripe.Refund

ListRefunds returns a list of all refunds you’ve previously created.

func ListTxs

func ListTxs() []*stripe.BalanceTransaction

ListTxs returns a list of transactions that have contributed to the Stripe account balance.

func RetrieveIntent

func RetrieveIntent(intentID string) (*stripe.PaymentIntent, error)

RetrieveIntent lists the details of a PaymentIntent that has previously been created.

func RetrieveMethod

func RetrieveMethod(methodID string) (*stripe.PaymentMethod, error)

RetrieveMethod retrieves a PaymentMethod object.

func UpdateIntent

func UpdateIntent(intentID string, total int64) (*stripe.PaymentIntent, error)

UpdateIntent sets new properties on a PaymentIntent object without confirming.

func UpdateMethod

func UpdateMethod(methodID string) (*stripe.PaymentMethod, error)

UpdateMethod updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.

func UpdatePayout

func UpdatePayout(payoutID string) (*stripe.Payout, error)

UpdatePayout updates the specified payout by setting the values of the parameters passed.

func UpdateRefund

func UpdateRefund(refundID string) (*stripe.Refund, error)

UpdateRefund updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Types

type Card

type Card struct {
	Number   string `json:"number"`
	ExpMonth string `json:"exp_month"`
	ExpYear  string `json:"exp_year" validate:"len=4"`
	CVC      string `json:"cvc" validate:"len=3"`
}

Card symbolizes a user card.

type Handler

type Handler struct{}

Handler manages stripe endpoints.

func NewHandler

func NewHandler() Handler

NewHandler returns a new stripe handler.

func (*Handler) GetBalance

func (h *Handler) GetBalance() http.HandlerFunc

GetBalance responds with the account balance.

func (*Handler) GetEvent

func (h *Handler) GetEvent() http.HandlerFunc

GetEvent looks for the details of the events.

func (*Handler) GetTxBalance

func (h *Handler) GetTxBalance() http.HandlerFunc

GetTxBalance responds with the transaction balance.

func (*Handler) ListEvents

func (h *Handler) ListEvents() http.HandlerFunc

ListEvents retrieves a list of all the stripe events within the last 30 days.

func (*Handler) ListTxs

func (h *Handler) ListTxs() http.HandlerFunc

ListTxs responds with a list of stripe transactions.

Jump to

Keyboard shortcuts

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