diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a579a43..97d8dbb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.99.0" + ".": "0.100.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a81446f..e638214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.100.0](https://github.com/kernel/kernel-go-sdk/compare/v0.99.0...v0.100.0) (2026-09-04) + + +### Features + +* Fix vault provider errors and remove test card mode ([6ec0643](https://github.com/kernel/kernel-go-sdk/commit/6ec0643c8bd44f8f615c5789760ed4b3d1071c0d)) + ## [0.99.0](https://github.com/kernel/kernel-go-sdk/compare/v0.98.0...v0.99.0) (2026-09-04) diff --git a/README.md b/README.md index 7ab6c34..b0b6d3f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/kernel-go-sdk@v0.99.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.100.0' ``` diff --git a/internal/version.go b/internal/version.go index 44a2a34..a098352 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.99.0" // x-release-please-version +const PackageVersion = "0.100.0" // x-release-please-version diff --git a/vaultitem.go b/vaultitem.go index b04de25..41cde71 100644 --- a/vaultitem.go +++ b/vaultitem.go @@ -123,7 +123,9 @@ func (r *VaultItemService) Events(ctx context.Context, key string, params VaultI // Retrieve the item first and invoke only an operation listed in // `available_operations`, following its natural-language description. Operations -// may call an external provider and can return the item's updated state. +// may call an external provider and can return the item's updated state. If the +// provider rate limits spend-request creation, returns HTTP 429 with code +// `spend_request_rate_limited`; stop and back off before retrying. func (r *VaultItemService) PerformOperation(ctx context.Context, key string, params VaultItemPerformOperationParams, opts ...option.RequestOption) (res *VaultItemUnion, err error) { opts = slices.Concat(r.Options, opts) if params.IDOrName == "" { @@ -267,9 +269,7 @@ type CardVaultItemSpecUnion struct { PaymentMethodID string `json:"payment_method_id"` // Any of "link", "agentcard". Provider string `json:"provider"` - // This field is from variant [CardVaultItemSpecLink]. - Test bool `json:"test"` - Wallet string `json:"wallet"` + Wallet string `json:"wallet"` // This field is from variant [CardVaultItemSpecLink]. ExpiresAt int64 `json:"expires_at"` // This field is from variant [CardVaultItemSpecLink]. @@ -290,7 +290,6 @@ type CardVaultItemSpecUnion struct { MerchantURL respjson.Field PaymentMethodID respjson.Field Provider respjson.Field - Test respjson.Field Wallet respjson.Field ExpiresAt respjson.Field LineItems respjson.Field @@ -355,6 +354,7 @@ func (r CardVaultItemSpecUnion) ToParam() CardVaultItemSpecUnionParam { return param.Override[CardVaultItemSpecUnionParam](json.RawMessage(r.RawJSON())) } +// Live payment card. Test-mode card creation is not supported. type CardVaultItemSpecLink struct { // Integer amount in minor currency units. Amount int64 `json:"amount" api:"required"` @@ -367,9 +367,6 @@ type CardVaultItemSpecLink struct { // request. PaymentMethodID string `json:"payment_method_id" api:"required"` Provider constant.Link `json:"provider" default:"link"` - // Whether Link should return test credentials instead of a live payment - // credential. - Test bool `json:"test" api:"required"` // Wallet item key used to mint this card. Wallet string `json:"wallet" api:"required"` ExpiresAt int64 `json:"expires_at"` @@ -385,7 +382,6 @@ type CardVaultItemSpecLink struct { MerchantURL respjson.Field PaymentMethodID respjson.Field Provider respjson.Field - Test respjson.Field Wallet respjson.Field ExpiresAt respjson.Field LineItems respjson.Field @@ -477,8 +473,9 @@ func (r *CardVaultItemSpecLinkTotal) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// AgentCard reusable card. Each checkout creates an approval-gated authorization -// for spec.merchant / spec.amount. The card stays ready after each authorization. +// AgentCard reusable live payment card. Test-mode card creation is not supported. +// Each checkout creates an approval-gated authorization for spec.merchant / +// spec.amount. The card stays ready after each authorization. type CardVaultItemSpecAgentcard struct { // Integer amount in minor currency units. Amount int64 `json:"amount" api:"required"` @@ -567,14 +564,6 @@ func (u CardVaultItemSpecUnionParam) GetPaymentMethodID() *string { return nil } -// Returns a pointer to the underlying variant's property, if present. -func (u CardVaultItemSpecUnionParam) GetTest() *bool { - if vt := u.OfLink; vt != nil { - return &vt.Test - } - return nil -} - // Returns a pointer to the underlying variant's property, if present. func (u CardVaultItemSpecUnionParam) GetExpiresAt() *int64 { if vt := u.OfLink; vt != nil && vt.ExpiresAt.Valid() { @@ -671,8 +660,10 @@ func init() { ) } +// Live payment card. Test-mode card creation is not supported. +// // The properties Amount, Context, Currency, MerchantName, MerchantURL, -// PaymentMethodID, Provider, Test, Wallet are required. +// PaymentMethodID, Provider, Wallet are required. type CardVaultItemSpecLinkParam struct { // Integer amount in minor currency units. Amount int64 `json:"amount" api:"required"` @@ -684,9 +675,6 @@ type CardVaultItemSpecLinkParam struct { // The provider decides whether the selected funding method can satisfy the card // request. PaymentMethodID string `json:"payment_method_id" api:"required"` - // Whether Link should return test credentials instead of a live payment - // credential. - Test bool `json:"test" api:"required"` // Wallet item key used to mint this card. Wallet string `json:"wallet" api:"required"` ExpiresAt param.Opt[int64] `json:"expires_at,omitzero"` @@ -763,8 +751,9 @@ func (r *CardVaultItemSpecLinkTotalParam) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// AgentCard reusable card. Each checkout creates an approval-gated authorization -// for spec.merchant / spec.amount. The card stays ready after each authorization. +// AgentCard reusable live payment card. Test-mode card creation is not supported. +// Each checkout creates an approval-gated authorization for spec.merchant / +// spec.amount. The card stays ready after each authorization. // // The properties Amount, Currency, Merchant, Provider, Wallet are required. type CardVaultItemSpecAgentcardParam struct { @@ -1172,9 +1161,7 @@ type VaultItemUnionSpec struct { MerchantURL string `json:"merchant_url"` // This field is from variant [CardVaultItemSpecUnion]. PaymentMethodID string `json:"payment_method_id"` - // This field is from variant [CardVaultItemSpecUnion]. - Test bool `json:"test"` - Wallet string `json:"wallet"` + Wallet string `json:"wallet"` // This field is from variant [CardVaultItemSpecUnion]. ExpiresAt int64 `json:"expires_at"` // This field is from variant [CardVaultItemSpecUnion]. @@ -1197,7 +1184,6 @@ type VaultItemUnionSpec struct { MerchantName respjson.Field MerchantURL respjson.Field PaymentMethodID respjson.Field - Test respjson.Field Wallet respjson.Field ExpiresAt respjson.Field LineItems respjson.Field @@ -1380,8 +1366,7 @@ type VaultItemCard struct { CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"` // Immutable item key assigned when the item is created. Key string `json:"key" api:"required"` - // AgentCard reusable card. Each checkout creates an approval-gated authorization - // for spec.merchant / spec.amount. The card stays ready after each authorization. + // Live payment card. Test-mode card creation is not supported. Spec CardVaultItemSpecUnion `json:"spec" api:"required"` State CardVaultItemStateUnion `json:"state" api:"required"` Type constant.Card `json:"type" default:"card"` @@ -2222,8 +2207,7 @@ func (r VaultItemGetParams) URLQuery() (v url.Values, err error) { type VaultItemUpdateParams struct { IDOrName string `path:"id_or_name" api:"required" json:"-"` - // AgentCard reusable card. Each checkout creates an approval-gated authorization - // for spec.merchant / spec.amount. The card stays ready after each authorization. + // Live payment card. Test-mode card creation is not supported. Spec CardVaultItemSpecUnionParam `json:"spec,omitzero" api:"required"` paramObj } @@ -2322,8 +2306,7 @@ func (r *VaultItemUpsertParamsBodyWallet) UnmarshalJSON(data []byte) error { // The properties Spec, Type are required. type VaultItemUpsertParamsBodyCard struct { - // AgentCard reusable card. Each checkout creates an approval-gated authorization - // for spec.merchant / spec.amount. The card stays ready after each authorization. + // Live payment card. Test-mode card creation is not supported. Spec CardVaultItemSpecUnionParam `json:"spec,omitzero" api:"required"` // This field can be elided, and will marshal its zero value as "card". Type constant.Card `json:"type" default:"card"` diff --git a/vaultitem_test.go b/vaultitem_test.go index e337855..f8d72e7 100644 --- a/vaultitem_test.go +++ b/vaultitem_test.go @@ -70,7 +70,6 @@ func TestVaultItemUpdateWithOptionalParams(t *testing.T) { MerchantName: "x", MerchantURL: "https://example.com", PaymentMethodID: "x", - Test: true, Wallet: "wallet", ExpiresAt: kernel.Int(0), LineItems: []kernel.CardVaultItemSpecLinkLineItemParam{{