Documentation
¶
Index ¶
- Variables
- type Impl
- func (i *Impl) CreatePaymentLink(ctx context.Context, data cncrdapi.PaymentLinkRequestDto) (cncrdapi.PaymentLinkDto, uint, error)
- func (i *Impl) DeletePaymentLink(ctx context.Context, id uint) error
- func (i *Impl) GetPaymentLink(ctx context.Context, id uint) (cncrdapi.PaymentLinkDto, error)
- func (i *Impl) HandleWebhook(ctx context.Context, webhook cncrdapi.WebhookEventDto) error
- func (i *Impl) SendErrorNotifyMail(ctx context.Context, operation string, referenceId string, status string) error
- func (i *Impl) ValidatePaymentLinkRequest(ctx context.Context, data cncrdapi.PaymentLinkRequestDto) url.Values
- type PaymentLinkService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WebhookValidationErr = errors.New("webhook referenced invalid invoice id, must be positive integer") WebhookRefIdMismatchErr = errors.New("webhook reference_id differes from paylink reference_id") )
View Source
var NowFunc = time.Now
Functions ¶
This section is empty.
Types ¶
type Impl ¶
func (*Impl) CreatePaymentLink ¶
func (i *Impl) CreatePaymentLink(ctx context.Context, data cncrdapi.PaymentLinkRequestDto) (cncrdapi.PaymentLinkDto, uint, error)
func (*Impl) DeletePaymentLink ¶
func (*Impl) GetPaymentLink ¶
func (*Impl) HandleWebhook ¶
func (*Impl) SendErrorNotifyMail ¶
func (*Impl) ValidatePaymentLinkRequest ¶
type PaymentLinkService ¶
type PaymentLinkService interface { // ValidatePaymentLinkRequest checks the cncrdapi.PaymentLinkRequestDto for validity. // // The returned url.Values contains detailed error messages that can be used to construct a meaningful response. // It is nil if no validation errors were encountered. Any errors encountered are also logged. ValidatePaymentLinkRequest(ctx context.Context, data cncrdapi.PaymentLinkRequestDto) url.Values // CreatePaymentLink expects an already validated cncrdapi.PaymentLinkRequestDto, and makes a downstream // request to create a payment link, returning the cncrdapi.PaymentLinkDto with all its information and the // id under which to manage the payment link. CreatePaymentLink(ctx context.Context, request cncrdapi.PaymentLinkRequestDto) (cncrdapi.PaymentLinkDto, uint, error) // GetPaymentLink obtains the payment link information from the downstream api. GetPaymentLink(ctx context.Context, id uint) (cncrdapi.PaymentLinkDto, error) // DeletePaymentLink asks the downstream api to delete the given payment link. DeletePaymentLink(ctx context.Context, id uint) error // HandleWebhook requests the payment link referenced in the webhook data and reacts to any new payments HandleWebhook(ctx context.Context, webhook cncrdapi.WebhookEventDto) error // SendErrorNotifyMail notifies us about unexpected conditions in this service so we can look at the logs SendErrorNotifyMail(ctx context.Context, operation string, referenceId string, status string) error }
func New ¶
func New() PaymentLinkService
Click to show internal directories.
Click to hide internal directories.