pay

package
v0.1167.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Code generated by "enumerator -type EvidenceDelivery -linecomment -empty"; DO NOT EDIT.

Code generated by "enumerator -type FeeType"; DO NOT EDIT.

Code generated by "enumerator -type PreviousFee -empty"; DO NOT EDIT.

Index

Constants

View Source
const (
	PaymentPublicServiceUrl = "https://www.payments.service.gov.uk"
)

Variables

View Source
var EvidenceDeliveryValues = EvidenceDeliveryOptions{
	Upload: Upload,
	Post:   Post,
}
View Source
var FeeTypeValues = FeeTypeOptions{
	FullFee:              FullFee,
	HalfFee:              HalfFee,
	NoFee:                NoFee,
	HardshipFee:          HardshipFee,
	RepeatApplicationFee: RepeatApplicationFee,
}
View Source
var PreviousFeeValues = PreviousFeeOptions{
	PreviousFeeFull:      PreviousFeeFull,
	PreviousFeeHalf:      PreviousFeeHalf,
	PreviousFeeExemption: PreviousFeeExemption,
	PreviousFeeHardship:  PreviousFeeHardship,
}

Functions

func Cost added in v0.795.0

func Cost(feeType FeeType, previousFee PreviousFee) int

Types

type AuthorisationSummary

type AuthorisationSummary struct {
	ThreeDSecure ThreeDSecure `json:"three_d_secure"`
}

type BillingAddress

type BillingAddress struct {
	Line1    string `json:"line1"`
	Line2    string `json:"line2"`
	Postcode string `json:"postcode"`
	City     string `json:"city"`
	Country  string `json:"country"`
}

type CardDetails

type CardDetails struct {
	CardBrand             string         `json:"card_brand"`
	CardType              string         `json:"card_type"`
	LastDigitsCardNumber  string         `json:"last_digits_card_number"`
	FirstDigitsCardNumber string         `json:"first_digits_card_number"`
	ExpiryDate            string         `json:"expiry_date"`
	CardholderName        string         `json:"cardholder_name"`
	BillingAddress        BillingAddress `json:"billing_address"`
}

type Client

type Client struct {
	BaseURL    string
	ApiKey     string
	HttpClient Doer
}

func (*Client) CreatePayment

func (c *Client) CreatePayment(ctx context.Context, body CreatePaymentBody) (CreatePaymentResponse, error)

func (*Client) GetPayment

func (c *Client) GetPayment(ctx context.Context, paymentId string) (GetPaymentResponse, error)

type CreatePaymentBody

type CreatePaymentBody struct {
	Amount      int    `json:"amount"`
	Reference   string `json:"reference"`
	Description string `json:"description"`
	ReturnUrl   string `json:"return_url"`
	Email       string `json:"email"`
	Language    string `json:"language"`
}

type CreatePaymentResponse

type CreatePaymentResponse struct {
	CreatedDate     GovUKPayTime    `json:"created_date"`
	State           State           `json:"State"`
	Links           map[string]Link `json:"_links"`
	Amount          int             `json:"amount"`
	Reference       string          `json:"reference"`
	Description     string          `json:"description"`
	ReturnUrl       string          `json:"return_url"`
	PaymentId       string          `json:"payment_id"`
	PaymentProvider string          `json:"payment_provider"`
	ProviderId      string          `json:"provider_id"`
}

type Doer

type Doer interface {
	Do(r *http.Request) (*http.Response, error)
}

type EvidenceDelivery added in v0.795.0

type EvidenceDelivery uint8
const (
	Upload EvidenceDelivery = iota + 1 // upload
	Post                               // post
)

func ParseEvidenceDelivery added in v0.795.0

func ParseEvidenceDelivery(s string) (EvidenceDelivery, error)

func (EvidenceDelivery) Empty added in v0.795.0

func (i EvidenceDelivery) Empty() bool

func (EvidenceDelivery) IsPost added in v0.795.0

func (i EvidenceDelivery) IsPost() bool

func (EvidenceDelivery) IsUpload added in v0.795.0

func (i EvidenceDelivery) IsUpload() bool

func (EvidenceDelivery) MarshalText added in v0.912.0

func (i EvidenceDelivery) MarshalText() ([]byte, error)

func (EvidenceDelivery) String added in v0.795.0

func (i EvidenceDelivery) String() string

func (*EvidenceDelivery) UnmarshalText added in v0.1095.0

func (i *EvidenceDelivery) UnmarshalText(text []byte) error

type EvidenceDeliveryOptions added in v0.795.0

type EvidenceDeliveryOptions struct {
	Upload EvidenceDelivery
	Post   EvidenceDelivery
}

type FeeType added in v0.795.0

type FeeType uint8
const (
	FullFee FeeType = iota
	HalfFee
	NoFee
	HardshipFee
	RepeatApplicationFee
)

func ParseFeeType added in v0.795.0

func ParseFeeType(s string) (FeeType, error)

func (FeeType) IsFullFee added in v0.795.0

func (i FeeType) IsFullFee() bool

func (FeeType) IsHalfFee added in v0.795.0

