stripe

package
v1.1.670 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StripeClient

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

StripeClient uses API-Key and custom http client to make http calls

func NewClient

func NewClient(apiKey string) *StripeClient

NewClient uses default http client with provided Stripe API Key Note: the environment is kind of explicitly given to us by the apiKey

func NewWithHTTPClient

func NewWithHTTPClient(apiKey string, httpClient *http.Client) *StripeClient

NewWithHTTPClient uses a custom http client for requests

func (*StripeClient) Authorize

func (client *StripeClient) Authorize(request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)

Authorize a transaction for specified amount using stripe-go library

func (*StripeClient) Capture

func (client *StripeClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)

Capture an authorized transaction by charge ID

func (*StripeClient) Refund

func (client *StripeClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)

Refund a captured transaction with amount and charge ID

func (*StripeClient) Void

func (client *StripeClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)

Void an authorized transaction with charge ID

Jump to

Keyboard shortcuts

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