func (m *Manager) GetPaymentMethods(ctx context.Context, opts ...payment.Option) (*PaymentMethodList, error) {
	cfg, err := m.paymentConfigRepository.FindAll(ctx)
	if err != nil {
		return nil, err
	}
	options := payment.Options{}
	for _, o := range opts {
		o(&options)
	}
	return paymentMethodListFromConfig(cfg, options.Price), nil
}
GetPaymentMethods return the payment methods available in payment service
package manage
import (
	"context"
	"errors"
	"fmt"
	"github.com/rs/zerolog"
	"github.com/rs/zerolog/log"
	"github.com/imrenagi/go-payment"
	"github.com/imrenagi/go-payment/datastore"
	midgateway "github.com/imrenagi/go-payment/gateway/midtrans"
	xengateway "github.com/imrenagi/go-payment/gateway/xendit"
	"github.com/imrenagi/go-payment/invoice"
	"github.com/imrenagi/go-payment/subscription"
	"github.com/imrenagi/go-payment/util/localconfig"
)
func NewManager(
	config localconfig.Config,
	secret localconfig.PaymentSecret,
) *Manager {
	return &Manager{
		config:          config,
		xenditGateway:   xengateway.NewGateway(secret.Xendit),
		midtransGateway: midgateway.NewGateway(secret.Midtrans),
	}
}
type Manager struct {
	config                   localconfig.Config
	xenditGateway            *xengateway.Gateway
	midtransGateway          *midgateway.Gateway
	midTransactionRepository datastore.MidtransTransactionStatusRepository
	invoiceRepository        datastore.InvoiceRepository
	subscriptionRepository   datastore.SubscriptionRepository
	paymentConfigRepository  datastore.PaymentConfigReader
}
func (m *Manager) MapMidtransTransactionStatusRepository(repo datastore.MidtransTransactionStatusRepository) error {
	m.midTransactionRepository = repo
	return nil
}
func (m *Manager) MustMidtransTransactionStatusRepository(repo datastore.MidtransTransactionStatusRepository) {
	if repo == nil {
		panic(fmt.Errorf("midtrans transaction status repository can't be nil"))
	}
	m.midTransactionRepository = repo
}
func (m *Manager) MustInvoiceRepository(repo datastore.InvoiceRepository) {
	if repo == nil {
		panic(fmt.Errorf("invoice repository can't be nil"))
	}
	m.invoiceRepository = repo
}
func (m *Manager) MustSubscriptionRepository(repo datastore.SubscriptionRepository) {
	if repo == nil {
		panic(fmt.Errorf("invoice repository can't be nil"))
	}
	m.subscriptionRepository = repo
}
func (m *Manager) MustPaymentConfigReader(repo datastore.PaymentConfigReader) {
	if repo == nil {
		panic(fmt.Errorf("invoice repository can't be nil"))
	}
	m.paymentConfigRepository = repo
}
func (m Manager) charger(inv *invoice.Invoice) invoice.PaymentCharger {
	switch payment.NewGateway(inv.Payment.Gateway) {
	case payment.GatewayXendit:
		return &xenditCharger{
			config: m.config.Xendit,
			XenditGateway:    m.xenditGateway,
		}
	case payment.GatewayMidtrans:
		return &midtransCharger{
			MidtransGateway: m.midtransGateway,
		}
	default:
		panic("payment gateway is not found.")
	}
}