Documentation
¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func String(s string) *string
- type Account
- func (s *Account) AddAddress(ctx context.Context, request operations.AccountAddressCreateRequest) (*operations.AccountAddressCreateResponse, error)
- func (s *Account) AddPaymentMethod(ctx context.Context, request operations.AccountAddPaymentMethodRequest) (*operations.AccountAddPaymentMethodResponse, error)
- func (s *Account) DeleteAddress(ctx context.Context, request operations.AccountAddressDeleteRequest) (*operations.AccountAddressDeleteResponse, error)
- func (s *Account) DeletePaymentMethod(ctx context.Context, request operations.AccountPaymentMethodDeleteRequest) (*operations.AccountPaymentMethodDeleteResponse, error)
- func (s *Account) Detect(ctx context.Context, request operations.AccountExistsRequest) (*operations.AccountExistsResponse, error)
- func (s *Account) GetDetails(ctx context.Context, request operations.AccountGetRequest) (*operations.AccountGetResponse, error)
- func (s *Account) UpdateAddress(ctx context.Context, request operations.AccountAddressEditRequest) (*operations.AccountAddressEditResponse, error)
- type Guest
- func (s *Guest) Initialize(ctx context.Context, request operations.GuestPaymentsInitializeRequest, ...) (*operations.GuestPaymentsInitializeResponse, error)
- func (s *Guest) PerformAction(ctx context.Context, request operations.GuestPaymentsActionRequest, ...) (*operations.GuestPaymentsActionResponse, error)
- func (s *Guest) Update(ctx context.Context, request operations.GuestPaymentsUpdateRequest, ...) (*operations.GuestPaymentsUpdateResponse, error)
- type HTTPClient
- type LoggedIn
- func (s *LoggedIn) Initialize(ctx context.Context, request operations.PaymentsInitializeRequest) (*operations.PaymentsInitializeResponse, error)
- func (s *LoggedIn) PerformAction(ctx context.Context, request operations.PaymentsActionRequest) (*operations.PaymentsActionResponse, error)
- func (s *LoggedIn) Update(ctx context.Context, request operations.PaymentsUpdateRequest) (*operations.PaymentsUpdateResponse, error)
- type OAuth
- type Payments
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithEnvironment(environment ServerEnvironment) SDKOption
- func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
- func WithSecurity(security shared.Security) SDKOption
- func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- type ServerEnvironment
- type TestBolt
- type Testing
- func (s *Testing) CreateAccount(ctx context.Context, request operations.TestingAccountCreateRequest, ...) (*operations.TestingAccountCreateResponse, error)
- func (s *Testing) GetCreditCard(ctx context.Context, security operations.TestingCreditCardGetSecurity) (*operations.TestingCreditCardGetResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ServerList = []string{
"https://{environment}.bolt.com/v3",
}
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type Account ¶ added in v0.8.0
type Account struct {
// contains filtered or unexported fields
}
Account endpoints allow you to view and manage shoppers' accounts. For example, you can add or remove addresses and payment information.
func (*Account) AddAddress ¶ added in v0.8.0
func (s *Account) AddAddress(ctx context.Context, request operations.AccountAddressCreateRequest) (*operations.AccountAddressCreateResponse, error)
AddAddress - Add an address Add an address to the shopper's account
func (*Account) AddPaymentMethod ¶ added in v0.8.0
func (s *Account) AddPaymentMethod(ctx context.Context, request operations.AccountAddPaymentMethodRequest) (*operations.AccountAddPaymentMethodResponse, error)
AddPaymentMethod - Add a payment method to a shopper's Bolt account Wallet. Add a payment method to a shopper's Bolt account Wallet. For security purposes, this request must come from your backend because authentication requires the use of your private key.<br /> **Note**: Before using this API, the credit card details must be tokenized using Bolt's JavaScript library function, which is documented in [Install the Bolt Tokenizer](https://help.bolt.com/developers/references/bolt-tokenizer).
func (*Account) DeleteAddress ¶ added in v0.8.0
func (s *Account) DeleteAddress(ctx context.Context, request operations.AccountAddressDeleteRequest) (*operations.AccountAddressDeleteResponse, error)
DeleteAddress - Delete an existing address Delete an existing address. Deleting an address does not invalidate transactions or shipments that are associated with it.
func (*Account) DeletePaymentMethod ¶ added in v0.8.0
func (s *Account) DeletePaymentMethod(ctx context.Context, request operations.AccountPaymentMethodDeleteRequest) (*operations.AccountPaymentMethodDeleteResponse, error)
DeletePaymentMethod - Delete an existing payment method Delete an existing payment method. Deleting a payment method does not invalidate transactions or orders that are associated with it.
func (*Account) Detect ¶ added in v0.8.0
func (s *Account) Detect(ctx context.Context, request operations.AccountExistsRequest) (*operations.AccountExistsResponse, error)
Detect - Determine the existence of a Bolt account Determine whether or not an identifier is associated with an existing Bolt account.
func (*Account) GetDetails ¶ added in v0.8.0
func (s *Account) GetDetails(ctx context.Context, request operations.AccountGetRequest) (*operations.AccountGetResponse, error)
GetDetails - Retrieve account details Retrieve a shopper's account details, such as addresses and payment information
func (*Account) UpdateAddress ¶ added in v0.8.0
func (s *Account) UpdateAddress(ctx context.Context, request operations.AccountAddressEditRequest) (*operations.AccountAddressEditResponse, error)
UpdateAddress - Edit an existing address Edit an existing address on the shopper's account. This does not edit addresses that are already associated with other resources, such as transactions or shipments.
type Guest ¶ added in v0.8.0
type Guest struct {
// contains filtered or unexported fields
}
func (*Guest) Initialize ¶ added in v0.8.0
func (s *Guest) Initialize(ctx context.Context, request operations.GuestPaymentsInitializeRequest, security operations.GuestPaymentsInitializeSecurity) (*operations.GuestPaymentsInitializeResponse, error)
Initialize a Bolt payment for guest shoppers Initialize a Bolt payment token that will be used to reference this payment to Bolt when it is updated or finalized for guest shoppers.
func (*Guest) PerformAction ¶ added in v0.8.0
func (s *Guest) PerformAction(ctx context.Context, request operations.GuestPaymentsActionRequest, security operations.GuestPaymentsActionSecurity) (*operations.GuestPaymentsActionResponse, error)
PerformAction - Perform an irreversible action (e.g. finalize) on a pending guest payment Perform an irreversible action on a pending guest payment, such as finalizing it.
func (*Guest) Update ¶ added in v0.8.0
func (s *Guest) Update(ctx context.Context, request operations.GuestPaymentsUpdateRequest, security operations.GuestPaymentsUpdateSecurity) (*operations.GuestPaymentsUpdateResponse, error)
Update an existing guest payment Update a pending guest payment
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type LoggedIn ¶ added in v0.8.0
type LoggedIn struct {
// contains filtered or unexported fields
}
func (*LoggedIn) Initialize ¶ added in v0.8.0
func (s *LoggedIn) Initialize(ctx context.Context, request operations.PaymentsInitializeRequest) (*operations.PaymentsInitializeResponse, error)
Initialize a Bolt payment for logged in shoppers Initialize a Bolt payment token that will be used to reference this payment to Bolt when it is updated or finalized for logged in shoppers.
func (*LoggedIn) PerformAction ¶ added in v0.8.0
func (s *LoggedIn) PerformAction(ctx context.Context, request operations.PaymentsActionRequest) (*operations.PaymentsActionResponse, error)
PerformAction - Perform an irreversible action (e.g. finalize) on a pending payment Perform an irreversible action on a pending payment, such as finalizing it.
func (*LoggedIn) Update ¶ added in v0.8.0
func (s *LoggedIn) Update(ctx context.Context, request operations.PaymentsUpdateRequest) (*operations.PaymentsUpdateResponse, error)
Update an existing payment Update a pending payment
type OAuth ¶ added in v0.8.3
type OAuth struct {
// contains filtered or unexported fields
}
OAuth - Use this endpoint to retrieve an OAuth token. Use the token to allow your ecommerce server to make calls to the Account endpoint and create a one-click checkout experience for shoppers.
https://help.bolt.com/products/accounts/direct-api/oauth-guide/
func (*OAuth) GetToken ¶ added in v0.8.3
func (s *OAuth) GetToken(ctx context.Context, request shared.GetAccessTokenRequest) (*operations.OauthGetTokenResponse, error)
GetToken - Get OAuth token Retrieve a new or refresh an existing OAuth token.
type SDKOption ¶
type SDKOption func(*TestBolt)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithEnvironment ¶
func WithEnvironment(environment ServerEnvironment) SDKOption
WithEnvironment allows setting the environment variable for url substitution
func WithRetryConfig ¶ added in v0.4.0
func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
func WithSecurity ¶ added in v0.6.0
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶ added in v0.6.0
WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithServerIndex ¶
WithServerIndex allows the overriding of the default server by index
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
type ServerEnvironment ¶
type ServerEnvironment string
const ( ServerEnvironmentAPI ServerEnvironment = "api" ServerEnvironmentAPISandbox ServerEnvironment = "api-sandbox" )
func (ServerEnvironment) ToPointer ¶
func (e ServerEnvironment) ToPointer() *ServerEnvironment
func (*ServerEnvironment) UnmarshalJSON ¶
func (e *ServerEnvironment) UnmarshalJSON(data []byte) error
type TestBolt ¶
type TestBolt struct { // Account endpoints allow you to view and manage shoppers' accounts. For example, // you can add or remove addresses and payment information. // Account *Account Payments *Payments // Use this endpoint to retrieve an OAuth token. Use the token to allow your ecommerce server to make calls to the Account // endpoint and create a one-click checkout experience for shoppers. // // // https://help.bolt.com/products/accounts/direct-api/oauth-guide/ OAuth *OAuth // Endpoints that allow you to generate and retrieve test data to verify certain // flows in non-production environments. // Testing *Testing // contains filtered or unexported fields }
TestBolt - Bolt API Reference: A comprehensive Bolt API reference for interacting with Transactions, Orders, Product Catalog, Configuration, Testing, and much more.
type Testing ¶ added in v0.8.0
type Testing struct {
// contains filtered or unexported fields
}
Testing - Endpoints that allow you to generate and retrieve test data to verify certain flows in non-production environments.
func (*Testing) CreateAccount ¶ added in v0.8.0
func (s *Testing) CreateAccount(ctx context.Context, request operations.TestingAccountCreateRequest, security operations.TestingAccountCreateSecurity) (*operations.TestingAccountCreateResponse, error)
CreateAccount - Create a test account Create a Bolt shopper account for testing purposes.
func (*Testing) GetCreditCard ¶ added in v0.8.0
func (s *Testing) GetCreditCard(ctx context.Context, security operations.TestingCreditCardGetSecurity) (*operations.TestingCreditCardGetResponse, error)
GetCreditCard - Retrieve a test credit card, including its token Retrieve test credit card information. This includes its token, which is generated against the `4111 1111 1111 1004` test card.