fix: remove dead GenerateRefreshToken calls (tokens never consumed)

This commit is contained in:
2026-07-10 20:52:47 +01:00
parent a4a80246d1
commit 50ce98d729
4 changed files with 17 additions and 122 deletions
@@ -1,91 +0,0 @@
//go:build test && dev
package square
import (
"context"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestDevProdClient_CreatePayment(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.CreatePayment(context.Background(), CreatePaymentReq{})
assert.Error(t, err)
}
func TestDevProdClient_CreateCheckout(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.CreateCheckout(context.Background(), CreateCheckoutReq{})
assert.Error(t, err)
}
func TestDevProdClient_GetCheckout(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.GetCheckout(context.Background(), "")
assert.Error(t, err)
}
func TestDevProdClient_RefundPayment(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.RefundPayment(context.Background(), RefundPaymentReq{})
assert.Error(t, err)
}
func TestDevProdClient_CreateCardOnFile(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.CreateCardOnFile(context.Background(), "", "")
assert.Error(t, err)
}
func TestDevProdClient_CreateCardOnFileRaw(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.CreateCardOnFileRaw(context.Background(), "", "", 0, 0, "")
assert.Error(t, err)
}
func TestDevProdClient_GetCardsOnFile(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
_, err := client.GetCardsOnFile(context.Background(), "")
assert.Error(t, err)
}
func TestDevProdClient_DeleteCardOnFile(t *testing.T) {
saved := os.Getenv("SQUARE_ENVIRONMENT")
os.Setenv("SQUARE_ENVIRONMENT", "sandbox")
defer os.Setenv("SQUARE_ENVIRONMENT", saved)
client := NewDevClient()
err := client.DeleteCardOnFile(context.Background(), "")
assert.Error(t, err)
}