payment

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Migrate applies database migrations for the PaymentModel.

Types

type PaymentService

type PaymentService struct {
	PaymentProvider map[string]payment_provider.PaymentProvider
	// contains filtered or unexported fields
}

PaymentService provides various methods to interact with payment providers and manage payment-related data.

func NewPaymentService

func NewPaymentService(db *gorm.DB, ctx *context.ERPContext) *PaymentService

NewPaymentService creates a new instance of PaymentService.

func (*PaymentService) AddPaymentProvider

func (s *PaymentService) AddPaymentProvider(providerName string, paymentProvider payment_provider.PaymentProvider)

AddPaymentProvider adds a new payment provider to the service and sets it as the active provider.

func (*PaymentService) CreatePayment

func (s *PaymentService) CreatePayment(data *models.PaymentModel) error

CreatePayment creates a new payment record in the database.

func (*PaymentService) CreatePaymentEWallet

func (s *PaymentService) CreatePaymentEWallet(data interface{}) (interface{}, error)

CreatePaymentEWallet creates an e-wallet payment using the active payment provider.

func (s *PaymentService) CreatePaymentLink(data interface{}) (interface{}, error)

CreatePaymentLink creates a payment link using the active payment provider.

func (*PaymentService) CreatePaymentVA

func (s *PaymentService) CreatePaymentVA(data interface{}) (interface{}, error)

CreatePaymentVA creates a virtual account payment using the active payment provider.

func (*PaymentService) DetailPayment

func (s *PaymentService) DetailPayment(data ...interface{}) (interface{}, error)

DetailPayment retrieves payment details from the active payment provider.

func (*PaymentService) DetailPaymentEWallet

func (s *PaymentService) DetailPaymentEWallet(data ...interface{}) (interface{}, error)

DetailPaymentEWallet retrieves e-wallet payment details from the active payment provider.

func (*PaymentService) DetailPaymentVA

func (s *PaymentService) DetailPaymentVA(data ...interface{}) (interface{}, error)

DetailPaymentVA retrieves virtual account payment details from the active payment provider.

func (*PaymentService) GetPaymentBankCode

func (s *PaymentService) GetPaymentBankCode() map[string]string

GetPaymentBankCode retrieves a map of bank codes.

func (*PaymentService) GetPaymentByCode

func (s *PaymentService) GetPaymentByCode(code string) (*models.PaymentModel, error)

GetPaymentByCode retrieves a payment record by its code.

func (*PaymentService) SetActivePaymentProvider

func (s *PaymentService) SetActivePaymentProvider(providerName string)

SetActivePaymentProvider sets the active payment provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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