payment

package
v0.0.0-...-a11cca7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlePayment

func HandlePayment(w http.ResponseWriter, r *http.Request) error

HandlePayment enables the subscription features after payment

func HandlePaymentShow

func HandlePaymentShow(w http.ResponseWriter, r *http.Request) error

HandlePaymentShow shows the subscriptions page by responding to the GET request

Types

type Address

type Address struct {
	City       string `json:"city"`
	Country    string `json:"country"`
	Line1      string `json:"line1"`
	Line2      string `json:"line2"`
	PostalCode string `json:"postal_code"`
	State      string `json:"state"`
}

type BillingDetails

type BillingDetails struct {
	Address Address `json:"address"`
	Email   string  `json:"email"`
	Name    string  `json:"name"`
}

type CustomerDetails

type CustomerDetails struct {
	Email string `json:"email"`
}

type Data

type Data struct {
	Object Object `json:"object"`
}

type Email

type Email struct {
	Email *mail.Address
}

type Event

type Event struct {
	ID           string `json:"id"`
	Data         Data   `json:"data"`
	Created      Time   `json:"created"`
	Subscription string `json:"subscription"`
}

Stripe event object

type EventSubscriptionModel

type EventSubscriptionModel struct {
	MerchantID string    `json:"merchant_id"`
	Type       string    `json:"type"`
	EventID    string    `json:"event_id"`
	CreatedAt  time.Time `json:"created_at"`
	Data       struct {
		Type   string `json:"type"`
		ID     string `json:"id"`
		Object struct {
			Subscription struct {
				ID            string `json:"id"`
				CreatedDate   string `json:"created_date"`
				CustomerID    string `json:"customer_id"`
				LocationID    string `json:"location_id"`
				PlanID        string `json:"plan_id"`
				StartDate     string `json:"start_date"`
				Status        string `json:"status"`
				TaxPercentage string `json:"tax_percentage"`
				Timezone      string `json:"timezone"`
				Version       int64  `json:"version"`
			} `json:"subscription"`
		} `json:"object"`
	} `json:"data"`
}

type MetaData

type MetaData struct {
	UserID    string `json:"user_id"`
	UserName  string `json:"user_name"`
	Plan      string `json:"plan"`
	ProductID string `json:"product_id"`
}

type Object

type Object struct {
	ID              string          `json:"id"`
	AmountSubTotal  float64         `json:"amount_subtotal"`
	AmountTotal     float64         `json:"amount_total"`
	Currency        string          `json:"currency"`
	Customer        string          `json:"customer"`
	CustomerDetails CustomerDetails `json:"customer_details"`
	CustomerEmail   string          `json:"customer_email"`
	Subscription    string          `json:"subscription"`
	MetaData        MetaData        `json:"metadata"`
	Mode            string          `json:"mode"`
	PaymentStatus   string          `json:"payment_status"`
	TotalDetails    TotalDetails    `json:"total_details"`
	PaymentIntent   string          `json:"payment_intent"`
	BillingDetails  BillingDetails  `json:"billing_details"`
}

type Time

type Time struct {
	Time *time.Time
}

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

returns time.Now() no matter what!

type TotalDetails

type TotalDetails struct {
	AmountDiscount float64 `json:"amount_discount"`
	AmountTax      float64 `json:"amount_tax"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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