Versions in this module Expand all Collapse all v1 v1.0.0 May 22, 2021 Changes in this version + var ProductionEnvironment = Environment + var TestEnvironment = Environment + type Client interface + type ClientOption func(*client) + type Configuration struct + Environment *Environment + Pkcs12 *Pkcs12 + func NewConfiguration(environment *Environment, pkcs12 *Pkcs12, options ...ConfigurationOption) *Configuration + type ConfigurationOption func(*Configuration) + type Environment struct + BaseURL string + Certificate string + func NewEnvironment(baseURL string, certificate string) *Environment + type Error struct + AdditionalInformation string + Code string + Message string + type ErrorResponse []Error + func (e *ErrorResponse) Decode(response *http.Response, swish *Swish) (Response, error) + func (e ErrorResponse) Error() string + type PaymentPayload struct + AgeLimit string + Amount string + CallbackURL string + Currency string + Message string + PayeeAlias string + PayeePaymentReference string + PayerAlias string + PayerSSN string + type PaymentResponse struct + ID string + Token string + URL string + func (p *PaymentResponse) Decode(response *http.Response, swish *Swish) (Response, error) + func (p *PaymentResponse) String() string + type PaymentResultResponse struct + Amount float32 + CallbackURL string + Currency string + DateCreated string + DatePaid string + ErrorCode string + ErrorMessage string + ID string + Message string + PayeeAlias string + PayeePaymentReference string + PayerAlias string + PaymentReference string + Status string + func (p *PaymentResultResponse) Decode(response *http.Response, swish *Swish) (Response, error) + func (p *PaymentResultResponse) String() string + type Pkcs12 struct + Content []byte + Password string + type RefundPayload struct + Amount string + CallbackURL string + Currency string + Message string + OriginalPaymentReference string + PayeeAlias string + PayerAlias string + PayerPaymentReference string + type RefundResponse struct + ID string + URL string + func (r *RefundResponse) Decode(response *http.Response, swish *Swish) (Response, error) + func (r RefundResponse) String() string + type RefundResultResponse struct + AdditionalInformation string + Amount float32 + CallbackURL string + Currency string + DateCreated string + DatePaid string + ErrorCode string + ErrorMessage string + ID string + Message string + OriginalPaymentReference string + PayeeAlias string + PayerAlias string + PayerPaymentReference string + PaymentReference string + Status string + func (r *RefundResultResponse) Decode(response *http.Response, swish *Swish) (Response, error) + func (r RefundResultResponse) String() string + type Request interface + Method func() string + Payload func() payload + Response func() Response + URI func() string + type Response interface + Decode func(response *http.Response, swish *Swish) (Response, error) + type Swish struct + func New(configuration *Configuration) Swish + func (s Swish) Payment(ctx context.Context, payload *PaymentPayload) (*PaymentResponse, error) + func (s Swish) PaymentResult(ctx context.Context, token string) (*PaymentResultResponse, error) + func (s Swish) Refund(ctx context.Context, payload *RefundPayload) (*RefundResponse, error) + func (s Swish) RefundResult(ctx context.Context, token string) (*RefundResultResponse, error)