Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b2a246f
feat: add wallet address initial snippets
BlairCurrey Dec 4, 2025
be4cddd
chore: formatting
BlairCurrey Dec 4, 2025
070a91a
feat: add token, wa info go sdk examples
BlairCurrey Dec 14, 2025
2a4835a
feat: add more sdk examples, go back and make previous consistent
BlairCurrey Dec 14, 2025
c0f4414
feat: add grant sdk examples
BlairCurrey Dec 14, 2025
514ce00
feat: add incoming payment examples
BlairCurrey Dec 14, 2025
65366ea
feat: add op go sdk examples
BlairCurrey Dec 14, 2025
cf637a5
feat: add quote examples to go sdk
BlairCurrey Dec 14, 2025
466470a
feat: fight prettier, add guide
BlairCurrey Dec 14, 2025
e1be9cf
feat: fight prettier, add guide
BlairCurrey Dec 14, 2025
d61d69c
feat: fight prettier, add guide
BlairCurrey Dec 15, 2025
b5e06a9
feat: fight prettier, add guide
BlairCurrey Dec 15, 2025
57ee230
feat: fight prettier, add guide
BlairCurrey Dec 15, 2025
7e22e43
feat: add guide
BlairCurrey Dec 15, 2025
1a3af11
feat: add guide
BlairCurrey Dec 15, 2025
35f7446
feat: add guide, fix missing interact ref in previous
BlairCurrey Dec 15, 2025
fef2763
Merge branch 'main' into blair/gol-16
BlairCurrey Dec 16, 2025
ee04ceb
chore: fight prettier, format
BlairCurrey Dec 16, 2025
2e465af
chore: rm go stuff from chunked snippet
BlairCurrey Dec 16, 2025
a8e6c4f
chore: rm prettier ignore
BlairCurrey Dec 16, 2025
915c72a
chore: fix extra backticks
BlairCurrey Dec 16, 2025
c581fe3
fix: formatting
BlairCurrey Dec 16, 2025
de15589
Update docs/src/content/docs/sdk/incoming-create.mdx
BlairCurrey Jan 5, 2026
0a9a684
Update docs/src/content/docs/sdk/incoming-create.mdx
BlairCurrey Jan 5, 2026
af4ed0c
chore: format
BlairCurrey Jan 5, 2026
8638ec3
docs: add es guide
BlairCurrey Jan 7, 2026
f889a1c
docs: add es guide
BlairCurrey Jan 7, 2026
cdc4a5f
docs: add es guide, fix en format
BlairCurrey Jan 7, 2026
0cb5634
docs: add es guide
BlairCurrey Jan 7, 2026
d6b0cd2
docs: add es guide
BlairCurrey Jan 7, 2026
2812c4a
docs: add es guide
BlairCurrey Jan 7, 2026
d78b91c
docs: add es guide
BlairCurrey Jan 7, 2026
ed89da3
docs: add es guide
BlairCurrey Jan 7, 2026
c4da92f
chore: pr feedback (formatting, revert submodule update)
BlairCurrey Jan 7, 2026
0aa6f8c
Update docs/src/content/docs/guides/split-payments.mdx
BlairCurrey Jan 9, 2026
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
7 changes: 6 additions & 1 deletion docs/src/components/ChunkedSnippet.astro
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ const languageConfig: Record<string, LanguageConfig> = {
parser: '',
lang: 'rs',
plugins: []
},
'.go': {
parser: '',
lang: 'go',
plugins: []
}
}

