cashbill

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 8 Imported by: 0

README

cashbill.go

Go Reference

Go implementation of Cashbill API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	RequestPayment(ctx context.Context, newPayment NewPayment) (PaymentRequest, error)
	GetPayment(ctx context.Context, paymentID string) (Payment, error)
}

func NewAPI

func NewAPI(shopID, secret string) API

func NewTestAPI

func NewTestAPI(shopID, secret string) API

type Amount

type Amount struct {
	Amount   string `json:"amount"`
	Currency string `json:"currency"`
}

type NewPayment

type NewPayment struct {
	Title             string `url:"title"`
	Amount            string `url:"amount.value"`
	Currency          string `url:"amount.currencyCode"`
	Description       string `url:"description"`
	AdditionalData    string `url:"additionalData"`
	ReturnURL         string `url:"returnUrl"`
	NegativeReturnURL string `url:"negativeReturnUrl"`
	PaymentChannel    string `url:"paymentChannel"`
	LanguageCode      string `url:"languageCode"`
	Referer           string `url:"referer"`
}

type Payment

type Payment struct {
	ID              string       `json:"id"`
	Title           string       `json:"title"`
	Status          string       `json:"status"`
	PaymentChannel  string       `json:"paymentChannel"`
	Description     string       `json:"description"`
	AdditionalData  string       `json:"additionalData"`
	Amount          Amount       `json:"amount"`
	RequestedAmount Amount       `json:"requestedAmount"`
	PersonalData    PersonalData `json:"personalData"`
}

type PaymentRequest

type PaymentRequest struct {
	ID        string `json:"id"`
	ReturnURL string `json:"returnUrl"`
}

type PersonalData

type PersonalData struct {
	FirstName string `json:"firstName"`
	Surname   string `json:"surname"`
	Email     string `json:"email"`
	City      string `json:"city"`
	House     string `json:"house"`
	Flat      string `json:"flat"`
	Street    string `json:"street"`
	Postcode  string `json:"postcode"`
	Country   string `json:"country"`
}

Jump to

Keyboard shortcuts

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