providers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2018 License: MIT Imports: 6 Imported by: 10

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

Provider returns payment provider from the map using the provided id panics if the provider could not be found

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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