package main
import(
"context"
gr4vygo "github.com/gr4vy/gr4vy-go"
"os"
"github.com/gr4vy/gr4vy-go/models/components"
"log"
)
func main() {
ctx := context.Background()
privateKey := "...."
withToken := gr4vy.WithToken(privateKey, []JWTScope{ReadAll, WriteAll}, 60)
s := gr4vy.New(
gr4vy.WithID("mattilda"),
gr4vy.WithServer(gr4vy.ServerSandbox),
gr4vy.WithSecuritySource(withToken),
gr4vy.WithMerchantAccountID("default"),
)
res, err := s.PaymentMethods.PaymentServiceTokens.Create(ctx, "ef9496d8-53a5-4aad-8ca2-00eb68334389", components.PaymentServiceTokenCreate{
PaymentServiceID: "fffd152a-9532-4087-9a4f-de58754210f0",
RedirectURL: "https://dual-futon.biz",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}