cards

package
v0.0.0-...-5d6c776 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Secret   string
	Key      string
	Currency string
}

Card holds the information needed by this package

func (*Card) CancelSubscription

func (c *Card) CancelSubscription(subID string) error

CancelSubscription cancels a subscription, by subscription id

func (*Card) Charge

func (c *Card) Charge(currency string, amount int) (*stripe.PaymentIntent, string, error)

Charge is an alias to CreatePaymentIntent

func (*Card) CreateCustomer

func (c *Card) CreateCustomer(pm, email string) (*stripe.Customer, string, error)

CreateCustomer creates a stripe customer

func (*Card) CreatePaymentIntent

func (c *Card) CreatePaymentIntent(currency string, amount int) (*stripe.PaymentIntent, string, error)

CreatePaymentIntent attempts to get a payment intent object from Stripe

func (*Card) GetPaymentMethod

func (c *Card) GetPaymentMethod(s string) (*stripe.PaymentMethod, error)

GetPaymentMethod gets the payment method by payment intend id

func (*Card) Refund

func (c *Card) Refund(pi string, amount int) error

Refund refunds an amount for a paymentIntent

func (*Card) RetrievePaymentIntent

func (c *Card) RetrievePaymentIntent(id string) (*stripe.PaymentIntent, error)

RetrievePaymentIntent gets an existing payment intent by id

func (*Card) SubscribeToPlan

func (c *Card) SubscribeToPlan(cust *stripe.Customer, plan, email, last4, cardType string) (*stripe.Subscription, error)

SubscribeToPlan subscribes a stripe customer to a stripe plan

type Transaction

type Transaction struct {
	TransactionStatusID int
	Amount              int
	Currency            string
	LastFour            string
	BankReturnCode      string
}

Transaction is the type to store information for a given transaction

Jump to

Keyboard shortcuts

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