From 9876080adbad6864706ce2099b3238da2c1987f6 Mon Sep 17 00:00:00 2001 From: onurkanbakirci Date: Tue, 26 Dec 2023 21:16:31 +0300 Subject: [PATCH] feat:readme updateds --- .vscode/launch.json | 15 +++++++++++++++ README.md | 15 ++++++++------- docs/integration/docs/payment-gateways/paynet.md | 2 +- .../PaynetIntegrationSampleConsoleApp/Program.cs | 2 +- .../SipayIntegrationSampleConsoleApp/Program.cs | 8 ++++---- src/Integration.Hub/IntegrationBase.cs | 2 +- .../Infrastructure/HepsiburadaIntegrationBase.cs | 2 +- .../Infrastructure/TrendyolIntegrationBase.cs | 2 +- .../Request/SecurePaymentInitialRequestModel.cs | 4 ++-- .../Infrastructure/PaynetIntegrationBase.cs | 2 +- ...entIntegration.cs => ISipayAuthIntegration.cs} | 2 ++ .../Models/Request/GetAuthTokenRequestModel.cs | 2 +- .../Models/Response/GetAuthTokenResponseModel.cs | 4 +--- ...mentIntegration.cs => SipayAuthIntegration.cs} | 6 ++++-- .../ISipayPaymentIntegration.cs | 4 ++-- .../PaymentIntegration/SipayPaymentIntegration.cs | 4 +++- .../Infrastructure/SipayIntegrationBase.cs | 2 +- .../Integration.PaymentGateways.Sipay.csproj | 8 ++++++-- 18 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 .vscode/launch.json rename src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/{IAuthPaymentIntegration.cs => ISipayAuthIntegration.cs} (59%) rename src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/{AuthPaymentIntegration.cs => SipayAuthIntegration.cs} (52%) diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..9169439 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "C#: Sipay Debug", + "type": "dotnet", + "request": "launch", + "projectPath": "${workspaceFolder}/samples/PaymentGateways/SipayIntegrationSampleConsoleApp/SipayIntegrationSampleConsoleApp.csproj" + } + + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 1da1714..f38424b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Integration Project +

