From 4e9821e9ef35d401353f29aefac77033dc8595bf Mon Sep 17 00:00:00 2001 From: Emre INAL Date: Tue, 20 Jun 2023 19:37:27 +0300 Subject: [PATCH] fix indent --- .editorconfig | 2 +- tests/fraud_test.go | 88 +++++++++++++++++------------------ tests/pay_by_link_test.go | 98 +++++++++++++++++++-------------------- tests/settlement_test.go | 22 ++++----- 4 files changed, 105 insertions(+), 105 deletions(-) diff --git a/.editorconfig b/.editorconfig index 93661e4..b6de60a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] indent_style = space -indent_size = 4 +indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true diff --git a/tests/fraud_test.go b/tests/fraud_test.go index 7145138..86e6b25 100644 --- a/tests/fraud_test.go +++ b/tests/fraud_test.go @@ -1,78 +1,78 @@ package tests import ( - "context" - "github.com/craftgate/craftgate-go-client/adapter" - craftgate "github.com/craftgate/craftgate-go-client/adapter" - "github.com/davecgh/go-spew/spew" - "testing" + "context" + "github.com/craftgate/craftgate-go-client/adapter" + craftgate "github.com/craftgate/craftgate-go-client/adapter" + "github.com/davecgh/go-spew/spew" + "testing" ) var fraudClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") func Test_SearchFraudChecks(t *testing.T) { - request := adapter.SearchFraudChecksRequest{ - Page: 0, Size: 10, - } + request := adapter.SearchFraudChecksRequest{ + Page: 0, Size: 10, + } - res, err := fraudClient.Fraud.SearchFraudChecks(context.Background(), request) - _, _ = spew.Printf("%#v\n", res) + res, err := fraudClient.Fraud.SearchFraudChecks(context.Background(), request) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_RetrieveAllFraudValueList(t *testing.T) { - res, err := fraudClient.Fraud.RetrieveAllFraudValueList(context.Background()) - _, _ = spew.Printf("%#v\n", res) + res, err := fraudClient.Fraud.RetrieveAllFraudValueList(context.Background()) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_RetrieveFraudValueList(t *testing.T) { - res, err := fraudClient.Fraud.RetrieveFraudValueList(context.Background(), "blockedBuyerIdList") - _, _ = spew.Printf("%#v\n", res) + res, err := fraudClient.Fraud.RetrieveFraudValueList(context.Background(), "blockedBuyerIdList") + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_CreateFraudValueList(t *testing.T) { - err := fraudClient.Fraud.CreateFraudValueList(context.Background(), "myTestList") + err := fraudClient.Fraud.CreateFraudValueList(context.Background(), "myTestList") - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_DeleteFraudValueList(t *testing.T) { - err := fraudClient.Fraud.DeleteFraudValueList(context.Background(), "myTestList") + err := fraudClient.Fraud.DeleteFraudValueList(context.Background(), "myTestList") - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_AddValueToFraudValueList(t *testing.T) { - request := adapter.FraudValueListRequest{ - ListName: "ipList", - Value: "999.999.999.999", - } - err := fraudClient.Fraud.AddValueToFraudValueList(context.Background(), request) - - if err != nil { - t.Errorf("Error %s", err) - } + request := adapter.FraudValueListRequest{ + ListName: "ipList", + Value: "999.999.999.999", + } + err := fraudClient.Fraud.AddValueToFraudValueList(context.Background(), request) + + if err != nil { + t.Errorf("Error %s", err) + } } func Test_RemoveValueFromFraudValueList(t *testing.T) { - err := fraudClient.Fraud.RemoveValueFromFraudValueList(context.Background(), "ipList", "999.999.999.999") + err := fraudClient.Fraud.RemoveValueFromFraudValueList(context.Background(), "ipList", "999.999.999.999") - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } diff --git a/tests/pay_by_link_test.go b/tests/pay_by_link_test.go index 6c8f307..7b84d89 100644 --- a/tests/pay_by_link_test.go +++ b/tests/pay_by_link_test.go @@ -1,78 +1,78 @@ package tests import ( - "context" - "github.com/craftgate/craftgate-go-client/adapter" - craftgate "github.com/craftgate/craftgate-go-client/adapter" - "github.com/davecgh/go-spew/spew" - "testing" + "context" + "github.com/craftgate/craftgate-go-client/adapter" + craftgate "github.com/craftgate/craftgate-go-client/adapter" + "github.com/davecgh/go-spew/spew" + "testing" ) var payByLinkClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") func Test_CreateProduct(t *testing.T) { - request := adapter.CreateProductRequest{ - Name: "A new Product", - Channel: "API", - Price: 10, - Currency: craftgate.Currency_TRY, - EnabledInstallments: []int{1, 2, 3, 6}, - } + request := adapter.CreateProductRequest{ + Name: "A new Product", + Channel: "API", + Price: 10, + Currency: craftgate.Currency_TRY, + EnabledInstallments: []int{1, 2, 3, 6}, + } - res, err := payByLinkClient.PayByLink.CreateProduct(context.Background(), request) - _, _ = spew.Printf("%#v\n", res) + res, err := payByLinkClient.PayByLink.CreateProduct(context.Background(), request) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_UpdateProduct(t *testing.T) { - request := adapter.UpdateProductRequest{ - Name: "A new Product", - Status: craftgate.Status_ACTIVE, - Channel: "API", - Price: 10, - Currency: craftgate.Currency_TRY, - EnabledInstallments: []int{1, 2, 3, 6, 9}, - } + request := adapter.UpdateProductRequest{ + Name: "A new Product", + Status: craftgate.Status_ACTIVE, + Channel: "API", + Price: 10, + Currency: craftgate.Currency_TRY, + EnabledInstallments: []int{1, 2, 3, 6, 9}, + } - res, err := payByLinkClient.PayByLink.UpdateProduct(context.Background(), 1, request) - _, _ = spew.Printf("%#v\n", res) + res, err := payByLinkClient.PayByLink.UpdateProduct(context.Background(), 1, request) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_RetrieveProduct(t *testing.T) { - res, err := payByLinkClient.PayByLink.RetrieveProduct(context.Background(), 1) - _, _ = spew.Printf("%#v\n", res) + res, err := payByLinkClient.PayByLink.RetrieveProduct(context.Background(), 1) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_DeleteProduct(t *testing.T) { - err := payByLinkClient.PayByLink.DeleteProduct(context.Background(), 1) + err := payByLinkClient.PayByLink.DeleteProduct(context.Background(), 1) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } func Test_SearchProducts(t *testing.T) { - request := adapter.SearchProductsRequest{ - Page: 0, - Size: 10, - Currency: craftgate.Currency_TRY, - } + request := adapter.SearchProductsRequest{ + Page: 0, + Size: 10, + Currency: craftgate.Currency_TRY, + } - res, err := payByLinkClient.PayByLink.SearchProducts(context.Background(), request) - _, _ = spew.Printf("%#v\n", res) + res, err := payByLinkClient.PayByLink.SearchProducts(context.Background(), request) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } } diff --git a/tests/settlement_test.go b/tests/settlement_test.go index 36608dc..1c130d3 100644 --- a/tests/settlement_test.go +++ b/tests/settlement_test.go @@ -1,22 +1,22 @@ package tests import ( - "context" - "github.com/craftgate/craftgate-go-client/adapter" - craftgate "github.com/craftgate/craftgate-go-client/adapter" - "github.com/davecgh/go-spew/spew" - "testing" + "context" + "github.com/craftgate/craftgate-go-client/adapter" + craftgate "github.com/craftgate/craftgate-go-client/adapter" + "github.com/davecgh/go-spew/spew" + "testing" ) var settlementClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") func TestSettlement_CreateInstantWalletSettlement(t *testing.T) { - request := adapter.CreateInstantWalletSettlementRequest{ExcludedSubMerchantMemberIds: []int64{1, 2}} + request := adapter.CreateInstantWalletSettlementRequest{ExcludedSubMerchantMemberIds: []int64{1, 2}} - res, err := settlementClient.Settlement.CreateInstantWalletSettlement(context.Background(), request) - _, _ = spew.Printf("%#v\n", res) + res, err := settlementClient.Settlement.CreateInstantWalletSettlement(context.Background(), request) + _, _ = spew.Printf("%#v\n", res) - if err != nil { - t.Errorf("Error %s", err) - } + if err != nil { + t.Errorf("Error %s", err) + } }