subscription

package
v0.0.1-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_INIT = "init"

	LOG_PARAM_INVOICE_ID      = "INVOICE_ID"
	LOG_PARAM_SUBSCRIPTION_ID = "SUBSCRIPTION_ID"
	LOG_PARAM_CUSTOMER_ID     = "CUSTOMER_ID"
	LOG_PARAM_PLAN_ID         = "PLAN_ID"
	LOG_PARAM_STRIPE_RESPONSE = "STRIPE_RESPONSE"
	LOG_PARAM_STRIPE_PLAN_ID  = "STRIPE_PLAN_ID"
	LOG_PARAM_HASURA_RESPONSE = "HASURA_RESPONSE"
	LOG_PARAM_ACCOUNT_NAME    = "ACCOUNT_NAME"
	LOG_PARAM_ACCOUNT_ID      = "ACCOUNT_ID"
	LOG_PARAM_USER_ID         = "USER_ID"
	LOG_PARAM_RESULT_LENGTH   = "RESULT_LENGTH"
)

Variables

This section is empty.

Functions

func ConfigApiKey

func ConfigApiKey() string

func ConfigDomain

func ConfigDomain() string

func ConfigWebhookListenAddress

func ConfigWebhookListenAddress() string

func ConfigWebhookSecret

func ConfigWebhookSecret() string

func EventMapping

func EventMapping(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service)

func NewCancelHandler

func NewCancelHandler(graphqlSvc gqlreq.Service, sdkSvc gqlsdk.Service) http.Handler

func NewChangeHandler

func NewChangeHandler(graphqlSvc gqlreq.Service, sdkSvc gqlsdk.Service) http.Handler

func NewCreateHandler

func NewCreateHandler(graphqlSvc gqlreq.Service, sdkSvc gqlsdk.Service) http.Handler

func NewInitHandler

func NewInitHandler(graphqlSvc gqlreq.Service, sdkSvc gqlsdk.Service) http.Handler

func NewRetryHandler

func NewRetryHandler(graphqlSvc gqlreq.Service, sdkSvc gqlsdk.Service) http.Handler

func NewWebhookHandler

func NewWebhookHandler(sdkSvc gqlsdk.Service) http.Handler

func ProcessChargeSucceeded

func ProcessChargeSucceeded(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessCustomerCreated

func ProcessCustomerCreated(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessCustomerSubscriptionCreated

func ProcessCustomerSubscriptionCreated(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessCustomerSubscriptionDeleted

func ProcessCustomerSubscriptionDeleted(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessCustomerUpdated

func ProcessCustomerUpdated(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessInvoiceCreated

func ProcessInvoiceCreated(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessInvoiceFinalized

func ProcessInvoiceFinalized(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessInvoicePaid

func ProcessInvoicePaid(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessInvoicePaymentActionRequired

func ProcessInvoicePaymentActionRequired(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessInvoicePaymentFailed

func ProcessInvoicePaymentFailed(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessInvoicePaymentSucceeded

func ProcessInvoicePaymentSucceeded(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessPaymentIntentCreated

func ProcessPaymentIntentCreated(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessPaymentIntentRequiresAction

func ProcessPaymentIntentRequiresAction(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessPaymentIntentSucceeded

func ProcessPaymentIntentSucceeded(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

func ProcessPaymentMethodAttached

func ProcessPaymentMethodAttached(c context.Context, event stripe.Event, id string, sdkSvc gqlsdk.Service) error

Types

type ActionChangePayload

type ActionChangePayload struct {
	hasura.BasePayload
	Input struct {
		Data *gqlsdk.ChangeSubscriptionInput `json:"data"`
	} `json:"input"`
}

type ActionCreatePayload

type ActionCreatePayload struct {
	hasura.BasePayload
	Input struct {
		Data *gqlsdk.CreateSubscriptionInput `json:"data"`
	} `json:"input"`
}

type ActionPayloadCancel

type ActionPayloadCancel struct {
	hasura.BasePayload
}

type ActionPayloadInit

type ActionPayloadInit struct {
	hasura.BasePayload
	Input struct {
		Data *gqlsdk.InitSubscriptionInput `json:"data"`
	} `json:"input"`
}

type ActionPayloadRetry

type ActionPayloadRetry struct {
	hasura.BasePayload
	Input struct {
		Data *gqlsdk.RetrySubscriptionInput `json:"data"`
	} `json:"input"`
}

type CancelHandler

type CancelHandler struct {
	GraphqlSvc gqlreq.Service
	SdkSvc     gqlsdk.Service
}

func (*CancelHandler) ServeHTTP

func (h *CancelHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ChangeHandler

type ChangeHandler struct {
	GraphqlSvc gqlreq.Service
	SdkSvc     gqlsdk.Service
}

func (*ChangeHandler) ServeHTTP

func (h *ChangeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Handle subscription change

type CreateHandler

type CreateHandler struct {
	GraphqlSvc gqlreq.Service
	SdkSvc     gqlsdk.Service
}

func (*CreateHandler) ServeHTTP

func (h *CreateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Handle subscription creation

type Plan

type Plan struct {
	ID hstype.String
}

type RequestCancel

type RequestCancel struct {
	SubscriptionID string `json:"subscriptionId"`
}

type RequestCreate

type RequestCreate struct {
	PaymentMethodID string `json:"paymentMethodId"`
	CustomerID      string `json:"customerId"`
	PriceID         string `json:"priceId"`
	AccountName     string `json:"accountName"`
}

type RequestRetry

type RequestRetry struct {
	CustomerID      string `json:"customerId"`
	PaymentMethodID string `json:"paymentMethodId"`
	InvoiceID       string `json:"invoiceId"`
	AccountID       string `json:"accountId"`
}

type RetryHandler

type RetryHandler struct {
	GraphqlSvc gqlreq.Service
	SdkSvc     gqlsdk.Service
}

func (*RetryHandler) ServeHTTP

func (h *RetryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WebhookHandler

type WebhookHandler struct {
	SdkSvc gqlsdk.Service
}

func (*WebhookHandler) ServeHTTP

func (h *WebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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