License: MIT @@ -16,13 +17,13 @@ Enhance your integration workflows by leveraging the Integration Library, which ## Build Status -  | `status` | `version` +  | `status` | `nuget` --- | --- | --- -**Integration.Hub** | ![build](https://github.com/onurkanbakirci/Integration/actions/workflows/integration-hub.yml/badge.svg) | 1.0.1 -**Integration.Marketplaces.Trendyol** | ![build](https://github.com/onurkanbakirci/Integration/actions/workflows/trendyol-integration.yml/badge.svg) | 1.0.1 -**Integration.Marketplaces.Hepsiburada** | ![build](https://github.com/onurkanbakirci/Integration/actions/workflows/hepsiburada-integration.yml/badge.svg) | 1.0.1 -**Integration.PaymentGateways.Paynet** | ![build](https://github.com/onurkanbakirci/Integration/actions/workflows/paynet-integration.yml/badge.svg) | 1.0.0 -**Integration.PaymentGateways.Sipay** | ![build](https://github.com/onurkanbakirci/Integration/actions/workflows/sipay-integration.yml/badge.svg) | 1.0.0 +**Integration.Hub** | ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onurkanbakirci/Integration/integration-hub.yml) | ![Nuget](https://img.shields.io/nuget/dt/Integration.Hub?color=green&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.Hub) ![Nuget](https://img.shields.io/nuget/v/Integration.Hub?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.Hub) +**Integration.Marketplaces.Trendyol** | ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onurkanbakirci/Integration/trendyol-integration.yml) | ![Nuget](https://img.shields.io/nuget/dt/Integration.Marketplaces.Trendyol?color=green&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.Marketplaces.Trendyol) ![Nuget](https://img.shields.io/nuget/v/Integration.Marketplaces.Trendyol?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.Marketplaces.Trendyol) +**Integration.Marketplaces.Hepsiburada** | ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onurkanbakirci/Integration/hepsiburada-integration.yml) | ![Nuget](https://img.shields.io/nuget/dt/Integration.Marketplaces.Hepsiburada?color=green&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.Marketplaces.Hepsiburada) ![Nuget](https://img.shields.io/nuget/v/Integration.Marketplaces.Hepsiburada?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.Marketplaces.Hepsiburada) +**Integration.PaymentGateways.Paynet** | ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onurkanbakirci/Integration/paynet-integration.yml) | ![Nuget](https://img.shields.io/nuget/dt/Integration.PaymentGateways.Paynet?color=green&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.PaymentGateways.Paynet) ![Nuget](https://img.shields.io/nuget/v/Integration.PaymentGateways.Paynet?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.PaymentGateways.Paynet) +**Integration.PaymentGateways.Sipay** | ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onurkanbakirci/Integration/sipay-integration.yml) | ![Nuget](https://img.shields.io/nuget/dt/Integration.PaymentGateways.Sipay?color=green&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.PaymentGateways.Sipay) ![Nuget](https://img.shields.io/nuget/v/Integration.PaymentGateways.Sipay?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FIntegration.PaymentGateways.Sipay) ## Table of contents @@ -143,7 +144,7 @@ var securePaymentInitialResponse = await paynetPaymentIntegration.SecurePaymentI pan: "pan", month: 1, year: 2021, - cVC: "cVC", + cvc: "cvc", returnUrl: "returnUrl", instalment: 1)); diff --git a/docs/integration/docs/payment-gateways/paynet.md b/docs/integration/docs/payment-gateways/paynet.md index da9707b..5b4ac39 100644 --- a/docs/integration/docs/payment-gateways/paynet.md +++ b/docs/integration/docs/payment-gateways/paynet.md @@ -60,7 +60,7 @@ var securePaymentInitialResponse = await paynetPaymentIntegration.SecurePaymentI pan: "pan", month: 1, year: 2021, - cVC: "cVC", + cvc: "cvc", returnUrl: "returnUrl", instalment: 1)); ``` diff --git a/samples/PaymentGateways/PaynetIntegrationSampleConsoleApp/Program.cs b/samples/PaymentGateways/PaynetIntegrationSampleConsoleApp/Program.cs index 5b3c3f8..68b997d 100644 --- a/samples/PaymentGateways/PaynetIntegrationSampleConsoleApp/Program.cs +++ b/samples/PaymentGateways/PaynetIntegrationSampleConsoleApp/Program.cs @@ -29,7 +29,7 @@ pan: "pan", month: 1, year: 2021, - cVC: "cVC", + cvc: "cVC", returnUrl: "returnUrl", instalment: 1)); diff --git a/samples/PaymentGateways/SipayIntegrationSampleConsoleApp/Program.cs b/samples/PaymentGateways/SipayIntegrationSampleConsoleApp/Program.cs index b1967dd..c6f2bf7 100644 --- a/samples/PaymentGateways/SipayIntegrationSampleConsoleApp/Program.cs +++ b/samples/PaymentGateways/SipayIntegrationSampleConsoleApp/Program.cs @@ -2,10 +2,10 @@ using Integration.PaymentGateways.Sipay.Infrastructure.PaymentIntegration.Models.Response; var sipayPaymentIntegration = new SipayPaymentIntegration( - merchantKey: "merchantKey", - appKey: "appKey", - appSecret: "appSecret", - merchantId: 0, + merchantKey: "$2y$10$HmRgYosneqcwHj.UH7upGuyCZqpQ1ITgSMj9Vvxn.t6f.Vdf2SQFO", + appKey: "6d4a7e9374a76c15260fcc75e315b0b9", + appSecret: "b46a67571aa1e7ef5641dc3fa6f1712a", + merchantId: 18309, isInProduction: false ); diff --git a/src/Integration.Hub/IntegrationBase.cs b/src/Integration.Hub/IntegrationBase.cs index e2f3bde..23d37be 100644 --- a/src/Integration.Hub/IntegrationBase.cs +++ b/src/Integration.Hub/IntegrationBase.cs @@ -12,7 +12,7 @@ static IntegrationBase() _httpClient = new HttpClient(); } - protected void IntializeDefaultHeaders(Dictionary headers) + protected void InitializeDefaultHeaders(Dictionary headers) { // Add default headers to the request foreach (var header in headers) diff --git a/src/Marketplaces/Integration.Marketplaces.Hepsiburada/Infrastructure/HepsiburadaIntegrationBase.cs b/src/Marketplaces/Integration.Marketplaces.Hepsiburada/Infrastructure/HepsiburadaIntegrationBase.cs index 1ed49b7..23aacd8 100644 --- a/src/Marketplaces/Integration.Marketplaces.Hepsiburada/Infrastructure/HepsiburadaIntegrationBase.cs +++ b/src/Marketplaces/Integration.Marketplaces.Hepsiburada/Infrastructure/HepsiburadaIntegrationBase.cs @@ -17,7 +17,7 @@ public HepsiburadaIntegrationBase(string username, string password, bool isInPro _password = password ?? throw new ArgumentNullException(nameof(password)); _isInProduction = isInProduction; - IntializeDefaultHeaders(new Dictionary + InitializeDefaultHeaders(new Dictionary { { "Accept", "application/json" }, { "Authorization", $"Basic {Convert.ToBase64String(Encoding.ASCII.GetBytes($"{_username}:{_password}"))}"} diff --git a/src/Marketplaces/Integration.Marketplaces.Trendyol/Infrastructure/TrendyolIntegrationBase.cs b/src/Marketplaces/Integration.Marketplaces.Trendyol/Infrastructure/TrendyolIntegrationBase.cs index bf1dcaa..3e6a077 100644 --- a/src/Marketplaces/Integration.Marketplaces.Trendyol/Infrastructure/TrendyolIntegrationBase.cs +++ b/src/Marketplaces/Integration.Marketplaces.Trendyol/Infrastructure/TrendyolIntegrationBase.cs @@ -21,7 +21,7 @@ public TrendyolIntegrationBase(string supplierId, string apiKey, string apiSecre _isInProduction = isInProduction; _entegratorFirm = entegratorFirm; - IntializeDefaultHeaders(new Dictionary + InitializeDefaultHeaders(new Dictionary { { "Accept", "application/json" }, { "User-Agent", $"{_supplierId} - {_entegratorFirm}" }, diff --git a/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaymentIntegration/Models/Request/SecurePaymentInitialRequestModel.cs b/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaymentIntegration/Models/Request/SecurePaymentInitialRequestModel.cs index fa19fa1..1c2c3b3 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaymentIntegration/Models/Request/SecurePaymentInitialRequestModel.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaymentIntegration/Models/Request/SecurePaymentInitialRequestModel.cs @@ -3,7 +3,7 @@ namespace Integration.PaymentGateways.Paynet.Infrastructure.PaymentIntegration.Models.Request; public class SecurePaymentInitialRequestModel : IRequestModel { - public SecurePaymentInitialRequestModel(string amount, string orderRefNo, string domain, string cardHolder, string pan, int month, int year, string cVC, string returnUrl, int? instalment = null) + public SecurePaymentInitialRequestModel(string amount, string orderRefNo, string domain, string cardHolder, string pan, int month, int year, string cvc, string returnUrl, int? instalment = null) { Amount = amount; OrderRefNo = orderRefNo; @@ -12,7 +12,7 @@ public SecurePaymentInitialRequestModel(string amount, string orderRefNo, string Pan = pan; Month = month; Year = year; - CVC = cVC; + CVC = cvc; ReturnUrl = returnUrl; Instalment = instalment; } diff --git a/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaynetIntegrationBase.cs b/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaynetIntegrationBase.cs index 12c78da..7610208 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaynetIntegrationBase.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaynetIntegrationBase.cs @@ -15,7 +15,7 @@ public PaynetIntegrationBase(string secretKey, bool isInProduction = true) _secretKey = secretKey ?? throw new ArgumentNullException(nameof(secretKey)); _isInProduction = isInProduction; - IntializeDefaultHeaders(new Dictionary + InitializeDefaultHeaders(new Dictionary { { "Accept", "application/json" }, { "Authorization", $"Basic {Convert.ToBase64String(Encoding.ASCII.GetBytes($"{_secretKey}"))}"} diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/IAuthPaymentIntegration.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/ISipayAuthIntegration.cs similarity index 59% rename from src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/IAuthPaymentIntegration.cs rename to src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/ISipayAuthIntegration.cs index 9f502f1..f4d7dca 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/IAuthPaymentIntegration.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/ISipayAuthIntegration.cs @@ -1,4 +1,6 @@ using Integration.Hub; +using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Request; +using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Response; namespace Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration; public interface ISipayAuthIntegration : IAuthIntegration diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Request/GetAuthTokenRequestModel.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Request/GetAuthTokenRequestModel.cs index 28b825b..7633cae 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Request/GetAuthTokenRequestModel.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Request/GetAuthTokenRequestModel.cs @@ -1,5 +1,5 @@ using Integration.Hub; -namespace Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration; +namespace Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Request; public class GetAuthTokenRequestModel : IRequestModel { public GetAuthTokenRequestModel(string appId, string appSecret) diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Response/GetAuthTokenResponseModel.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Response/GetAuthTokenResponseModel.cs index 6446f5b..bd238ef 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Response/GetAuthTokenResponseModel.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Response/GetAuthTokenResponseModel.cs @@ -1,6 +1,4 @@ -using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Response; - -namespace Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration; +namespace Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Response; public class GetAuthTokenResponseModel : SipayBaseResponseModel { public string StatusCode { get; set; } diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/AuthPaymentIntegration.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/SipayAuthIntegration.cs similarity index 52% rename from src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/AuthPaymentIntegration.cs rename to src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/SipayAuthIntegration.cs index 378e524..51faab4 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/AuthPaymentIntegration.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/SipayAuthIntegration.cs @@ -1,11 +1,13 @@ using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration; +using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Request; +using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Response; namespace Integration.PaymentGateways.Sipay.Infrastructure.PaymentIntegration; -public class SipayPaymentIntegration : SipayIntegrationBase, ISipayAuthIntegration +public class SipayAuthIntegration : SipayIntegrationBase, ISipayAuthIntegration { private string GetTokentUrl() => $"{GetBaseUrl()}api/token"; - public SipayPaymentIntegration(string merchantKey, string appKey, string appSecret, int merchantId, bool isInProduction = true) : base(merchantKey, appKey, appSecret, merchantId, isInProduction) + public SipayAuthIntegration(string merchantKey, string appKey, string appSecret, int merchantId, bool isInProduction = true) : base(merchantKey, appKey, appSecret, merchantId, isInProduction) { } diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/ISipayPaymentIntegration.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/ISipayPaymentIntegration.cs index f33551a..e43b50f 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/ISipayPaymentIntegration.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/ISipayPaymentIntegration.cs @@ -43,14 +43,14 @@ public interface ISipayPaymentIntegration : IPaymentIntegration Task SecurePaymentChargeAsync(SecurePaymentChargeRequestModel securePaymentChargeRequestModel); ///

