From de35218826b786d78fb0a33b2ef448a41b565f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frul=20Berat=20ALLAHVERD=C4=B0?= Date: Mon, 30 Sep 2024 11:45:09 +0300 Subject: [PATCH 1/3] chippin added --- Samples/PaymentSample.cs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Samples/PaymentSample.cs b/Samples/PaymentSample.cs index 612ba9e..9e5893d 100644 --- a/Samples/PaymentSample.cs +++ b/Samples/PaymentSample.cs @@ -1141,6 +1141,45 @@ public void Init_Tompay_Apm_Payment() Assert.AreEqual(response.AdditionalAction, ApmAdditionalAction.WAIT_FOR_WEBHOOK); } + [Test] + public void Init_Chippin_Apm_Payment() + { + var request = new InitApmPaymentRequest + { + ApmType = ApmType.CHIPPIN, + ApmUserIdentity = 1000000, // Chippin Kullanıcı No + Price = new decimal(1.0), + PaidPrice = new decimal(1.0), + Currency = Currency.TRY, + PaymentGroup = PaymentGroup.LISTING_OR_SUBSCRIPTION, + ConversationId = "conversationId", + ExternalId = "externalId", + CallbackUrl = "https://www.your-website.com/craftgate-apm-callback", + Items = new List + { + new PaymentItem + { + Name = "Item 1", + ExternalId = Guid.NewGuid().ToString(), + Price = new decimal(0.40) + }, + + new PaymentItem + { + Name = "Item 2", + ExternalId = Guid.NewGuid().ToString(), + Price = new decimal(0.60) + } + }, + }; + + var response = _craftgateClient.Payment().InitApmPayment(request); + Assert.NotNull(response); + Assert.NotNull(response.PaymentId); + Assert.AreEqual(response.PaymentStatus, PaymentStatus.WAITING); + Assert.AreEqual(response.AdditionalAction, ApmAdditionalAction.WAIT_FOR_WEBHOOK); + } + [Test] public void Complete_Edenred_Apm_Payment() { From a7ba9f91984d8e727466a99d308f65ab1c15a877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frul=20Berat=20ALLAHVERD=C4=B0?= Date: Mon, 30 Sep 2024 12:59:07 +0300 Subject: [PATCH 2/3] enum type added --- Craftgate/Model/ApmType.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Craftgate/Model/ApmType.cs b/Craftgate/Model/ApmType.cs index 3148f57..fe57b3e 100644 --- a/Craftgate/Model/ApmType.cs +++ b/Craftgate/Model/ApmType.cs @@ -28,6 +28,7 @@ public enum ApmType [EnumMember(Value = "MULTINET")] MULTINET, [EnumMember(Value = "MULTINET_GIFT")] MULTINET_GIFT, [EnumMember(Value = "ISPAY")] ISPAY, + [EnumMember(Value = "CHIPPIN")] CHIPPIN, [EnumMember(Value = "FUND_TRANSFER")] FUND_TRANSFER, [EnumMember(Value = "CASH_ON_DELIVERY")] CASH_ON_DELIVERY } From 1f10280c4c4d82db7a8739fd159d1fd345067619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frul=20Berat=20ALLAHVERD=C4=B0?= Date: Tue, 1 Oct 2024 10:57:38 +0300 Subject: [PATCH 3/3] Update PaymentSample.cs --- Samples/PaymentSample.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Samples/PaymentSample.cs b/Samples/PaymentSample.cs index 9e5893d..eb7c9af 100644 --- a/Samples/PaymentSample.cs +++ b/Samples/PaymentSample.cs @@ -1147,7 +1147,7 @@ public void Init_Chippin_Apm_Payment() var request = new InitApmPaymentRequest { ApmType = ApmType.CHIPPIN, - ApmUserIdentity = 1000000, // Chippin Kullanıcı No + ApmUserIdentity = "1000000", // Chippin Kullanıcı No Price = new decimal(1.0), PaidPrice = new decimal(1.0), Currency = Currency.TRY, @@ -2162,4 +2162,4 @@ public void Retrieve_Provider_Card() Assert.NotNull(response); } } -} \ No newline at end of file +}