integrationtests

package
v0.0.0-...-9cf9cea Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisbursementCSVFiles embed.FS

Functions

This section is empty.

Types

type AdminApiIntegrationTests

type AdminApiIntegrationTests struct {
	HttpClient      httpclient.HttpClientInterface
	AdminApiBaseURL string
	AccountId       string
	ApiKey          string
}

func (AdminApiIntegrationTests) AuthHeader

func (aa AdminApiIntegrationTests) AuthHeader() string

AuthHeader returns the auth header using base64 encoding of the account id and api key

func (AdminApiIntegrationTests) CreateTenant

type AdminApiIntegrationTestsInterface

type AdminApiIntegrationTestsInterface interface {
	CreateTenant(ctx context.Context, body CreateTenantRequest) (*tenant.Tenant, error)
}

type AnchorPlatformAuthSEP24Token

type AnchorPlatformAuthSEP24Token struct {
	Token string `query:"token"`
}

type AnchorPlatformAuthToken

type AnchorPlatformAuthToken struct {
	Token string `json:"token"`
}

type AnchorPlatformDepositResponse

type AnchorPlatformDepositResponse struct {
	URL           string `json:"url"`
	TransactionID string `json:"id"`
}

type AnchorPlatformIntegrationTests

type AnchorPlatformIntegrationTests struct {
	HttpClient                httpclient.HttpClientInterface
	TenantName                string
	AnchorPlatformBaseSepURL  string
	ReceiverAccountPublicKey  string
	ReceiverAccountPrivateKey string
	Sep10SigningPublicKey     string
	DisbursedAssetCode        string
}

func (AnchorPlatformIntegrationTests) CreateSep24DepositTransaction

CreateSep24DepositTransaction creates a new sep24 deposit transaction on the anchor platform. To make this request, an auth token is required and it needs to be obtained through SEP-10.

func (AnchorPlatformIntegrationTests) SendSignedChallengeTransaction

func (ap AnchorPlatformIntegrationTests) SendSignedChallengeTransaction(signedChallengeTx *SignedChallengeTransaction) (*AnchorPlatformAuthToken, error)

SendSignedChallengeTransaction sends the signed transaction to the anchor platform to get the authorization token.

func (AnchorPlatformIntegrationTests) SignChallengeTransaction

func (ap AnchorPlatformIntegrationTests) SignChallengeTransaction(challengeTx *ChallengeTransaction) (*SignedChallengeTransaction, error)

SignChallengeTransaction signs a challenge transaction with the ReceiverAccountPrivateKey.

func (AnchorPlatformIntegrationTests) StartChallengeTransaction

func (ap AnchorPlatformIntegrationTests) StartChallengeTransaction() (*ChallengeTransaction, error)

StartChallengeTransaction create a new challenge transaction through the anchor platform.

type AnchorPlatformIntegrationTestsInterface

type AnchorPlatformIntegrationTestsInterface interface {
	StartChallengeTransaction() (*ChallengeTransaction, error)
	SignChallengeTransaction(challengeTx *ChallengeTransaction) (*SignedChallengeTransaction, error)
	SendSignedChallengeTransaction(signedChallengeTx *SignedChallengeTransaction) (*AnchorPlatformAuthToken, error)
	CreateSep24DepositTransaction(authToken *AnchorPlatformAuthToken) (*AnchorPlatformAuthSEP24Token, *AnchorPlatformDepositResponse, error)
}

type ChallengeTransaction

type ChallengeTransaction struct {
	TransactionStr    string `json:"transaction"`
	NetworkPassphrase string `json:"network_passphrase"`
	Transaction       *txnbuild.Transaction
}

type CreateTenantRequest

type CreateTenantRequest struct {
	Name                string `json:"name"`
	OwnerEmail          string `json:"owner_email"`
	OwnerFirstName      string `json:"owner_first_name"`
	OwnerLastName       string `json:"owner_last_name"`
	OrganizationName    string `json:"organization_name"`
	BaseURL             string `json:"base_url"`
	SDPUIBaseURL        string `json:"sdp_ui_base_url"`
	DistributionAccount string `json:"distribution_account"`
}

type IntegrationTestsInterface

type IntegrationTestsInterface interface {
	StartIntegrationTests(ctx context.Context, opts IntegrationTestsOpts) error
	CreateTestData(ctx context.Context, opts IntegrationTestsOpts) error
}

