-
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.
Merge branch 'master' into bkm-express-integration
- Loading branch information
Showing
11 changed files
with
422 additions
and
107 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package tests | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/craftgate/craftgate-go-client/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/adapter" | ||
"github.com/davecgh/go-spew/spew" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
var instantTransferPaymentClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") | ||
|
||
func TestRetrieveActiveBanks(t *testing.T) { | ||
res, err := instantTransferPaymentClient.Payment.RetrieveActiveBanks(context.Background()) | ||
require.NotEmpty(t, res.Items) | ||
if err != nil { | ||
t.Errorf("Error %s", err) | ||
} | ||
} | ||
|
||
func TestInitInstantTransferAPMPayment(t *testing.T) { | ||
additionalParams := make(map[string]string) | ||
additionalParams["bankCode"] = "0" | ||
|
||
request := adapter.InitApmPaymentRequest{ | ||
ApmType: craftgate.ApmType_INSTANT_TRANSFER, | ||
Price: 1, | ||
PaidPrice: 1, | ||
Currency: craftgate.Currency_TRY, | ||
PaymentGroup: craftgate.PaymentGroup_LISTING_OR_SUBSCRIPTION, | ||
ConversationId: "foo-bar", | ||
CallbackUrl: "https://www.your-website.com/callback", | ||
Items: []craftgate.PaymentItem{ | ||
{ | ||
Name: "Item 1", | ||
Price: 0.6, | ||
}, | ||
{ | ||
Name: "Item 2", | ||
Price: 0.4, | ||
}, | ||
}, | ||
AdditionalParams: additionalParams, | ||
} | ||
res, err := instantTransferPaymentClient.Payment.InitApmPayment(context.Background(), request) | ||
_, _ = spew.Printf("%#v\n", res) | ||
|
||
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 |
---|---|---|
|
@@ -3,11 +3,12 @@ package tests | |
import ( | ||
"context" | ||
"fmt" | ||
"testing" | ||
"time" | ||
|
||
"github.com/craftgate/craftgate-go-client/adapter" | ||
craftgate "github.com/craftgate/craftgate-go-client/adapter" | ||
"github.com/davecgh/go-spew/spew" | ||
"testing" | ||
"time" | ||
) | ||
|
||
var onboardingClient, _ = craftgate.New("api-key", "secret-key", "https://sandbox-api.craftgate.io") | ||
|
@@ -41,7 +42,6 @@ func Test_CreateSubMerchantMember(t *testing.T) { | |
Email: "[email protected]", | ||
PhoneNumber: "905551111111", | ||
Iban: "TR930006701000000001111111", | ||
IdentityNumber: "11111111110", | ||
LegalCompanyTitle: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
Name: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
MemberType: craftgate.MemberType_LIMITED_OR_JOINT_STOCK_COMPANY, | ||
|
@@ -68,7 +68,6 @@ func Test_CreateBuyerAndSubMerchantMember(t *testing.T) { | |
Email: "[email protected]", | ||
PhoneNumber: "905551111111", | ||
Iban: "TR930006701000000001111111", | ||
IdentityNumber: "11111111110", | ||
LegalCompanyTitle: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
Name: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
MemberType: craftgate.MemberType_LIMITED_OR_JOINT_STOCK_COMPANY, | ||
|
@@ -94,7 +93,6 @@ func Test_UpdateSubMerchantMember(t *testing.T) { | |
Email: "[email protected]", | ||
PhoneNumber: "905551111111", | ||
Iban: "TR930006701000000001111111", | ||
IdentityNumber: "11111111110", | ||
LegalCompanyTitle: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
Name: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
MemberType: craftgate.MemberType_LIMITED_OR_JOINT_STOCK_COMPANY, | ||
|
@@ -121,7 +119,6 @@ func Test_UpdateBuyerMember(t *testing.T) { | |
Email: "[email protected]", | ||
PhoneNumber: "905551111111", | ||
Iban: "TR930006701000000001111111", | ||
IdentityNumber: "11111111110", | ||
LegalCompanyTitle: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
Name: "Dem Zeytinyağı Üretim Ltd. Şti.", | ||
MemberType: craftgate.MemberType_PERSONAL, | ||
|
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