stripe

package
v0.0.0-...-2c24670 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(key string) error

Setup init stripe setup

Types

type ChargeData

type ChargeData struct {
	SourceID    *string
	Amount      float64
	Description string
	Currency    string
}

ChargeData charge data structure

type Client

type Client struct {
	Parent Parent
}

Client stripe client data structure

func NewClient

func NewClient(parent Parent) (*Client, error)

NewClient init new client

func (*Client) Charge

func (i *Client) Charge(data *ChargeData) (*stripe.Charge, error)

Charge charge provided source with charge params

func (*Client) CreateCreditCard

func (i *Client) CreateCreditCard(token *string, ps PaymentSource) error

CreateCreditCard create credit card payment source

func (*Client) CreatePaymentSource

func (i *Client) CreatePaymentSource(paymentType string, token string, ps PaymentSource) error

CreatePaymentSource create payment source

func (*Client) EnsureCustomer

func (i *Client) EnsureCustomer() error

EnsureCustomer find or create a customer record

func (*Client) FetchCustomer

func (i *Client) FetchCustomer() (*stripe.Customer, error)

FetchCustomer find customer record

type Customer

type Customer struct {
	StripeCustomerID *string
}

Customer ...

func (Customer) GetStripeCustomerID

func (c Customer) GetStripeCustomerID() *string

GetStripeCustomerID ...

type Parent

type Parent interface {
	StripeCustomerDescription() *string
	GetStripeCustomerID() *string
	SetStripeCustomerID(*string) error
}

Parent parent model interface

type PaymentSource

type PaymentSource interface {
	SetSource(string, interface{}) error
}

PaymentSource payment source model interface

type Source

type Source struct {
	StripeSourceID *string
}

Source ...

func (*Source) SetSource

func (i *Source) SetSource(sourceID string, source interface{}) error

SetSource ...

Jump to

Keyboard shortcuts

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