Expand Down Expand Up @@ -151,7 +156,7 @@ const formatByLanguage = async (
})
return formatted.replace(/^<\?php\s*/, '')
}
if (lang === 'rs') {
if (lang === 'rs' || lang === 'go') {
return dedentBlock(text)
}
if (parser) {
Expand Down
203 changes: 203 additions & 0 deletions docs/src/content/docs/guides/accept-otp-online-purchase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ Call the <Badge text="GET" variant="note" /> [Get Wallet Address API](/apis/wall
```

</TabItem>
<TabItem label='Go' icon='seti:go'>

```go wrap
customerWalletAddress, err := client.WalletAddress.Get(context.TODO(), op.WalletAddressGetParams{
URL: "https://cloudninebank.example.com/customer",
})
if err != nil {
log.Fatalf("Error fetching customer wallet address: %v\n", err)
}

retailerWalletAddress, err := client.WalletAddress.Get(context.TODO(), op.WalletAddressGetParams{
URL: "https://happylifebank.example.com/retailer",
})
if err != nil {
log.Fatalf("Error fetching retailer wallet address: %v\n", err)
}

```

</TabItem>
</Tabs>

<details>
Expand Down Expand Up @@ -147,6 +167,34 @@ let retailer_incoming_payment_grant = client

```

</TabItem>

<TabItem label='Go' icon='seti:go'>

```go wrap
incomingAccess := as.AccessIncoming{
Type: as.IncomingPayment,
Actions: []as.AccessIncomingActions{as.AccessIncomingActionsCreate},
}
accessItem := as.AccessItem{}
if err := accessItem.FromAccessIncoming(incomingAccess); err != nil {
log.Fatalf("Error creating AccessItem: %v\n", err)
}
accessToken := struct {
Access as.Access `json:"access"`
}{
Access: []as.AccessItem{accessItem},
}

retailerIncomingPaymentGrant, err := client.Grant.Request(context.TODO(), op.GrantRequestParams{
URL: *retailerWalletAddress.AuthServer,
RequestBody: as.GrantRequestWithAccessToken{AccessToken: accessToken},
})
if err != nil {
log.Fatalf("Error requesting incoming payment grant: %v\n", err)
}
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -229,6 +277,27 @@ Some(&retailer_incoming_payment_grant.access_token.value),

```

</TabItem>

<TabItem label='Go' icon='seti:go'>
```go wrap
incomingPayment, err := client.IncomingPayment.Create(context.TODO(), op.IncomingPaymentCreateParams{
BaseURL: *retailerWalletAddress.ResourceServer,
AccessToken: retailerIncomingPaymentGrant.AccessToken.Value,
Payload: rs.CreateIncomingPaymentJSONBody{
WalletAddressSchema: *retailerWalletAddress.Id,
IncomingAmount: &rs.Amount{
Value: "140000",
AssetCode: "MXN",
AssetScale: 2,
},
},
})
if err != nil {
log.Fatalf("Error creating incoming payment: %v\n", err)
}
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -309,6 +378,35 @@ let customer_quote_grant = client
```

</TabItem>

<TabItem label='Go' icon='seti:go'>

```go wrap
quoteAccess := as.AccessQuote{
Type: as.Quote,
Actions: []as.AccessQuoteActions{as.Create},
}
quoteAccessItem := as.AccessItem{}
if err := quoteAccessItem.FromAccessQuote(quoteAccess); err != nil {
log.Fatalf("Error creating AccessItem: %v\n", err)
}
quoteAccessToken := struct {
Access as.Access `json:"access"`
}{
Access: []as.AccessItem{quoteAccessItem},
}

customerQuoteGrant, err := client.Grant.Request(context.TODO(), op.GrantRequestParams{
URL: *customerWalletAddress.AuthServer,
RequestBody: as.GrantRequestWithAccessToken{AccessToken: quoteAccessToken},
})
if err != nil {
log.Fatalf("Error requesting quote grant: %v\n", err)
}
```

</TabItem>

</Tabs>

<details>
Expand Down Expand Up @@ -389,6 +487,26 @@ Some(&customer_quote_grant.access_token.value),
```

</TabItem>

<TabItem label='Go' icon='seti:go'>

```go wrap
customerQuote, err := client.Quote.Create(context.TODO(), op.QuoteCreateParams{
BaseURL: *customerWalletAddress.ResourceServer,
AccessToken: customerQuoteGrant.AccessToken.Value,
Payload: rs.CreateQuoteJSONBody0{
WalletAddressSchema: *customerWalletAddress.Id,
Receiver: *incomingPayment.Id,
Method: "ilp",
},
})
if err != nil {
log.Fatalf("Error creating quote: %v\n", err)
}
```

</TabItem>

</Tabs>

The response returns a `receiveAmount`, a `debitAmount`, and other required information.
Expand Down Expand Up @@ -503,6 +621,54 @@ let pending_customer_outgoing_payment_grant = client
```

</TabItem>
<TabItem label='Go' icon='seti:go'>

```go wrap
outgoingAccess := as.AccessOutgoing{
Type: as.OutgoingPayment,
Actions: []as.AccessOutgoingActions{as.AccessOutgoingActionsCreate},
Identifier: *customerWalletAddress.Id,
Limits: &as.LimitsOutgoing{
DebitAmount: &as.Amount{
Value: "140000",
AssetCode: "MXN",
AssetScale: 2,
},
},
}
outgoingAccessItem := as.AccessItem{}
if err := outgoingAccessItem.FromAccessOutgoing(outgoingAccess); err != nil {
log.Fatalf("Error creating AccessItem: %v\n", err)
}
outgoingAccessToken := struct {
Access as.Access `json:"access"`
}{
Access: []as.AccessItem{outgoingAccessItem},
}
interact := &as.InteractRequest{
Start: []as.InteractRequestStart{as.InteractRequestStartRedirect},
Finish: &as.InteractRequestFinish{
Method: as.Redirect,
Uri: "https://paymentplatform.example/finish/{...}",
Nonce: NONCE,
},
}

pendingCustomerOutgoingPaymentGrant, err := client.Grant.Request(context.TODO(), op.GrantRequestParams{
URL: *customerWalletAddress.AuthServer,
RequestBody: as.GrantRequestWithAccessToken{
AccessToken: outgoingAccessToken,
Interact: interact,
},
})

if err != nil {
log.Fatalf("Error requesting outgoing payment grant: %v\n", err)
}
```

</TabItem>

</Tabs>

<details>
Expand Down Expand Up @@ -587,6 +753,21 @@ Some(&continue_field.access_token.value),

```

</TabItem>

<TabItem label='Go' icon='seti:go'>

```go wrap
customerOutgoingPaymentGrant, err := client.Grant.Continue(context.TODO(), op.GrantContinueParams{
URL: pendingCustomerOutgoingPaymentGrant.Continue.Uri,
AccessToken: pendingCustomerOutgoingPaymentGrant.Continue.AccessToken.Value,
InteractRef: INTERACT_REF,
})
if err != nil {
log.Fatalf("Error continuing grant: %v\n", err)
}
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -664,6 +845,28 @@ let customer_outgoing_payment_to_retailer = client
```

</TabItem>
<TabItem label='Go' icon='seti:go'>

```go
var outgoingPayload rs.CreateOutgoingPaymentRequest
if err := outgoingPayload.FromCreateOutgoingPaymentWithQuote(rs.CreateOutgoingPaymentWithQuote{
WalletAddressSchema: *customerWalletAddress.Id,
QuoteId: *customerQuote.Id,
}); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}); err != nil {
}); if err != nil {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happens in a few guides other guides, just needs a find+replace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}); if err != nil { is a syntax error: syntax error: unexpected keyword if, expected expression

can check out this example: https://go.dev/play/p/BPjtuPgQ-AO. If you replace it with the original }); err != nil { you should see that it works.

So I think it's fine as-is but to keep with your direction, it could be un-compacted a bit to this:

	err := outgoingPayload.FromCreateOutgoingPaymentWithQuote(
		CreateOutgoingPaymentWithQuote{
			WalletAddressSchema: *customerWalletAddress.Id,
			QuoteId:             *customerQuote.Id,
		},
	)
	if err != nil {
		log.Fatalf("Error creating payload: %v\n", err)
	}

log.Fatalf("Error creating payload: %v\n", err)
}

customerOutgoingPayment, err := client.OutgoingPayment.Create(context.TODO(), op.OutgoingPaymentCreateParams{
BaseURL: customerWalletAddress.ResourceServer,
AccessToken: customerOutgoingPaymentGrant.AccessToken.Value,
Payload: outgoingPayload
})
if err != nil {
log.Fatalf("Error creating outgoing payment: %v\n", err)
}
```

</TabItem>
</Tabs>

If the request fails because of an expired quote, [request a new quote](#5-request-the-creation-of-a-quote-resource) and try again.
Expand Down
Loading