sfpy

package
v0.0.0-...-9528e98 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FETCH_API_KEY  = "/v1/apikey/fetch"
	UPDATE_API_KEY = "/v1/apikey/update"

	ADD_MERCHANT    = "/v1/merchant/add"
	UPDATE_MERCHANT = "/v1/merchant/update"
	FETCH_MERCHANT  = "/v1/merchant/fetch"

	FETCH_EVENTS = "/v1/notify/events"

	ENABLE_WEBHOOKS = "/v1/notify/merchant"
	EXISTS_WEBHOOKS = "/v1/notify/exists"

	FETCH_SECRET  = "/v1/notify/secret"
	ROTATE_SECRET = "/v1/notify/secret"

	ADD_ENDPOINT    = "/v1/notify/subscription"
	UPDATE_ENDPOINT = "/v1/notify/subscription"
	FETCH_ENDPOINTS = "/v1/notify/subscription"
	DELETE_ENDPOINT = "/v1/notify/subscription"

	SUBSCRIBE = "/v1/notify/subscribe"

	FETCH_NOTIFICATIONS = "/v1/notify/notification"

	TEST_NOTIFICATION = "/v1/notify/test"

	ADD_ORDER_LINK = "/v1/order/link"
	ADD_ORDER      = "/v1/order/"
	FETCH_ORDERS   = "/v1/order/"

	FETCH_PAYMENTS = "/v1/payment"
	FETCH_REFUNDS  = "/v1/refund"

	ADD_EMAIL_PASSWORD = "/v1/security/set"
)
View Source
const API_BASE_URL = "https://api.sfpy.co"
View Source
const APP_BASE_URL = "https://app.sfpy.co"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoints SFPY
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apikey, sharedsecret string) *Client
func (c *Client) ConstructLink(orderId string) string

func (*Client) ValidateSignature

func (c *Client) ValidateSignature(signature string, data interface{}) error

type SFPY

type SFPY interface {
	FetchApiKey(ctx context.Context, request interface{}) (*responses.Response, error)
	UpdateApiKey(ctx context.Context, request interface{}) (*responses.Response, error)
	AddMerchant(ctx context.Context, request interface{}) (*responses.Response, error)
	UpdateMerchant(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchMerchant(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchEvents(ctx context.Context, request interface{}) (*responses.Response, error)
	WebhooksExist(ctx context.Context, request interface{}) (*responses.Response, error)
	EnableWebhooks(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchSecret(ctx context.Context, request interface{}) (*responses.Response, error)
	UpdateSecret(ctx context.Context, request interface{}) (*responses.Response, error)
	DeleteEndpoint(ctx context.Context, request interface{}) (*responses.Response, error)
	UpdateEndpoint(ctx context.Context, request interface{}) (*responses.Response, error)
	AddEndpoint(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchEndpoints(ctx context.Context, request interface{}) (*responses.Response, error)
	Subscribe(ctx context.Context, request interface{}) (*responses.Response, error)
	TestNotification(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchNotifications(ctx context.Context, request interface{}) (*responses.Response, error)
	AddOrderLink(ctx context.Context, request interface{}) (*responses.Response, error)
	AddOrder(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchOrders(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchPayments(ctx context.Context, request interface{}) (*responses.Response, error)
	FetchRefunds(ctx context.Context, request interface{}) (*responses.Response, error)
	AddEmailPassword(ctx context.Context, request interface{}) (*responses.Response, error)
}

Jump to

Keyboard shortcuts

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