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 Pointer[T any](v T) *T
- func String(s string) *string
- type Account
- func (s *Account) AddAddress(ctx context.Context, xPublishableKey string, ...) (*operations.AccountAddressCreateResponse, error)
- func (s *Account) AddPaymentMethod(ctx context.Context, xPublishableKey string, ...) (*operations.AccountAddPaymentMethodResponse, error)
- func (s *Account) DeleteAddress(ctx context.Context, id string, xPublishableKey string, ...) (*operations.AccountAddressDeleteResponse, error)
- func (s *Account) DeletePaymentMethod(ctx context.Context, id string, xPublishableKey string, ...) (*operations.AccountPaymentMethodDeleteResponse, error)
- func (s *Account) GetDetails(ctx context.Context, xPublishableKey string, xMerchantClientID *string, ...) (*operations.AccountGetResponse, error)
- func (s *Account) UpdateAddress(ctx context.Context, id string, xPublishableKey string, ...) (*operations.AccountAddressEditResponse, error)
- type BoltSDK
- type Guest
- func (s *Guest) Initialize(ctx context.Context, security operations.GuestPaymentsInitializeSecurity, ...) (*operations.GuestPaymentsInitializeResponse, error)
- func (s *Guest) PerformAction(ctx context.Context, security operations.GuestPaymentsActionSecurity, ...) (*operations.GuestPaymentsActionResponse, error)
- type HTTPClient
- type LoggedIn
- type OAuth
- type Orders
- type Payments
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithEnvironment(environment ServerEnvironment) SDKOption
- func WithRetryConfig(retryConfig retry.Config) SDKOption
- func WithSecurity(security components.Security) SDKOption
- func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- func WithTimeout(timeout time.Duration) SDKOption
- type ServerEnvironment
- type Testing
- func (s *Testing) CreateAccount(ctx context.Context, security operations.TestingAccountCreateSecurity, ...) (*operations.TestingAccountCreateResponse, error)
- func (s *Testing) GetCreditCard(ctx context.Context, request operations.TestingCreditCardGetRequestBody, ...) (*operations.TestingCreditCardGetResponse, error)
- func (s *Testing) TestingAccountPhoneGet(ctx context.Context, security operations.TestingAccountPhoneGetSecurity, ...) (*operations.TestingAccountPhoneGetResponse, 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 ¶
type Account struct {
// contains filtered or unexported fields
}
Account - Use the Accounts API to access shoppers' accounts to empower your checkout and facilitate shoppers' choices.
func (*Account) AddAddress ¶
func (s *Account) AddAddress(ctx context.Context, xPublishableKey string, addressListing components.AddressListingInput, xMerchantClientID *string, opts ...operations.Option) (*operations.AccountAddressCreateResponse, error)
AddAddress - Add an address Add an address to the shopper's account
func (*Account) AddPaymentMethod ¶
func (s *Account) AddPaymentMethod(ctx context.Context, xPublishableKey string, paymentMethod components.PaymentMethodInput, xMerchantClientID *string, opts ...operations.Option) (*operations.AccountAddPaymentMethodResponse, error)
AddPaymentMethod - Add a payment method Add a payment method to a shopper's Bolt Account Wallet. For security purposes, this request must come from your backend. <br/> **Note**: Before using this API, the credit card details must be tokenized by Bolt's credit card tokenization service. Please review our [Bolt Payment Field Component](https://help.bolt.com/products/ignite/api-implementation/#enhance-payments) or [Install the Bolt Tokenizer](https://help.bolt.com/developers/references/bolt-tokenizer) documentation.
func (*Account) DeleteAddress ¶
func (s *Account) DeleteAddress(ctx context.Context, id string, xPublishableKey string, xMerchantClientID *string, opts ...operations.Option) (*operations.AccountAddressDeleteResponse, error)
DeleteAddress - Delete an existing address Delete an existing address. Deleting an address does not invalidate or remove the address from transactions or shipments that are associated with it.
func (*Account) DeletePaymentMethod ¶
func (s *Account) DeletePaymentMethod(ctx context.Context, id string, xPublishableKey string, xMerchantClientID *string, opts ...operations.Option) (*operations.AccountPaymentMethodDeleteResponse, error)
DeletePaymentMethod - Delete an existing payment method Delete an existing payment method. Deleting a payment method does not invalidate or remove it from transactions or orders that are associated with it.
func (*Account) GetDetails ¶
func (s *Account) GetDetails(ctx context.Context, xPublishableKey string, xMerchantClientID *string, opts ...operations.Option) (*operations.AccountGetResponse, error)
GetDetails - Retrieve account details Retrieve a shopper's account details, such as addresses and payment information. The account's details are filtered to be relevant to your merchant account, and some fields may be missing for some accounts. See the schema for details.
func (*Account) UpdateAddress ¶
func (s *Account) UpdateAddress(ctx context.Context, id string, xPublishableKey string, addressListing components.AddressListingInput, xMerchantClientID *string, opts ...operations.Option) (*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 BoltSDK ¶ added in v1.0.1
type BoltSDK struct { // Use the Accounts API to access shoppers' accounts to empower your checkout and facilitate shoppers' choices. Account *Account Payments *Payments // Use the Orders API to create and manage orders, including orders that have been placed outside the Bolt ecosystem. Orders *Orders // Use the OAuth API to enable your ecommerce server to make API calls on behalf of a Bolt logged-in shopper. // // https://help.bolt.com/products/accounts/direct-api/oauth-guide/ OAuth *OAuth // Use the Testing API to generate and retrieve test data to verify a subset of flows in non-production environments. Testing *Testing // contains filtered or unexported fields }
BoltSDK - Bolt API Reference: A comprehensive Bolt API reference for interacting with Accounts, Payments, Orders and more.
type Guest ¶
type Guest struct {
// contains filtered or unexported fields
}
func (*Guest) Initialize ¶
func (s *Guest) Initialize(ctx context.Context, security operations.GuestPaymentsInitializeSecurity, xPublishableKey string, guestPaymentInitializeRequest components.GuestPaymentInitializeRequest, xMerchantClientID *string, opts ...operations.Option) (*operations.GuestPaymentsInitializeResponse, error)
Initialize a Bolt payment for guest shoppers Initialize a Bolt guest shopper's intent to pay for a cart, using the specified payment method. Payments must be finalized before indicating the payment result to the shopper. Some payment methods will finalize automatically after initialization. For these payments, they will transition directly to "finalized" and the response from Initialize Payment will contain a finalized payment.
func (*Guest) PerformAction ¶
func (s *Guest) PerformAction(ctx context.Context, security operations.GuestPaymentsActionSecurity, id string, xPublishableKey string, paymentActionRequest components.PaymentActionRequest, xMerchantClientID *string, opts ...operations.Option) (*operations.GuestPaymentsActionResponse, error)
PerformAction - Finalize a pending guest payment Finalize a pending payment being made by a Bolt guest shopper. Upon receipt of a finalized payment result, payment success should be communicated to the shopper.
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type LoggedIn ¶
type LoggedIn struct {
// contains filtered or unexported fields
}
func (*LoggedIn) Initialize ¶
func (s *LoggedIn) Initialize(ctx context.Context, xPublishableKey string, paymentInitializeRequest components.PaymentInitializeRequest, xMerchantClientID *string, opts ...operations.Option) (*operations.PaymentsInitializeResponse, error)
Initialize a Bolt payment for logged in shoppers Initialize a Bolt logged-in shopper's intent to pay for a cart, using the specified payment method. Payments must be finalized before indicating the payment result to the shopper. Some payment methods will finalize automatically after initialization. For these payments, they will transition directly to "finalized" and the response from Initialize Payment will contain a finalized payment.
func (*LoggedIn) PerformAction ¶
func (s *LoggedIn) PerformAction(ctx context.Context, id string, xPublishableKey string, paymentActionRequest components.PaymentActionRequest, xMerchantClientID *string, opts ...operations.Option) (*operations.PaymentsActionResponse, error)
PerformAction - Finalize a pending payment Finalize a pending payment being made by a Bolt logged-in shopper. Upon receipt of a finalized payment result, payment success should be communicated to the shopper.
type OAuth ¶
type OAuth struct {
// contains filtered or unexported fields
}
OAuth - Use the OAuth API to enable your ecommerce server to make API calls on behalf of a Bolt logged-in shopper.
https://help.bolt.com/products/accounts/direct-api/oauth-guide/
func (*OAuth) GetToken ¶
func (s *OAuth) GetToken(ctx context.Context, tokenRequest components.TokenRequest, xMerchantClientID *string, opts ...operations.Option) (*operations.OauthGetTokenResponse, error)
GetToken - Get OAuth token Retrieve a new or refresh an existing OAuth token.
type Orders ¶
type Orders struct {
// contains filtered or unexported fields
}
Orders - Use the Orders API to create and manage orders, including orders that have been placed outside the Bolt ecosystem.
func (*Orders) OrdersCreate ¶
func (s *Orders) OrdersCreate(ctx context.Context, security operations.OrdersCreateSecurity, xPublishableKey string, order components.Order, xMerchantClientID *string, opts ...operations.Option) (*operations.OrdersCreateResponse, error)
OrdersCreate - Create an order that was prepared outside the Bolt ecosystem. Create an order that was prepared outside the Bolt ecosystem. Some Bolt-powered flows automatically manage order creation - in those flows the order ID will be provided separately and not through this API.
type SDKOption ¶
type SDKOption func(*BoltSDK)
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 ¶
func WithSecurity ¶
func WithSecurity(security components.Security) SDKOption
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶
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
func WithTemplatedServerURL ¶
WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters
func WithTimeout ¶ added in v1.1.0
WithTimeout Optional request timeout applied to each operation
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 Testing ¶
type Testing struct {
// contains filtered or unexported fields
}
Testing - Use the Testing API to generate and retrieve test data to verify a subset of flows in non-production environments.
func (*Testing) CreateAccount ¶
func (s *Testing) CreateAccount(ctx context.Context, security operations.TestingAccountCreateSecurity, xPublishableKey string, accountTestCreationData components.AccountTestCreationData, opts ...operations.Option) (*operations.TestingAccountCreateResponse, error)
CreateAccount - Create a test account Create a Bolt shopper account for testing purposes.
func (*Testing) GetCreditCard ¶
func (s *Testing) GetCreditCard(ctx context.Context, request operations.TestingCreditCardGetRequestBody, security operations.TestingCreditCardGetSecurity, opts ...operations.Option) (*operations.TestingCreditCardGetResponse, error)
GetCreditCard - Retrieve a tokenized test credit card Retrieve a test credit card that can be used to process payments in your Bolt testing environment. The response includes the card's Bolt credit card token.
func (*Testing) TestingAccountPhoneGet ¶ added in v0.4.2
func (s *Testing) TestingAccountPhoneGet(ctx context.Context, security operations.TestingAccountPhoneGetSecurity, xPublishableKey string, opts ...operations.Option) (*operations.TestingAccountPhoneGetResponse, error)
TestingAccountPhoneGet - Get a random phone number Get a random, fictitious phone number that is not assigned to any existing Bolt account.