testing

package
v0.0.0-...-89aac52 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompareUnexported = cmp.Exporter(func(reflect.Type) bool { return true })

CompareUnexported allows cmp to compare private fields of internal structs

Functions

func Base3DS added in v1.1.846

func Base3DS() *sleet.ThreeDS

Base3DS provides a template with 3DS authorization data. Fields are populated by their names since no valid values will exist without first having run 3DS.

func BaseAuthorizationRequest

func BaseAuthorizationRequest() *sleet.AuthorizationRequest

BaseAuthorizationRequest is used as a testing helper method to standardize request calls for integration tests

func BaseAuthorizationRequestWithEmailPhoneNumber added in v1.1.1048

func BaseAuthorizationRequestWithEmailPhoneNumber() *sleet.AuthorizationRequest

func BaseAuthorizationRequestWithResponseHeaderOption added in v1.1.1190

func BaseAuthorizationRequestWithResponseHeaderOption() *sleet.AuthorizationRequest

func BaseCaptureRequest added in v1.1.414

func BaseCaptureRequest() *sleet.CaptureRequest

func BaseCaptureRequestWithOptions added in v1.1.1153

func BaseCaptureRequestWithOptions() *sleet.CaptureRequest

func BaseLevel3Data added in v1.1.637

func BaseLevel3Data() *sleet.Level3Data

BaseLevel3Data is used as a testing helper method to standardize request calls for integration tests

func BaseLevel3DataMultipleItem added in v1.1.900

func BaseLevel3DataMultipleItem() *sleet.Level3Data

func BaseRefundRequest added in v1.1.414

func BaseRefundRequest() *sleet.RefundRequest

func BaseVoidRequest added in v1.1.414

func BaseVoidRequest() *sleet.VoidRequest

Types

type TestHelper added in v1.1.420

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

TestHelper methods exist to provide handle mundane tasks which can result in error without clogging test files with unimportant error checking code

func NewTestHelper added in v1.1.420

func NewTestHelper(t *testing.T) TestHelper

func (TestHelper) ReadFile added in v1.1.420

func (h TestHelper) ReadFile(path string) []byte

func (TestHelper) RoundTrip added in v1.1.1366

func (h TestHelper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip allows TestHelper to act as a HTTP RoundTripper that logs requests and responses. This can be used by overriding the HTTP client used by a PSP client to be the TestHelper instance.

Example:

 helper := sleet_testing.NewTestHelper(t)
 httpClient := &http.Client{
	 Transport: helper,
	 Timeout:   common.DefaultTimeout,
 }

func (TestHelper) Unmarshal added in v1.1.420

func (h TestHelper) Unmarshal(data []byte, destination interface{})

func (TestHelper) XmlUnmarshal added in v1.1.476

func (h TestHelper) XmlUnmarshal(data []byte, destination interface{})

Jump to

Keyboard shortcuts

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