Documentation ¶
Index ¶
- Variables
- func Create() (err error)
- type ConcardisDownstream
- type Impl
- func (i *Impl) CreatePaymentLink(ctx context.Context, request PaymentLinkCreateRequest) (PaymentLinkCreated, error)
- func (i *Impl) DeletePaymentLink(ctx context.Context, id uint) error
- func (i *Impl) QueryPaymentLink(ctx context.Context, id uint) (PaymentLinkQueryResponse, error)
- func (i *Impl) QueryTransactions(ctx context.Context, timeGreaterThan time.Time, timeLessThan time.Time) ([]TransactionData, error)
- type Invoice
- type Mock
- type Payment
- type PaymentLinkCreateRequest
- type PaymentLinkCreated
- type PaymentLinkInvoice
- type PaymentLinkQueryResponse
- type TransactionData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoSuchID404Error = errors.New("payment link id not found") DownstreamError = errors.New("downstream unavailable - see log for details") NotSuccessful = errors.New("response body status field did not indicate success") )
View Source
var FixedSignatureValue string
FixedSignatureValue set for automated contract testing only
Functions ¶
Types ¶
type ConcardisDownstream ¶
type ConcardisDownstream interface { CreatePaymentLink(ctx context.Context, request PaymentLinkCreateRequest) (PaymentLinkCreated, error) QueryPaymentLink(ctx context.Context, id uint) (PaymentLinkQueryResponse, error) DeletePaymentLink(ctx context.Context, id uint) error QueryTransactions(ctx context.Context, timeGreaterThan time.Time, timeLessThan time.Time) ([]TransactionData, error) }
func Get ¶
func Get() ConcardisDownstream
func NewTestingClient ¶
func NewTestingClient(verifierClient aurestclientapi.Client) ConcardisDownstream
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (*Impl) CreatePaymentLink ¶
func (i *Impl) CreatePaymentLink(ctx context.Context, request PaymentLinkCreateRequest) (PaymentLinkCreated, error)
func (*Impl) DeletePaymentLink ¶
func (*Impl) QueryPaymentLink ¶
type Mock ¶
type Mock interface { ConcardisDownstream Reset() Recording() []string SimulateError(err error) InjectTransaction(tx TransactionData) ManipulateStatus(paylinkId uint, status string) }
func CreateMock ¶
func CreateMock() Mock
type PaymentLinkCreateRequest ¶
type PaymentLinkCreateRequest struct { Title string `json:"title"` Description string `json:"description"` PSP uint64 `json:"psp"` ReferenceId string `json:"referenceId"` OrderId string `json:"concardisOrderId"` Purpose string `json:"purpose"` Amount int64 `json:"amount"` // in cents VatRate float64 `json:"vatRate"` // in % Currency string `json:"currency"` SKU string `json:"sku"` Email string `json:"email"` SuccessRedirectUrl string `json:"successRedirectUrl"` // optional - leave empty FailedRedirectUrl string `json:"failedRedirectUrl"` // optional - leave empty }
PaymentLinkCreateRequest contains the data to construct the paylink create request body.
Note that the json field names are not actually used because the Concardis API doesn't accept JSON, and instead insists on a slightly unusual XWwwFormUrlencoded request.
type PaymentLinkCreated ¶
type PaymentLinkInvoice ¶
type PaymentLinkInvoice struct { ReferenceID string `json:"referenceId"` PaymentRequestId uint `json:"paymentRequestId"` // the payment link id Currency string `json:"currency"` Amount int64 `json:"amount"` Transactions []TransactionData `json:"transactions"` }
type PaymentLinkQueryResponse ¶
type PaymentLinkQueryResponse struct { ID uint `json:"id"` // not the payment link id! Status string `json:"status"` ReferenceID string `json:"referenceId"` Link string `json:"link"` Invoices []PaymentLinkInvoice `json:"invoices"` Name string `json:"name"` Purpose map[string]string `json:"purpose"` Amount int64 `json:"amount"` Currency string `json:"currency"` CreatedAt int64 `json:"createdAt"` VatRate float64 `json:"vatRate"` }
type TransactionData ¶
type TransactionData struct { ID int64 `json:"id"` UUID string `json:"uuid"` // sent as merchantOrderId Amount int64 `json:"amount"` Status string `json:"status"` // react to declined, confirmed, authorized, what else? Time string `json:"time"` // take effective date from first 10 chars (ISO Date) Lang string `json:"lang"` // ISO 639-1 of shopper language (de, en) PageUUID string `json:"pageUuid"` Payment Payment `json:"payment"` Psp string `json:"psp"` // Name of the payment service provider used, for example "ConCardis_PayEngine_3" PspID int64 `json:"pspId"` // ID of the Psp Mode string `json:"mode"` // "LIVE", "TEST" ReferenceID string `json:"referenceId"` Invoice Invoice `json:"invoice"` }
Click to show internal directories.
Click to hide internal directories.