Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(paymentConfig []config.PaymentProvider)
New creates several payment providers from the provided []config.PaymentProvider and saves them in provider map for further use. panics on the first error.
Types ¶
type Interface ¶
type Interface interface { ProviderId() paymentpb.PaymentProviderId Charge(req *paymentpb.ChargeRequest) (*paymentpb.Charge, error) Refund(chargeId string, amount uint64, currency paymentpb.Currency, reason paymentpb.RefundReason) (*paymentpb.Refund, error) SupportedCards() []paymentpb.CardType }
Interface defines the base functionality which any payment provider should implement to become valid payment provider
func Provider ¶
func Provider(p paymentpb.PaymentProviderId) Interface
Provider returns payment provider from the map using the provided id panics if the provider could not be found
Click to show internal directories.
Click to hide internal directories.