Documentation
¶
Overview ¶
Package pay provides a client for GOV.UK's Pay service.
Index ¶
- Constants
- Variables
- func Cost(feeType FeeType, previousFee PreviousFee, ...) int
- type AmountPence
- type AuthorisationSummary
- type BillingAddress
- type CardDetails
- type Client
- type CostOfRepeatApplication
- func (i CostOfRepeatApplication) Empty() bool
- func (i CostOfRepeatApplication) IsHalfFee() bool
- func (i CostOfRepeatApplication) IsNoFee() bool
- func (i CostOfRepeatApplication) MarshalText() ([]byte, error)
- func (i CostOfRepeatApplication) String() string
- func (i *CostOfRepeatApplication) UnmarshalText(text []byte) error
- type CostOfRepeatApplicationOptions
- type CreatePaymentBody
- type CreatePaymentResponse
- type Doer
- type EvidenceDelivery
- type EvidenceDeliveryOptions
- type FeeType
- func (i FeeType) IsFullFee() bool
- func (i FeeType) IsHalfFee() bool
- func (i FeeType) IsHardshipFee() bool
- func (i FeeType) IsNoFee() bool
- func (i FeeType) IsQuarterFee() bool
- func (i FeeType) IsRepeatApplicationFee() bool
- func (i FeeType) MarshalText() ([]byte, error)
- func (i FeeType) String() string
- func (i *FeeType) UnmarshalText(text []byte) error
- type FeeTypeOptions
- type GetPaymentResponse
- type Link
- type Logger
- type PreviousFee
- func (i PreviousFee) Empty() bool
- func (i PreviousFee) IsExemption() bool
- func (i PreviousFee) IsFull() bool
- func (i PreviousFee) IsHalf() bool
- func (i PreviousFee) IsHardship() bool
- func (i PreviousFee) MarshalText() ([]byte, error)
- func (i PreviousFee) String() string
- func (i *PreviousFee) UnmarshalText(text []byte) error
- type PreviousFeeOptions
- type RefundSummary
- type SettlementSummary
- type State
- type ThreeDSecure
Constants ¶
View Source
const ( FeeFull = 9200 FeeHalf = 4600 FeeQuarter = 2300 )
Variables ¶
View Source
var CostOfRepeatApplicationValues = CostOfRepeatApplicationOptions{ NoFee: CostOfRepeatApplicationNoFee, HalfFee: CostOfRepeatApplicationHalfFee, }
View Source
var EvidenceDeliveryValues = EvidenceDeliveryOptions{ Upload: Upload, Post: Post, }
View Source
var FeeTypeValues = FeeTypeOptions{ FullFee: FullFee, HalfFee: HalfFee, QuarterFee: QuarterFee, NoFee: NoFee, HardshipFee: HardshipFee, RepeatApplicationFee: RepeatApplicationFee, }
View Source
var PreviousFeeValues = PreviousFeeOptions{ Full: PreviousFeeFull, Half: PreviousFeeHalf, Exemption: PreviousFeeExemption, Hardship: PreviousFeeHardship, }
Functions ¶
func Cost ¶ added in v0.795.0
func Cost(feeType FeeType, previousFee PreviousFee, costOfRepeatApplication CostOfRepeatApplication) int
Types ¶
type AmountPence ¶ added in v0.1311.0
type AmountPence int
func (AmountPence) Pence ¶ added in v0.1311.0
func (a AmountPence) Pence() int
func (AmountPence) String ¶ added in v0.1311.0
func (a AmountPence) String() string
type AuthorisationSummary ¶
type AuthorisationSummary struct {
ThreeDSecure ThreeDSecure `json:"three_d_secure"`
}
type BillingAddress ¶
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 {
// contains filtered or unexported fields
}
func (*Client) CanRedirect ¶ added in v0.1226.0
func (*Client) CreatePayment ¶
func (c *Client) CreatePayment(ctx context.Context, lpaUID string, body CreatePaymentBody) (*CreatePaymentResponse, error)
func (*Client) GetPayment ¶
type CostOfRepeatApplication ¶ added in v0.1569.0
type CostOfRepeatApplication uint8
const ( CostOfRepeatApplicationNoFee CostOfRepeatApplication = iota + 1 CostOfRepeatApplicationHalfFee )
func ParseCostOfRepeatApplication ¶ added in v0.1569.0
func ParseCostOfRepeatApplication(s string) (CostOfRepeatApplication, error)
func (CostOfRepeatApplication) Empty ¶ added in v0.1569.0
func (i CostOfRepeatApplication) Empty() bool
func (CostOfRepeatApplication) IsHalfFee ¶ added in v0.1569.0
func (i CostOfRepeatApplication) IsHalfFee() bool
func (CostOfRepeatApplication) IsNoFee ¶ added in v0.1569.0
func (i CostOfRepeatApplication) IsNoFee() bool
func (CostOfRepeatApplication) MarshalText ¶ added in v0.1569.0
func (i CostOfRepeatApplication) MarshalText() ([]byte, error)
func (CostOfRepeatApplication) String ¶ added in v0.1569.0
func (i CostOfRepeatApplication) String() string
func (*CostOfRepeatApplication) UnmarshalText ¶ added in v0.1569.0
func (i *CostOfRepeatApplication) UnmarshalText(text []byte) error
type CostOfRepeatApplicationOptions ¶ added in v0.1569.0
type CostOfRepeatApplicationOptions struct {
NoFee CostOfRepeatApplication
HalfFee CostOfRepeatApplication
}
type CreatePaymentBody ¶
type CreatePaymentResponse ¶
type CreatePaymentResponse struct {
CreatedDate time.Time `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 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
func ParseFeeType ¶ added in v0.795.0
func (FeeType) IsHardshipFee ¶ added in v0.795.0
func (FeeType) IsQuarterFee ¶ added in v0.1612.0
func (FeeType) IsRepeatApplicationFee ¶ added in v0.795.0
func (FeeType) MarshalText ¶ added in v0.912.0
func (*FeeType) UnmarshalText ¶ added in v0.1095.0
type FeeTypeOptions ¶ added in v0.795.0
type GetPaymentResponse ¶
type GetPaymentResponse struct {
CreatedDate time.Time `json:"created_date"`
AmountPence AmountPence `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 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) IsExemption ¶ added in v0.1569.0
func (i PreviousFee) IsExemption() bool
func (PreviousFee) IsFull ¶ added in v0.1569.0
func (i PreviousFee) IsFull() bool
func (PreviousFee) IsHalf ¶ added in v0.1569.0
func (i PreviousFee) IsHalf() bool
func (PreviousFee) IsHardship ¶ added in v0.1569.0
func (i PreviousFee) IsHardship() 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 {
Full PreviousFee
Half PreviousFee
Exemption PreviousFee
Hardship PreviousFee
}
type RefundSummary ¶
type RefundSummary struct {
Status string `json:"status"`
AmountAvailable AmountPence `json:"amount_available"`
}
type SettlementSummary ¶
type ThreeDSecure ¶
type ThreeDSecure struct {
Required bool `json:"required"`
}
Click to show internal directories.
Click to hide internal directories.