- /// Cancel payment request + /// Cancel payment /// /// /// Task CancelAsync(CancellationRequestModel cancellationRequestModel); /// - /// Refund payment request + /// Refund payment /// /// /// diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/SipayPaymentIntegration.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/SipayPaymentIntegration.cs index bbe9038..d3318c7 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/SipayPaymentIntegration.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/PaymentIntegration/SipayPaymentIntegration.cs @@ -2,7 +2,7 @@ using Integration.PaymentGateways.Sipay.Infrastructure.PaymentIntegration.Models.Request; using Integration.PaymentGateways.Sipay.Infrastructure.PaymentIntegration.Models.Response; using Integration.PaymentGateways.Sipay.Infrastructure.PaymentIntegration; -using System.ComponentModel; +using Integration.PaymentGateways.Sipay.Infrastructure.AuthIntegration.Models.Request; public class SipayPaymentIntegration : SipayIntegrationBase, ISipayPaymentIntegration { @@ -15,6 +15,8 @@ public class SipayPaymentIntegration : SipayIntegrationBase, ISipayPaymentIntegr public SipayPaymentIntegration(string merchantKey, string appKey, string appSecret, int merchantId, bool isInProduction = true) : base(merchantKey, appKey, appSecret, merchantId, isInProduction) { + var sipayAuthIntegration = new SipayAuthIntegration(merchantKey, appKey, appSecret, merchantId, isInProduction); + var token = sipayAuthIntegration.GetAuthTokenAsync(new GetAuthTokenRequestModel(appKey, appSecret)); } /// diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/SipayIntegrationBase.cs b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/SipayIntegrationBase.cs index 9011b54..8405e36 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/SipayIntegrationBase.cs +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/SipayIntegrationBase.cs @@ -20,7 +20,7 @@ public SipayIntegrationBase(string merchantKey, string appKey, string appSecret, _merchantId = merchantId; _isInProduction = isInProduction; - IntializeDefaultHeaders(new Dictionary + InitializeDefaultHeaders(new Dictionary { { "Accept", "application/json" }, }); diff --git a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Integration.PaymentGateways.Sipay.csproj b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Integration.PaymentGateways.Sipay.csproj index 98e55d5..1cfe667 100644 --- a/src/PaymentGateways/Integration.PaymentGateways.Sipay/Integration.PaymentGateways.Sipay.csproj +++ b/src/PaymentGateways/Integration.PaymentGateways.Sipay/Integration.PaymentGateways.Sipay.csproj @@ -16,8 +16,12 @@ - - + + + + + + \ No newline at end of file