Advertisement
Guest User

Untitled

a guest
Mar 15th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.60 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     stripe "github.com/stripe/stripe-go"
  6.     "github.com/stripe/stripe-go/webhookendpoint"
  7. )
  8.  
  9. func main() {
  10.     stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
  11.  
  12.     params := &stripe.WebhookEndpointParams{
  13.       URL: stripe.String("https://example.com/my/new/webhook/endpoint"),
  14.     }
  15.     endpoint, err := webhookendpoint.Update("we_1ChdOEJoUivz182DjYJiSX9s", params)
  16.  
  17.     if err != nil {
  18.       if stripeErr, ok := err.(*stripe.Error); ok {
  19.         fmt.Printf("Request ID : %v\n", stripeErr.RequestID)
  20.       }
  21.     }else{
  22.       fmt.Println(endpoint.ID);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement