Documentation ¶
Index ¶
- type StripeClient
- func (client *StripeClient) Authorize(request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)
- func (client *StripeClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)
- func (client *StripeClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)
- func (client *StripeClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)
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
Click to show internal directories.
Click to hide internal directories.