Add snippets

This commit is contained in:
Roei Erez
2023-12-14 09:46:58 +02:00
parent 31483fb54e
commit 05f18fe1df
10 changed files with 259 additions and 2 deletions

21
snippets/go/webhook.go Normal file
View File

@@ -0,0 +1,21 @@
package example
import (
"log"
)
func Webhook() {
// ANCHOR: register-webook
if err := sdk.RegisterWebhook("https://yourapplication.com"); err != nil {
log.Printf("Webhook registration failed: %v", err)
}
// ANCHOR_END: register-webook
}
func PaymentWebhook() {
// ANCHOR: register-payment-webook
if err := sdk.RegisterWebhook("https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>"); err != nil {
log.Printf("Webhook registration failed: %v", err)
}
// ANCHOR_END: register-payment-webook
}