Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.99.0"
".": "0.100.0"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Or to pin the version:
<!-- x-release-please-start-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'
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.99.0" // x-release-please-version
const PackageVersion = "0.100.0" // x-release-please-version
53 changes: 18 additions & 35 deletions vaultitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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].
Expand All @@ -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
Expand Down Expand Up @@ -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"`
Expand All @@ -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"`
Expand All @@ -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
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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].
Expand All @@ -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
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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"`
Expand Down
1 change: 0 additions & 1 deletion vaultitem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{{
Expand Down
Loading