type IntegrationTestsOpts

type IntegrationTestsOpts struct {
	DatabaseDSN                string
	TenantName                 string
	UserEmail                  string
	UserPassword               string
	DisbursedAssetCode         string
	DisbursetAssetIssuer       string
	WalletName                 string
	WalletHomepage             string
	WalletDeepLink             string
	WalletSEP10Domain          string
	DisbursementName           string
	DisbursementCSVFilePath    string
	DisbursementCSVFileName    string
	ReceiverAccountPublicKey   string
	ReceiverAccountPrivateKey  string
	ReceiverAccountStellarMemo string
	Sep10SigningPublicKey      string
	RecaptchaSiteKey           string
	AnchorPlatformBaseSepURL   string
	ServerApiBaseURL           string
	AdminServerBaseURL         string
	AdminServerAccountId       string
	AdminServerApiKey          string
}

type IntegrationTestsService

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

func NewIntegrationTestsService

func NewIntegrationTestsService(opts IntegrationTestsOpts) (*IntegrationTestsService, error)

NewIntegrationTestsService is a function that create a new IntegrationTestsService instance.

func (*IntegrationTestsService) CreateTestData

func (it *IntegrationTestsService) CreateTestData(ctx context.Context, opts IntegrationTestsOpts) error

func (*IntegrationTestsService) StartIntegrationTests

func (it *IntegrationTestsService) StartIntegrationTests(ctx context.Context, opts IntegrationTestsOpts) error

type PaymentHorizon

type PaymentHorizon struct {
	ReceiverAccount       string `json:"to"`
	Amount                string `json:"amount"`
	AssetCode             string `json:"asset_code"`
	AssetIssuer           string `json:"asset_issuer"`
	TransactionSuccessful bool   `json:"transaction_successful"`
}

type ServerApiAuthToken

type ServerApiAuthToken struct {
	Token string `json:"token"`
}

type ServerApiIntegrationTests

type ServerApiIntegrationTests struct {
	HttpClient              httpclient.HttpClientInterface
	ServerApiBaseURL        string
	TenantName              string
	UserEmail               string
	UserPassword            string
	DisbursementCSVFilePath string
	DisbursementCSVFileName string
}

func (*ServerApiIntegrationTests) CreateDisbursement

CreateDisbursement creates a new disbursement using the SDP server API.

func (*ServerApiIntegrationTests) Login

Login login the integration test user on SDP server API.

func (*ServerApiIntegrationTests) ProcessDisbursement

func (sa *ServerApiIntegrationTests) ProcessDisbursement(ctx context.Context, authToken *ServerApiAuthToken, disbursementID string) error

ProcessDisbursement process the disbursement using the SDP server API.

func (*ServerApiIntegrationTests) ReceiverRegistration

func (sa *ServerApiIntegrationTests) ReceiverRegistration(ctx context.Context, authSEP24Token *AnchorPlatformAuthSEP24Token, body *data.ReceiverRegistrationRequest) error

ReceiverRegistration completes the receiver registration using SDP server API and the anchor platform.

func (*ServerApiIntegrationTests) StartDisbursement

func (sa *ServerApiIntegrationTests) StartDisbursement(ctx context.Context, authToken *ServerApiAuthToken, disbursementID string, body *httphandler.PatchDisbursementStatusRequest) error

StartDisbursement starts the disbursement using the SDP server API.

type ServerApiIntegrationTestsInterface

type ServerApiIntegrationTestsInterface interface {
	Login(ctx context.Context) (*ServerApiAuthToken, error)
	CreateDisbursement(ctx context.Context, authToken *ServerApiAuthToken, body *httphandler.PostDisbursementRequest) (*data.Disbursement, error)
	ProcessDisbursement(ctx context.Context, authToken *ServerApiAuthToken, disbursementID string) error
	StartDisbursement(ctx context.Context, authToken *ServerApiAuthToken, disbursementID string, body *httphandler.PatchDisbursementStatusRequest) error
	ReceiverRegistration(ctx context.Context, authSEP24Token *AnchorPlatformAuthSEP24Token, body *data.ReceiverRegistrationRequest) error
}

type SignedChallengeTransaction

type SignedChallengeTransaction struct {
	*ChallengeTransaction
	SignedTransaction *txnbuild.Transaction
}

Jump to

Keyboard shortcuts

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