payment

package
v0.0.0-...-95992dc Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package payment is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrResourceGone = errors.New(`The requested resource for payment is gone - status [410]`)

ErrResourceGone is a sentinel error used when payment resources have been intentionally removed

Functions

This section is empty.

Types

type Fetch

type Fetch struct{}

Fetch implements the the Fetcher interface

func New

func New() *Fetch

New returns a new implementation of the Fetcher interface

func (*Fetch) GetLatestRefundStatus

func (impl *Fetch) GetLatestRefundStatus(refundEndpointUrl string, HTTPClient *http.Client, apiKey string) (*data.RefundResource, int, error)

func (*Fetch) GetPayment

func (impl *Fetch) GetPayment(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (data.PaymentResponse, int, error)

GetPayment executes a GET request to payment URL

func (*Fetch) GetPaymentDetails

func (impl *Fetch) GetPaymentDetails(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (data.PaymentDetailsResponse, int, error)

GetPaymentDetails executes a GET request to payment Details URL

type Fetcher

type Fetcher interface {
	GetPayment(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (data.PaymentResponse, int, error)
	GetPaymentDetails(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (data.PaymentDetailsResponse, int, error)
	GetLatestRefundStatus(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (*data.RefundResource, int, error)
}

Fetcher provides an interface by which to fetch payments data

type InvalidPaymentAPIResponse

type InvalidPaymentAPIResponse struct {
	// contains filtered or unexported fields
}

InvalidPaymentAPIResponse is returned when an invalid status is returned from the payments api

func (*InvalidPaymentAPIResponse) Error

func (e *InvalidPaymentAPIResponse) Error() string

Error provides a consistent error when receiving an invalid response status when fetching payments

type MockFetcher

type MockFetcher struct {
	// contains filtered or unexported fields
}

MockFetcher is a mock of Fetcher interface

func NewMockFetcher

func NewMockFetcher(ctrl *gomock.Controller) *MockFetcher

NewMockFetcher creates a new mock instance

func (*MockFetcher) EXPECT

func (m *MockFetcher) EXPECT() *MockFetcherMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockFetcher) GetLatestRefundStatus

func (m *MockFetcher) GetLatestRefundStatus(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (*data.RefundResource, int, error)

GetLatestRefundStatus mocks base method

func (*MockFetcher) GetPayment

func (m *MockFetcher) GetPayment(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (data.PaymentResponse, int, error)

GetPayment mocks base method

func (*MockFetcher) GetPaymentDetails

func (m *MockFetcher) GetPaymentDetails(paymentAPIURL string, HTTPClient *http.Client, apiKey string) (data.PaymentDetailsResponse, int, error)

GetPaymentDetails mocks base method

type MockFetcherMockRecorder

type MockFetcherMockRecorder struct {
	// contains filtered or unexported fields
}

MockFetcherMockRecorder is the mock recorder for MockFetcher

func (*MockFetcherMockRecorder) GetLatestRefundStatus

func (mr *MockFetcherMockRecorder) GetLatestRefundStatus(paymentAPIURL, HTTPClient, apiKey interface{}) *gomock.Call

GetLatestRefundStatus indicates an expected call of GetLatestRefundStatus

func (*MockFetcherMockRecorder) GetPayment

func (mr *MockFetcherMockRecorder) GetPayment(paymentAPIURL, HTTPClient, apiKey interface{}) *gomock.Call

GetPayment indicates an expected call of GetPayment

func (*MockFetcherMockRecorder) GetPaymentDetails

func (mr *MockFetcherMockRecorder) GetPaymentDetails(paymentAPIURL, HTTPClient, apiKey interface{}) *gomock.Call

GetPaymentDetails indicates an expected call of GetPaymentDetails

Jump to

Keyboard shortcuts

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