//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) }