Documentation ¶
Index ¶
- Constants
- func RequirePaymentStatus(t *testing.T, s paymentGetter, paymendID string, status PaymentStatus)
- type Account
- type Address
- type Payment
- type PaymentGateway
- type PaymentRequest
- type PaymentResponse
- type PaymentStatus
- type RefundRequest
- type RefundResponse
- type TestPaymentGateway
- func (s *TestPaymentGateway) GetLastPayments(from int, amount int) ([]*Payment, error)
- func (s *TestPaymentGateway) GetPayment(paymentID string) (*Payment, error)
- func (s *TestPaymentGateway) PaymentURL(paymentID string) (string, error)
- func (s *TestPaymentGateway) RefundPayment(paymentID string, req *RefundRequest) (*RefundResponse, error)
- func (s *TestPaymentGateway) StartPayment(req *PaymentRequest) (*PaymentResponse, error)
- func (s *TestPaymentGateway) TransferMethod() string
Constants ¶
View Source
const ( PaymentFailed PaymentStatus = "failed" PaymentPaid = "paid" PaymentRefunded = "refunded" PaymentStarted = "started" PaymentStatusUnknown = "unknown" )
View Source
const TestTransferMethod = "test"
Variables ¶
This section is empty.
Functions ¶
func RequirePaymentStatus ¶
func RequirePaymentStatus( t *testing.T, s paymentGetter, paymendID string, status PaymentStatus, )
Types ¶
type Payment ¶
type PaymentGateway ¶
type PaymentGateway interface { TransferMethod() string StartPayment(req *PaymentRequest) (*PaymentResponse, error) GetLastPayments(int, int) ([]*Payment, error) PaymentURL(paymentID string) (string, error) RefundPayment( paymentID string, req *RefundRequest, ) (*RefundResponse, error) }
type PaymentRequest ¶
type PaymentResponse ¶
type PaymentResponse struct {
PaymentID string
}
Taler responds with OrderID and 'token'. Is the token required for us?
type RefundRequest ¶
type RefundResponse ¶
type RefundResponse struct { }
type TestPaymentGateway ¶
type TestPaymentGateway struct { Config librefund.Config // contains filtered or unexported fields }
func NewTestPaymentGateway ¶
func NewTestPaymentGateway( cfg librefund.Config, ) *TestPaymentGateway
func (*TestPaymentGateway) GetLastPayments ¶
func (s *TestPaymentGateway) GetLastPayments(from int, amount int) ([]*Payment, error)
func (*TestPaymentGateway) GetPayment ¶
func (s *TestPaymentGateway) GetPayment(paymentID string) (*Payment, error)
func (*TestPaymentGateway) PaymentURL ¶
func (s *TestPaymentGateway) PaymentURL(paymentID string) (string, error)
PaymentURL redirects back to the payment fulfillmentURL
func (*TestPaymentGateway) RefundPayment ¶
func (s *TestPaymentGateway) RefundPayment( paymentID string, req *RefundRequest, ) (*RefundResponse, error)
func (*TestPaymentGateway) StartPayment ¶
func (s *TestPaymentGateway) StartPayment( req *PaymentRequest, ) (*PaymentResponse, error)
func (*TestPaymentGateway) TransferMethod ¶
func (s *TestPaymentGateway) TransferMethod() string
Click to show internal directories.
Click to hide internal directories.