diff --git a/adapter/model.go b/adapter/model.go index e698828..5afb0cd 100644 --- a/adapter/model.go +++ b/adapter/model.go @@ -66,6 +66,7 @@ const ( ApmTypePAYPAL ApmType = "PAYPAL" ApmTypeKLARNA ApmType = "KLARNA" ApmTypeAFTERPAY ApmType = "AFTERPAY" + ApmTypeKASPI ApmType = "KASPI" ApmTypeSTRIPE ApmType = "STRIPE" ApmTypeFUND_TRANSFER ApmType = "FUND_TRANSFER" ApmTypeCASH_ON_DELIVERY ApmType = "CASH_ON_DELIVERY" @@ -86,6 +87,7 @@ const ( PAYPAL PaymentProvider = "PAYPAL" KLARNA PaymentProvider = "KLARNA" AFTERPAY PaymentProvider = "AFTERPAY" + KASPI PaymentProvider = "KASPI" APPLEPAY PaymentProvider = "APPLEPAY" GOOGLEPAY PaymentProvider = "GOOGLEPAY" HEPSIPAY PaymentProvider = "HEPSIPAY" @@ -121,6 +123,7 @@ const ( AED Currency = "AED" IQD Currency = "IQD" AZN Currency = "AZN" + KZT Currency = "KZT" ) // payment group declaration @@ -149,6 +152,7 @@ const ( PaymentMethod_PAYPAL PaymentMethod = "PAYPAL" PaymentMethod_KLARNA PaymentMethod = "KLARNA" PaymentMethod_AFTERPAY PaymentMethod = "AFTERPAY" + PaymentMethod_KASPI PaymentMethod = "KASPI" PaymentMethod_STRIPE PaymentMethod = "STRIPE" ) diff --git a/tests/payment_test.go b/tests/payment_test.go index bf0bf4f..05c4225 100644 --- a/tests/payment_test.go +++ b/tests/payment_test.go @@ -459,6 +459,34 @@ func TestPayment_InitAfterpayApmPayment(t *testing.T) { } } +func TestPayment_InitKaspiApmPayment(t *testing.T) { + request := adapter.InitApmPaymentRequest{ + ApmType: craftgate.ApmTypeKASPI, + Price: 1, + PaidPrice: 1, + Currency: craftgate.KZT, + PaymentGroup: craftgate.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, + }, + }, + } + res, err := paymentClient.Payment.InitApmPayment(context.Background(), request) + _, _ = spew.Printf("%#v\n", res) + + if err != nil { + t.Errorf("Error %s", err) + } +} + func TestPayment_CompleteApmPayment(t *testing.T) { request := adapter.CompleteApmPaymentRequest{ PaymentId: 123,