callbacks

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package callbacks implements the payment gateway callback subdomain of the billing module: it authenticates EPay/Stripe/Alipay/Cryptomus notifications, verifies them against the order's immutable payment expectation, re-confirms with the gateway and settles the payment. Only the module facade may reach it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EPayNotifyMeta

type EPayNotifyMeta struct {
	Method string
	Params map[string]string
}

EPayNotifyMeta carries the raw callback transport details needed to verify the gateway signature.

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(orders repository.OrderRepo, queue settle.Queue) *Service

func (*Service) AlipayNotify

func (s *Service) AlipayNotify(ctx context.Context, form url.Values) error

AlipayNotify authenticates and settles an Alipay F2F notification.

func (*Service) CryptomusNotify added in v1.15.17

func (s *Service) CryptomusNotify(ctx context.Context, payload []byte) error

CryptomusNotify authenticates and settles a Cryptomus webhook. The payload signature proves the gateway sent it; the settlement is still re-confirmed against the gateway's payment-info API before money is accepted, mirroring the EPay callback's defense in depth.

func (*Service) EPayNotify

func (s *Service) EPayNotify(ctx context.Context, meta EPayNotifyMeta, req *dto.EPayNotifyRequest) error

EPayNotify authenticates and settles an EPay gateway callback.

func (*Service) StripeNotify

func (s *Service) StripeNotify(ctx context.Context, payload []byte, signature string) error

StripeNotify authenticates and settles a Stripe webhook event.

Jump to

Keyboard shortcuts

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