links

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PaymentLinksPath = "payment-links"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(configuration *configuration.Configuration, apiClient client.HttpClient) *Client
func (c *Client) CreatePaymentLink(request PaymentLinkRequest) (*PaymentLinkResponse, error)
func (c *Client) GetPaymentLink(paymentLinkId string) (*PaymentLinkDetails, error)

type PaymentLinkDetails

type PaymentLinkDetails struct {
	HttpMetadata common.HttpMetadata
	Id           string                       `json:"id,omitempty"`
	Status       PaymentStatus                `json:"status,omitempty"`
	PaymentId    string                       `json:"payment_id,omitempty"`
	Amount       int                          `json:"amount,omitempty"`
	Currency     common.Currency              `json:"currency,omitempty"`
	Reference    string                       `json:"reference,omitempty"`
	Description  string                       `json:"description,omitempty"`
	CreatedOn    string                       `json:"created_on,omitempty"`
	ExpiresOn    string                       `json:"expires_on,omitempty"`
	Customer     *common.CustomerRequest      `json:"customer,omitempty"`
	Shipping     *payments.ShippingDetails    `json:"shipping,omitempty"`
	Billing      *payments.BillingInformation `json:"billing,omitempty"`
	Products     []payments.Product           `json:"products,omitempty"`
	Metadata     map[string]interface{}       `json:"metadata,omitempty"`
	Locale       string                       `json:"locale,omitempty"`
	ReturnUrl    string                       `json:"return_url,omitempty"`
	Links        map[string]common.Link       `json:"_links"`
	//Not available on previous
	ProcessingChannelId string                     `json:"processing_channel_id,omitempty"`
	AmountAllocations   []common.AmountAllocations `json:"amount_allocations,omitempty"`
}

type PaymentLinkRequest

type PaymentLinkRequest struct {
	Amount                 int                           `json:"amount,omitempty"`
	Currency               common.Currency               `json:"currency,omitempty"`
	PaymentType            payments.PaymentType          `json:"payment_type,omitempty,omitempty"`
	PaymentIp              string                        `json:"payment_ip,omitempty"`
	BillingDescriptor      *payments.BillingDescriptor   `json:"billing_descriptor,omitempty"`
	Reference              string                        `json:"reference,omitempty"`
	Description            string                        `json:"description,omitempty"`
	DisplayName            string                        `json:"display_name,omitempty"`
	ExpiresIn              int                           `json:"expires_in,omitempty"`
	Customer               *common.CustomerRequest       `json:"customer,omitempty"`
	Shipping               *payments.ShippingDetails     `json:"shipping,omitempty"`
	Billing                *payments.BillingInformation  `json:"billing,omitempty"`
	Recipient              *payments.PaymentRecipient    `json:"recipient,omitempty"`
	Processing             *payments.ProcessingSettings  `json:"processing,omitempty"`
	AllowPaymentMethods    []payments.SourceType         `json:"allow_payment_methods,omitempty"`
	DisabledPaymentMethods []payments.SourceType         `json:"disabled_payment_methods,omitempty"`
	Products               []payments.Product            `json:"products,omitempty"`
	Metadata               map[string]interface{}        `json:"metadata,omitempty"`
	ThreeDs                *payments.ThreeDsRequest      `json:"3ds,omitempty"`
	Risk                   *payments.RiskRequest         `json:"risk,omitempty"`
	CustomerRetry          *payments.PaymentRetryRequest `json:"customer_retry,omitempty"`
	Sender                 *nas.Sender                   `json:"sender,omitempty"`
	ReturnUrl              string                        `json:"return_url,omitempty"`
	Locale                 string                        `json:"locale,omitempty"`
	Capture                bool                          `json:"capture,omitempty"`
	CaptureOn              *time.Time                    `json:"capture_on,omitempty"`
	//Not available on previous
	ProcessingChannelId string                     `json:"processing_channel_id,omitempty"`
	AmountAllocations   []common.AmountAllocations `json:"amount_allocations,omitempty"`
}

type PaymentLinkResponse

type PaymentLinkResponse struct {
	HttpMetadata common.HttpMetadata
	Id           string                 `json:"id,omitempty"`
	ExpiresOn    string                 `json:"expires_on,omitempty"`
	Reference    string                 `json:"reference,omitempty"`
	Warnings     []interface{}          `json:"warnings,omitempty"`
	Links        map[string]common.Link `json:"_links"`
}

type PaymentStatus

type PaymentStatus string
const (
	Active          PaymentStatus = "Active"
	PaymentReceived PaymentStatus = "Payment Received"
	Expired         PaymentStatus = "Expired"
)

Jump to

Keyboard shortcuts

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