Documentation ¶
Index ¶
- Variables
- type AdminApiIntegrationTests
- type AdminApiIntegrationTestsInterface
- type AnchorPlatformAuthSEP24Token
- type AnchorPlatformAuthToken
- type AnchorPlatformDepositResponse
- type AnchorPlatformIntegrationTests
- func (ap AnchorPlatformIntegrationTests) CreateSep24DepositTransaction(authToken *AnchorPlatformAuthToken) (*AnchorPlatformAuthSEP24Token, *AnchorPlatformDepositResponse, error)
- func (ap AnchorPlatformIntegrationTests) SendSignedChallengeTransaction(signedChallengeTx *SignedChallengeTransaction) (*AnchorPlatformAuthToken, error)
- func (ap AnchorPlatformIntegrationTests) SignChallengeTransaction(challengeTx *ChallengeTransaction) (*SignedChallengeTransaction, error)
- func (ap AnchorPlatformIntegrationTests) StartChallengeTransaction() (*ChallengeTransaction, error)
- type AnchorPlatformIntegrationTestsInterface
- type ChallengeTransaction
- type CreateTenantRequest
- type IntegrationTestsInterface
- type IntegrationTestsOpts
- type IntegrationTestsService
- type PaymentHorizon
- type ServerApiAuthToken
- type ServerApiIntegrationTests
- func (sa *ServerApiIntegrationTests) CreateDisbursement(ctx context.Context, authToken *ServerApiAuthToken, ...) (*data.Disbursement, error)
- func (sa *ServerApiIntegrationTests) Login(ctx context.Context) (*ServerApiAuthToken, error)
- func (sa *ServerApiIntegrationTests) ProcessDisbursement(ctx context.Context, authToken *ServerApiAuthToken, disbursementID string) error
- func (sa *ServerApiIntegrationTests) ReceiverRegistration(ctx context.Context, authSEP24Token *AnchorPlatformAuthSEP24Token, ...) error
- func (sa *ServerApiIntegrationTests) StartDisbursement(ctx context.Context, authToken *ServerApiAuthToken, disbursementID string, ...) error
- type ServerApiIntegrationTestsInterface
- type SignedChallengeTransaction
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (aa AdminApiIntegrationTests) 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 AnchorPlatformIntegrationTests ¶
type AnchorPlatformIntegrationTests struct { HttpClient httpclient.HttpClientInterface TenantName string AnchorPlatformBaseSepURL string ReceiverAccountPublicKey string ReceiverAccountPrivateKey string Sep10SigningPublicKey string DisbursedAssetCode string }
func (AnchorPlatformIntegrationTests) CreateSep24DepositTransaction ¶
func (ap AnchorPlatformIntegrationTests) CreateSep24DepositTransaction(authToken *AnchorPlatformAuthToken) (*AnchorPlatformAuthSEP24Token, *AnchorPlatformDepositResponse, error)
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 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 ¶
func (sa *ServerApiIntegrationTests) CreateDisbursement(ctx context.Context, authToken *ServerApiAuthToken, body *httphandler.PostDisbursementRequest) (*data.Disbursement, error)
CreateDisbursement creates a new disbursement using the SDP server API.
func (*ServerApiIntegrationTests) Login ¶
func (sa *ServerApiIntegrationTests) Login(ctx context.Context) (*ServerApiAuthToken, error)
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 }