requests

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: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SORT_COLUMN_DATE = "created_at"
	SORT_COLUMN_NAME = "name"

	SORT_ORDER_DESC = "desc"
	SORT_ORDER_ASC  = "asc"

	FETCH_TYPE_REQUEST      = "REQUEST"
	FETCH_TYPE_PAYMENT      = "PAYMENT"
	FETCH_TYPE_REFUND       = "REFUND"
	FETCH_TYPE_SUBSCRIPTION = "SUBSCRIPTION"
	FETCH_TYPE_NOTIFICATION = "NOTIFICATION"

	NOTIFICATION_TYPE_PAYMENT = "payment:created"
	NOTIFICATION_TYPE_REFUND  = "refund:created"
)
View Source
const (
	// MERCHANTSERVICE ...
	MERCHANTSERVICE string = "merchant_service"

	// ORDERSERVICE ...
	ORDERSERVICE string = "order_service"

	// FETCHSERVICE ...
	FETCHSERVICE string = "fetch_service"

	// PAYMENTSERVICE ...
	PAYMENTSERVICE string = "payment_service"

	// REFUNDSERVICE ...
	REFUNDSERVICE string = "refund_service"

	// SECURITYSERVICE ...
	SECURITYSERVICE string = "security_service"

	// PASSWORDSERVICE ...
	PASSWORDSERVICE string = "password_service"

	// MERCHANTSERVICE ...
	NOTIFY_MERCHANTSERVICE string = "merchant_service"

	// SUBSCRIPTIONSERVICE ...
	NOTIFY_SUBSCRIPTIONSERVICE string = "subscription_service"

	// NOTIFICATIONSERVICE ...
	NOTIFY_NOTIFICATIONSERVICE string = "notification_service"

	// FETCHSERVICE ...
	NOTIFY_FETCHSERVICE string = "fetch_service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cart

type Cart struct {
	// Indicates the e-commerce platform or
	// personal website from where the customer
	// and order originates from. For example
	// Shopify, Wordpress, Magento, Custom.
	//
	// The value provided is trimmed and lowered
	Source string `json:"source,omitempty"`

	// This is the external order id or cart id to
	// be associated with this payment. Is useful
	// to reconcile payments with an external source
	// or CMS
	OrderReference string `json:"order_reference,omitempty"`

	// This is the URL to redirect the customer to after
	// they have completed the payment. This can be a
	// success page, order confirmation page or thank you
	// page.
	CompleteURL string `json:"complete_url,omitempty"`

	// This is the URL to redirect the customer to after
	// they cancel the payment or leave it abandoned. This
	// is usually the cart url so they can go back to your
	// site and complete the payment using a different
	// payment method
	CancelURL string `json:"cancel_url,omitempty"`
}

type Fetch

type Fetch struct {
	Token     string `form:"token"`
	Request   string `form:"request"`
	Payment   string `form:"payment"`
	Kind      string `form:"kind"`
	Chain     uint   `form:"chain"`
	SortBy    string `form:"sort_by"`
	SortOrder string `form:"sort_order"`
	Limit     int    `form:"limit"`
	Offset    int    `form:"offset"`
}

type FetchService

type FetchService struct {
	Fetch *Fetch `json:"-"`
}

MerchantService definition

type Merchant

type Merchant struct {
	RegisteredName   string `json:"registered_name"`
	WebsiteURL       string `json:"website_url,omitempty"`
	TwitterURL       string `json:"twitter_url,omitempty"`
	InstagramURL     string `json:"instagram_url,omitempty"`
	ProfileImgURL    string `json:"profile_img_url,omitempty"`
	BackgroundImgURL string `json:"background_img_url,omitempty"`
}

Merchant in the Sfpy ecosystem

type MerchantService

type MerchantService struct {
	Merchant *Merchant `json:"merchant"`
}

MerchantService definition

type MerchantSlice

type MerchantSlice []*Merchant

MerchantSlice is a convenient collection

type Notification

type Notification struct {
	Kind         string `json:"kind"`
	Subscription string `json:"subscription"`
}

type NotificationService

type NotificationService struct {
	Notification *Notification `json:"notification"`
}

NotificationService definition

type Order

type Order struct {
	Token          string         `json:"-" form:"request"`
	Address        string         `json:"address"`
	Reference      string         `json:"reference"`
	ChainID        uint           `json:"chain_id"`
	Cart           *Cart          `json:"cart"`
	PurchaseTotals *PurchaseTotal `json:"purchase_total"`
}

type OrderService

type OrderService struct {
	Order *Order `json:"order"`
}

OrderService definition

type Payment

type Payment struct {
	Request      string `json:"request"`
	ChainId      uint   `json:"chain_id"`
	IsETH        *bool  `json:"is_eth"`
	TxnHash      string `json:"txn_hash"`
	From         string `json:"from"`
	Amount       string `json:"amount"`
	TokenAddress string `json:"token_address"`
	Rate         string `json:"rate"`
}

type PaymentService

type PaymentService struct {
	Payment *Payment `json:"payment"`
}

PaymentService definition

type PriceMoney

type PriceMoney struct {

	// The amount of money, in the smallest denomination of the currency
	// indicated by currency. For example, when currency is USD,
	// amount is in cents. Monetary amounts can be positive or negative.
	// See the specific field description to determine the meaning
	// of the sign in a particular case.
	Amount int64 `json:"amount"`

	// The type of currency, in ISO 4217 format.
	// For example, the currency code for US dollars is USD.
	Currency string `json:"currency"`
}

Money fields can be signed or unsigned. Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See Working with Monetary Amounts for more information.

type PurchaseTotal

type PurchaseTotal struct {
	SubTotal *PriceMoney `json:"sub_total"`
	Discount *PriceMoney `json:"discount"`
	TaxTotal *PriceMoney `json:"tax_total"`
}

type Refund

type Refund struct {
	Payment      string `json:"payment"`
	ChainId      uint   `json:"chain_id"`
	IsETH        *bool  `json:"is_eth"`
	TxnHash      string `json:"txn_hash"`
	From         string `json:"from"`
	To           string `json:"to"`
	Amount       string `json:"amount"`
	TokenAddress string `json:"token_address"`
}

type RefundService

type RefundService struct {
	Refund *Refund `json:"refund"`
}

RefundService definition

type Request

type Request struct {
	MerchantService *MerchantService `json:"merchant_service,omitempty" form:"-"`
	OrderService    *OrderService    `json:"order_service,omitempty" form:"-"`
	PaymentService  *PaymentService  `json:"payment_service,omitempty" form:"-"`
	RefundService   *RefundService   `json:"refund_service,omitempty" form:"-"`
	SecurityService *SecurityService `json:"security_service,omitempty" form:"-"`
	FetchService    *FetchService    `json:"-"`

	SubscriptionService *SubscriptionService `json:"subscription_service,omitempty" form:"-"`
	NotificationService *NotificationService `json:"notification_service,omitempty" form:"-"`
}

type Security

type Security struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type SecurityService

type SecurityService struct {
	Security *Security `json:"security"`
}

SecurityService definition

type Subscription

type Subscription struct {
	Kind           string   `json:"kind"`
	Token          string   `json:"token"`
	Endpoint       string   `json:"endpoint"`
	EventsToAdd    []string `json:"events_to_add"`
	EventsToRemove []string `json:"events_to_remove"`
}

type SubscriptionService

type SubscriptionService struct {
	Subscription *Subscription `json:"subscription"`
}

Jump to

Keyboard shortcuts

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