-
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.
- Loading branch information
Showing
4 changed files
with
105 additions
and
105 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,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) | ||
} | ||
} |
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/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) | ||
} | ||
} |
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,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) | ||
} | ||
} |