Skip to content

Commit

Permalink
feat:readme updateds
Browse files Browse the repository at this point in the history
  • Loading branch information
onurkanbakirci committed Dec 26, 2023
1 parent 86fcb8e commit 9876080
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 31 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
}

]
}
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Integration Project


<p>
<a href="https://opensource.org/licenses/MIT">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg">
Expand All @@ -16,13 +17,13 @@ Enhance your integration workflows by leveraging the Integration Library, which

## Build Status

&nbsp; | `status` | `version`
&nbsp; | `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

Expand Down Expand Up @@ -143,7 +144,7 @@ var securePaymentInitialResponse = await paynetPaymentIntegration.SecurePaymentI
pan: "pan",
month: 1,
year: 2021,
cVC: "cVC",
cvc: "cvc",
returnUrl: "returnUrl",
instalment: 1));

Expand Down
2 changes: 1 addition & 1 deletion docs/integration/docs/payment-gateways/paynet.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var securePaymentInitialResponse = await paynetPaymentIntegration.SecurePaymentI
pan: "pan",
month: 1,
year: 2021,
cVC: "cVC",
cvc: "cvc",
returnUrl: "returnUrl",
instalment: 1));
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
pan: "pan",
month: 1,
year: 2021,
cVC: "cVC",
cvc: "cVC",
returnUrl: "returnUrl",
instalment: 1));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down
2 changes: 1 addition & 1 deletion src/Integration.Hub/IntegrationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static IntegrationBase()
_httpClient = new HttpClient();
}

protected void IntializeDefaultHeaders(Dictionary<string, string> headers)
protected void InitializeDefaultHeaders(Dictionary<string, string> headers)
{
// Add default headers to the request
foreach (var header in headers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public HepsiburadaIntegrationBase(string username, string password, bool isInPro
_password = password ?? throw new ArgumentNullException(nameof(password));
_isInProduction = isInProduction;

IntializeDefaultHeaders(new Dictionary<string, string>
InitializeDefaultHeaders(new Dictionary<string, string>
{
{ "Accept", "application/json" },
{ "Authorization", $"Basic {Convert.ToBase64String(Encoding.ASCII.GetBytes($"{_username}:{_password}"))}"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public TrendyolIntegrationBase(string supplierId, string apiKey, string apiSecre
_isInProduction = isInProduction;
_entegratorFirm = entegratorFirm;

IntializeDefaultHeaders(new Dictionary<string, string>
InitializeDefaultHeaders(new Dictionary<string, string>
{
{ "Accept", "application/json" },
{ "User-Agent", $"{_supplierId} - {_entegratorFirm}" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 6 in src/PaymentGateways/Integration.PaymentGateways.Paynet/Infrastructure/PaymentIntegration/Models/Request/SecurePaymentInitialRequestModel.cs

View workflow job for this annotation

GitHub Actions / Build Lib

Non-nullable property 'AgentReferenceNo' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
{
Amount = amount;
OrderRefNo = orderRefNo;
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PaynetIntegrationBase(string secretKey, bool isInProduction = true)
_secretKey = secretKey ?? throw new ArgumentNullException(nameof(secretKey));
_isInProduction = isInProduction;

IntializeDefaultHeaders(new Dictionary<string, string>
InitializeDefaultHeaders(new Dictionary<string, string>
{
{ "Accept", "application/json" },
{ "Authorization", $"Basic {Convert.ToBase64String(Encoding.ASCII.GetBytes($"{_secretKey}"))}"}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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<GetAuthTokenResponseModel>
{
public string StatusCode { get; set; }

Check warning on line 4 in src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Response/GetAuthTokenResponseModel.cs

View workflow job for this annotation

GitHub Actions / Build Lib

'GetAuthTokenResponseModel.StatusCode' hides inherited member 'SipayBaseResponseModel<GetAuthTokenResponseModel>.StatusCode'. Use the new keyword if hiding was intended.

Check warning on line 4 in src/PaymentGateways/Integration.PaymentGateways.Sipay/Infrastructure/AuthIntegration/Models/Response/GetAuthTokenResponseModel.cs

View workflow job for this annotation

GitHub Actions / Build Lib

Non-nullable property 'StatusCode' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public interface ISipayPaymentIntegration : IPaymentIntegration
Task<SecurePaymentChargeResponseModel> SecurePaymentChargeAsync(SecurePaymentChargeRequestModel securePaymentChargeRequestModel);

/// <summary>
/// Cancel payment request
/// Cancel payment
/// </summary>
/// <param name="cancellationRequestModel"></param>
/// <returns><see cref="CancellationResponseModel"/></returns>
Task<CancellationResponseModel> CancelAsync(CancellationRequestModel cancellationRequestModel);

/// <summary>
/// Refund payment request
/// Refund payment
/// </summary>
/// <param name="refundRequestModel"></param>
/// <returns><see cref="RefundResponseModel"/></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public SipayIntegrationBase(string merchantKey, string appKey, string appSecret,
_merchantId = merchantId;
_isInProduction = isInProduction;

IntializeDefaultHeaders(new Dictionary<string, string>
InitializeDefaultHeaders(new Dictionary<string, string>
{
{ "Accept", "application/json" },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
<ProjectReference Include="..\..\Integration.Hub\Integration.Hub.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="RazorEngineCore" Version="2023.11.2" />
<ItemGroup>
<PackageReference Include="RazorEngineCore" Version="2023.11.2" />
</ItemGroup>

<ItemGroup>
<Content Remove="Resources\HTML\3ds-payment-form.cshtml" />
</ItemGroup>

</Project>

0 comments on commit 9876080

Please sign in to comment.