func (i FeeType) IsHalfFee() bool

func (FeeType) IsHardshipFee added in v0.795.0

func (i FeeType) IsHardshipFee() bool

func (FeeType) IsNoFee added in v0.795.0

func (i FeeType) IsNoFee() bool

func (FeeType) IsRepeatApplicationFee added in v0.795.0

func (i FeeType) IsRepeatApplicationFee() bool

func (FeeType) MarshalText added in v0.912.0

func (i FeeType) MarshalText() ([]byte, error)

func (FeeType) String added in v0.795.0

func (i FeeType) String() string

func (*FeeType) UnmarshalText added in v0.1095.0

func (i *FeeType) UnmarshalText(text []byte) error

type FeeTypeOptions added in v0.795.0

type FeeTypeOptions struct {
	FullFee              FeeType
	HalfFee              FeeType
	NoFee                FeeType
	HardshipFee          FeeType
	RepeatApplicationFee FeeType
}

type GetPaymentResponse

type GetPaymentResponse struct {
	CreatedDate GovUKPayTime `json:"created_date"`
	Amount      int          `json:"amount"`
	State       State        `json:"State"`
	Description string       `json:"description"`
	Reference   string       `json:"reference"`
	Language    string       `json:"language"`
	//May be useful but until we define if/what we send in CreatePayment we can't marshal the response
	//
	//Metadata    struct {
	//	LedgerCode                string `json:"ledger_code"`
	//	AnInternalReferenceNumber int    `json:"an_internal_reference_number"`
	//} `json:"metadata"`
	Email                  string               `json:"email"`
	CardDetails            CardDetails          `json:"card_details"`
	PaymentId              string               `json:"payment_id"`
	AuthorisationSummary   AuthorisationSummary `json:"authorisation_summary"`
	RefundSummary          RefundSummary        `json:"refund_summary"`
	SettlementSummary      SettlementSummary    `json:"settlement_summary"`
	DelayedCapture         bool                 `json:"delayed_capture"`
	Moto                   bool                 `json:"moto"`
	CorporateCardSurcharge int                  `json:"corporate_card_surcharge"`
	TotalAmount            int                  `json:"total_amount"`
	Fee                    int                  `json:"fee"`
	NetAmount              int                  `json:"net_amount"`
	PaymentProvider        string               `json:"payment_provider"`
	ProviderId             string               `json:"provider_id"`
	ReturnUrl              string               `json:"return_url"`
}

type GovUKPayTime

type GovUKPayTime time.Time

func (GovUKPayTime) Format

func (g GovUKPayTime) Format(s string) string

func (GovUKPayTime) MarshalText

func (g GovUKPayTime) MarshalText() ([]byte, error)

func (*GovUKPayTime) UnmarshalText

func (g *GovUKPayTime) UnmarshalText(b []byte) error
type Link struct {
	Href   string `json:"href"`
	Method string `json:"method"`
}

type PreviousFee added in v0.795.0

type PreviousFee uint8
const (
	PreviousFeeFull PreviousFee = iota + 1
	PreviousFeeHalf
	PreviousFeeExemption
	PreviousFeeHardship
)

func ParsePreviousFee added in v0.795.0

func ParsePreviousFee(s string) (PreviousFee, error)

func (PreviousFee) Empty added in v0.795.0

func (i PreviousFee) Empty() bool

func (PreviousFee) IsPreviousFeeExemption added in v0.795.0

func (i PreviousFee) IsPreviousFeeExemption() bool

func (PreviousFee) IsPreviousFeeFull added in v0.795.0

func (i PreviousFee) IsPreviousFeeFull() bool

func (PreviousFee) IsPreviousFeeHalf added in v0.795.0

func (i PreviousFee) IsPreviousFeeHalf() bool

func (PreviousFee) IsPreviousFeeHardship added in v0.795.0

func (i PreviousFee) IsPreviousFeeHardship() bool

func (PreviousFee) MarshalText added in v0.912.0

func (i PreviousFee) MarshalText() ([]byte, error)

func (PreviousFee) String added in v0.795.0

func (i PreviousFee) String() string

func (*PreviousFee) UnmarshalText added in v0.1095.0

func (i *PreviousFee) UnmarshalText(text []byte) error

type PreviousFeeOptions added in v0.795.0

type PreviousFeeOptions struct {
	PreviousFeeFull      PreviousFee
	PreviousFeeHalf      PreviousFee
	PreviousFeeExemption PreviousFee
	PreviousFeeHardship  PreviousFee
}

type RefundSummary

type RefundSummary struct {
	Status          string `json:"status"`
	AmountAvailable int    `json:"amount_available"`
}

type SettlementSummary

type SettlementSummary struct {
	CaptureSubmitTime string `json:"capture_submit_time"`
	CapturedDate      string `json:"captured_date"`
	SettledDate       string `json:"settled_date"`
}

type State

type State struct {
	Status   string `json:"status"`
	Finished bool   `json:"finished"`
}

type ThreeDSecure

type ThreeDSecure struct {
	Required bool `json:"required"`
}

Jump to

Keyboard shortcuts

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