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) GetDetails(ctx context.Context, xPublishableKey string) (*operations.AccountGetResponse, error)
- func (s *Account) UpdateAddress(ctx context.Context, id string, xPublishableKey string, ...) (*operations.AccountAddressEditResponse, error)
- type BoltTypescriptSDK
- 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 Orders
- 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, 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 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) 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 BoltTypescriptSDK ¶
type BoltTypescriptSDK 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 // Use the Orders API to create and manage orders, including orders that have been placed outside the Bolt ecosystem. // Orders *Orders // 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 }
BoltTypescriptSDK - 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) *BoltTypescriptSDK
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.TokenRequest) (*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) (*operations.OrdersCreateResponse, error)
OrdersCreate - Create an order that was placed outside the Bolt ecosystem. Create an order that was placed outside the Bolt ecosystem.
type SDKOption ¶
type SDKOption func(*BoltTypescriptSDK)
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, request operations.TestingCreditCardGetRequestBody, 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 can be used to process payments.
func (*Testing) TestingAccountPhoneGet ¶ added in v0.4.2
func (s *Testing) TestingAccountPhoneGet(ctx context.Context, security operations.TestingAccountPhoneGetSecurity, xPublishableKey string) (*operations.TestingAccountPhoneGetResponse, error)
TestingAccountPhoneGet - Get a random phone number Get a random, fictitious phone number that is not assigned to any existing account.