-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes module name and creating tag for versioning
- Loading branch information
Alican Akkus
committed
Dec 2, 2022
1 parent
53ef5db
commit 5ae6999
Showing
14 changed files
with
901 additions
and
891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/craftgate/craftgate-go-client/v1.0.0 | ||
module github.com/craftgate/craftgate-go-client | ||
|
||
go 1.19 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
package tests | ||
|
||
import ( | ||
"context" | ||
"github.com/craftgate/craftgate-go-client/v1.0.0/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/v1.0.0/adapter" | ||
"github.com/davecgh/go-spew/spew" | ||
"testing" | ||
"time" | ||
"context" | ||
"github.com/craftgate/craftgate-go-client/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/adapter" | ||
"github.com/davecgh/go-spew/spew" | ||
"testing" | ||
"time" | ||
) | ||
|
||
var fileReportingClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") | ||
|
||
func TestFileReporting_RetrieveDailyTransactionReport(t *testing.T) { | ||
request := adapter.RetrieveDailyTransactionReportRequest{ | ||
ReportDate: craftgate.DateOf(time.Date(2022, 11, 11, 0, 0, 0, 0, time.UTC)), | ||
FileType: craftgate.CSV, | ||
} | ||
request := adapter.RetrieveDailyTransactionReportRequest{ | ||
ReportDate: craftgate.DateOf(time.Date(2022, 11, 11, 0, 0, 0, 0, time.UTC)), | ||
FileType: craftgate.CSV, | ||
} | ||
|
||
res, err := fileReportingClient.FileReporting.RetrieveDailyTransactionReport(context.Background(), request) | ||
_, _ = spew.Printf("%#v\n", res) | ||
res, err := fileReportingClient.FileReporting.RetrieveDailyTransactionReport(context.Background(), request) | ||
_, _ = spew.Printf("%#v\n", res) | ||
|
||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
package tests | ||
|
||
import ( | ||
"context" | ||
"github.com/craftgate/craftgate-go-client/v1.0.0/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/v1.0.0/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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
package tests | ||
|
||
import ( | ||
"context" | ||
"github.com/craftgate/craftgate-go-client/v1.0.0/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/v1.0.0/adapter" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
"context" | ||
"github.com/craftgate/craftgate-go-client/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/adapter" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
var installmentClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") | ||
|
||
func Test_RetrieveBinNumber(t *testing.T) { | ||
res, err := installmentClient.Installment.RetrieveBinNumber(context.Background(), "487074") | ||
res, err := installmentClient.Installment.RetrieveBinNumber(context.Background(), "487074") | ||
|
||
require.Equal(t, *res.BinNumber, "487074") | ||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
require.Equal(t, *res.BinNumber, "487074") | ||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
} | ||
|
||
func Test_SearchInstallments(t *testing.T) { | ||
request := adapter.SearchInstallmentsRequest{ | ||
BinNumber: "487074", | ||
Price: 100, | ||
Currency: craftgate.Currency(craftgate.TRY), | ||
} | ||
res, err := installmentClient.Installment.SearchInstallments(context.Background(), request) | ||
request := adapter.SearchInstallmentsRequest{ | ||
BinNumber: "487074", | ||
Price: 100, | ||
Currency: craftgate.Currency(craftgate.TRY), | ||
} | ||
res, err := installmentClient.Installment.SearchInstallments(context.Background(), request) | ||
|
||
require.Equal(t, *res.Items[0].BinNumber, "487074") | ||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
require.Equal(t, *res.Items[0].BinNumber, "487074") | ||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
} |
Oops, something went wrong.