1 // Your xpub. Funds settle straight to your wallet.
2 import "github.com/exapsy/chainkit/payment"
3
4 pay, _ := payment.New(payment.Config{
5 APIKey: os.Getenv("CHAINKIT_KEY"),
6 ProjectID: os.Getenv("CHAINKIT_PROJECT"),
7 Xpub: os.Getenv("MERCHANT_XPUB"), // xpub only — never a seed
8 })
9
10 // Fiat-priced — chainkit locks the BTC at issuance.
11 inv, _ := pay.CreateInvoice(ctx, payment.InvoiceParams{
12 AmountFiat: payment.EUR(4900), // €49.00
13 Reference: "order-1042",
14 })
15 // inv.Address → a fresh address from your xpub. No reuse.
16
17 // On the webhook — verify the signature, then trust it.
18 ev, err := payment.ParseWebhook(body, sig, secret)
19 if err != nil { return http.StatusUnauthorized }
20 // ev.Invoice.IsFinal ✓ — the sats are already in your wallet.