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, 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) Detect(ctx context.Context, identifier components.Identifier, xPublishableKey string) (*operations.AccountExistsResponse, error)
- func (s *Account) GetDetails(ctx context.Context, xPublishableKey string) (*operations.AccountGetResponse, error)
- func (s *Account) UpdateAddress(ctx context.Context, id string, xPublishableKey string, ...) (*operations.AccountAddressEditResponse, error)
- type BoltPublicAPI
- 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)
- func (s *Guest) Update(ctx context.Context, security operations.GuestPaymentsUpdateSecurity, ...) (*operations.GuestPaymentsUpdateResponse, error)
- type HTTPClient
- type LoggedIn
- func (s *LoggedIn) Initialize(ctx context.Context, xPublishableKey string, ...) (*operations.PaymentsInitializeResponse, error)
- func (s *LoggedIn) PerformAction(ctx context.Context, id string, xPublishableKey string, ...) (*operations.PaymentsActionResponse, error)
- func (s *LoggedIn) Update(ctx context.Context, id string, xPublishableKey string, ...) (*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 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
- type ServerEnvironment
- type Testing
- func (s *Testing) CreateAccount(ctx context.Context, security operations.TestingAccountCreateSecurity, ...) (*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 ΒΆ
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 ΒΆ
func (s *Account) AddAddress(ctx context.Context, xPublishableKey string, addressListing components.AddressListingInput) (*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) (*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 ΒΆ
func (s *Account) DeleteAddress(ctx context.Context, id string, xPublishableKey string) (*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 ΒΆ
func (s *Account) DeletePaymentMethod(ctx context.Context, id string, xPublishableKey string) (*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 ΒΆ
func (s *Account) Detect(ctx context.Context, identifier components.Identifier, xPublishableKey string) (*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 ΒΆ
func (s *Account) GetDetails(ctx context.Context, xPublishableKey string) (*operations.AccountGetResponse, error)
GetDetails - Retrieve account details Retrieve a shopper's account details, such as addresses and payment information
func (*Account) UpdateAddress ΒΆ
func (s *Account) UpdateAddress(ctx context.Context, id string, xPublishableKey string, addressListing components.AddressListingInput) (*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 BoltPublicAPI ΒΆ
type BoltPublicAPI 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 }
BoltPublicAPI - Bolt API Reference: A comprehensive Bolt API reference for interacting with Transactions, Orders, Product Catalog, Configuration, Testing, and much more.
func New ΒΆ
func New(opts ...SDKOption) *BoltPublicAPI
New creates a new instance of the SDK with the provided options
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) (*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 ΒΆ
func (s *Guest) PerformAction(ctx context.Context, security operations.GuestPaymentsActionSecurity, id string, xPublishableKey string, paymentActionRequest components.PaymentActionRequest) (*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 ΒΆ
func (s *Guest) Update(ctx context.Context, security operations.GuestPaymentsUpdateSecurity, id string, xPublishableKey string, paymentUpdateRequest components.PaymentUpdateRequest) (*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 ΒΆ
type LoggedIn struct {
// contains filtered or unexported fields
}
func (*LoggedIn) Initialize ΒΆ
func (s *LoggedIn) Initialize(ctx context.Context, xPublishableKey string, paymentInitializeRequest components.PaymentInitializeRequest) (*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 ΒΆ
func (s *LoggedIn) PerformAction(ctx context.Context, id string, xPublishableKey string, paymentActionRequest components.PaymentActionRequest) (*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 ΒΆ
func (s *LoggedIn) Update(ctx context.Context, id string, xPublishableKey string, paymentUpdateRequest components.PaymentUpdateRequest) (*operations.PaymentsUpdateResponse, error)
Update an existing payment Update a pending payment
type OAuth ΒΆ
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 ΒΆ
func (s *OAuth) GetToken(ctx context.Context, request components.GetAccessTokenRequest) (*operations.OauthGetTokenResponse, error)
GetToken - Get OAuth token Retrieve a new or refresh an existing OAuth token.
type SDKOption ΒΆ
type SDKOption func(*BoltPublicAPI)
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 WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
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
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 - Endpoints that allow you to generate and retrieve test data to verify certain flows in non-production environments.
func (*Testing) CreateAccount ΒΆ
func (s *Testing) CreateAccount(ctx context.Context, security operations.TestingAccountCreateSecurity, xPublishableKey string, accountTestCreationData components.AccountTestCreationData) (*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, 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.