Versions in this module Expand all Collapse all v0 v0.0.1 Sep 7, 2022 Changes in this version + var ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" + var ContentTypeJSON = "application/json" + var ErrInvalidAccountID = errors.New("invalid account ID") + var ErrInvalidAccountInfo = errors.New("invalid account info") + var ErrInvalidAuthRequest = errors.New("invalid auth request") + var ErrInvalidBankID = errors.New("invalid bank ID") + var ErrInvalidConsent = errors.New("invalid consent") + var ErrInvalidPaymentID = errors.New("invalid payment ID") + var ErrInvalidPaymentRequest = errors.New("invalid payment request") + var ErrInvalidPaymentType = errors.New("invalid payment type") + var ErrInvalidRemittanceInformation = errors.New("invalid remittance info") + var ErrInvalidSCAData = errors.New("invalid SCA data") + var ErrInvalidSessionID = errors.New("invalid session ID") + var HeaderDeviceID = "x-device-id" + var HeaderPSUID = "x-psu-id" + var HeaderPSUIP = "x-psu-ip-address" + var HeaderRedirectURL = "x-redirect-url" + var HeaderSessionID = "x-session-id" + type API struct + Client *Client + DeviceID string + Mapper SCAMapper + Token *Token + func (a *API) AccountByID(ctx context.Context, sessionID string, accountID string, opts ...Optional) (*Account, *SCAHandler, error) + func (a *API) Accounts(ctx context.Context, sessionID string, opts ...Optional) ([]*Account, *SCAHandler, error) + func (a *API) AuthorizePayment(ctx context.Context, sessionID string, paymentType PaymentType, ...) (*SCA, error) + func (a *API) BankByID(ctx context.Context, bankID string) (*Bank, error) + func (a *API) Banks(ctx context.Context) ([]*Bank, error) + func (a *API) BanksByCountry(ctx context.Context, countryCode string) ([]*Bank, error) + func (a *API) BanksByName(ctx context.Context, name string) ([]*Bank, error) + func (a *API) CompletePayment(ctx context.Context, sessionID string, paymentType PaymentType, ...) (*PaymentCreated, *SCAHandler, error) + func (a *API) Consent(ctx context.Context, sessionID string, opts ...Optional) (*Consent, error) + func (a *API) DeleteSession(ctx context.Context, sessionID string) error + func (a *API) DomesticPayment(ctx context.Context, sessionID string, r *PaymentRequest, opts ...Optional) (*PaymentCreated, *SCAHandler, error) + func (a *API) DomesticScheduledPayment(ctx context.Context, sessionID string, r *PaymentRequest, opts ...Optional) (*PaymentCreated, *SCAHandler, error) + func (a *API) NewSession(ctx context.Context, bankID string) (*Session, error) + func (a *API) SEPAPayment(ctx context.Context, sessionID string, r *PaymentRequest, opts ...Optional) (*PaymentCreated, *SCAHandler, error) + func (a *API) SEPAScheduledPayment(ctx context.Context, sessionID string, r *PaymentRequest, opts ...Optional) (*PaymentCreated, *SCAHandler, error) + func (a *API) Status(ctx context.Context, sessionID string) (*SessionStatus, error) + func (a *API) Txs(ctx context.Context, sessionID, accountID string, opts ...Optional) ([]*Tx, *SCAHandler, error) + type Account struct + AccountName string + AccountType string + BBAN string + Balances []*Balance + DisplayName string + IBAN string + ID string + OwnerName string + SortCodeAccountNumber string + type AccountInfo struct + BBAN string + IBAN string + SortCodeAccountNumber string + func (info *AccountInfo) OK() error + type Address struct + BuildingNumber string + City string + Country string + PostalCode string + StreetName string + type Agent struct + ID string + IDType string + type Balance struct + Amount string + Currency string + Type string + type Bank struct + BankDisplayName string + BankOfficialName string + BankingGroupName string + Bic string + CountryCode string + ID string + IdentificationRequired Bool + Status string + SupportedServices []string + type Bool bool + func (b *Bool) UnmarshalJSON(data []byte) error + type Client struct + func NewClient(client, secret, baseURL string, doer Doer) *Client + func NewProductionClient(client, secret string, doer Doer) *Client + func NewSandboxClient(client, secret string, doer Doer) *Client + func (c *Client) API(ctx context.Context, deviceID string) (*API, error) + func (c *Client) AccessToken(ctx context.Context) (*Token, error) + func (c *Client) RefreshToken(ctx context.Context, t *Token) (*Token, error) + type Consent struct + Links []*Link + Message string + PaymentID string + type Doer interface + Do func(req *http.Request) (*http.Response, error) + type Encrypter func(s string) (string, error) + func NewEncrypter(jsonPath string) (Encrypter, error) + type Error struct + ErrorCode string + ID string + Links []*Link + Message string + Source string + Timestamp int64 + Type string + func (e *Error) Error() string + func (e *Error) IsConsentError() bool + func (e *Error) IsPaymentAuthError() bool + type Link struct + Href string + Meta Meta + Rel string + Type string + type Meta struct + ID string + type Money struct + Currency string + Value string + type Optional func(*http.Request) + func DeviceID(id string) Optional + func PsuID(id string) Optional + func PsuIP(ip string) Optional + func RedirectURL(url string) Optional + func SessionID(id string) Optional + type PaymentCode string + var PaymentCodeCommercial PaymentCode = "GDDS" + var PaymentCodeElectronic PaymentCode = "SCVE" + var PaymentCodeInvoice PaymentCode = "IVPT" + var PaymentCodeOther PaymentCode = "OTHR" + var PaymentCodeP2P PaymentCode = "MP2P" + type PaymentCreated struct + CreatedAt time.Time + PaymentID string + Status string + type PaymentMetadata struct + Address *Address + Agent *Agent + Code PaymentCode + MerchantCategoryCode string + MerchantCustomerID string + type PaymentRequest struct + CreditorAccount *AccountInfo + CreditorName string + Currency string + DebtorAccount *AccountInfo + DebtorName string + EndToEndIdentification string + InstrumentedAmount string + PaymentMetadata *PaymentMetadata + RemittanceInfoStructured *RemittanceInfoStructured + RemittanceInfoUnstructured string + RequestedExecutionDate *time.Time + func (r *PaymentRequest) OK() error + type PaymentType string + var PaymentTypeDomestic PaymentType = "domestic-transfer" + var PaymentTypeDomesticScheduled PaymentType = "domestic-scheduled-transfer" + var PaymentTypeSEPA PaymentType = "sepa-credit" + var PaymentTypeSEPAScheduled PaymentType = "sepa-scheduled-credit" + func (p PaymentType) OK() error + type RemittanceInfoStructured struct + Issuer string + Reference string + Type string + func (info *RemittanceInfoStructured) OK() error + type SCA struct + Error *Error + ID string + URL string + func DefaultSCAMapper(d Doer, r *http.Request, e *Error) (*SCA, error) + type SCAHandler struct + Retry func(ctx context.Context, v interface{}) (*SCAHandler, error) + type SCAMapper func(d Doer, r *http.Request, e *Error) (*SCA, error) + type Session struct + ID string + type SessionStatus struct + BankID string + BankName string + CreatedAt string + ProviderID string + type Token struct + AccessToken string + ExpiresIn int + RefreshExpiresIn int + RefreshToken string + SessionState string + TokenType string + type Tx struct + BookingDate *time.Time + CounterpartyAccount string + CounterpartyAgent string + CounterpartyName string + CreditDebitIndicator string + ID string + TransactionAmount *Money + TransactionReference string + ValueDate *time.Time