Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish NuGet Package

# on:
# push:
# branches:
# - master
# paths:
# - 'src/**'
# - '*.csproj'
# workflow_dispatch:

on:
workflow_dispatch:


jobs:
publish:
name: Publish to NuGet
runs-on: ubuntu-latest

steps:
- name: Check Team Membership
id: check_team
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_SECRET }}
TEAM_SLUG: 'reviewers'
ORG_NAME: 'paywallone'
run: |
ACTOR="${{ github.actor }}"
TEAM_MEMBERSHIP_RESPONSE=$(curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/orgs/$ORG_NAME/teams/$TEAM_SLUG/memberships/$ACTOR")
echo "$TEAM_MEMBERSHIP_RESPONSE"
if echo "$TEAM_MEMBERSHIP_RESPONSE" | grep -q '"state": "active"'; then
echo "Actor $ACTOR is a member of the team."
echo "::set-output name=is_member::true"
else
echo "Actor $ACTOR is NOT a member of the team."
echo "::set-output name=is_member::false"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
5.0.x
6.0.x
7.0.x
8.0.x

- name: Get current version
id: get_version
run: |
VERSION=$(find . -name "*.csproj" -exec grep -oP '(?<=<Version>).*?(?=</Version>)' {} + | head -n 1)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Pack
run: dotnet pack --configuration Release --no-build --output ./artifacts

- name: Push to NuGet
run: |
dotnet nuget push ./artifacts/*.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
36 changes: 36 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SonarQube Analysis

on:
schedule:
- cron: '0 6 * * 1' # Her Pazartesi saat 06:00'da çalıştır
workflow_dispatch: # Manuel çalıştırmak için
env:
ACCESS_TOKEN: ${{ secrets.AZURE_ARTIFACTS_ACCESSTOKEN }}
ACCESS_TOKEN_HANGFIRE: ${{ secrets.ACCESS_TOKEN_HANGFIRE }}

jobs:
sonarqube:
name: SonarQube Code Analysis
runs-on: [self-hosted, pw-hc-runner] # Runner etiketi burada doğru olmalı

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # SonarQube'un analiz için tüm geçmişe ihtiyacı olabilir

- name: Install .NET SDK
run: |
echo ${{ github.event.repository.name }}
sudo dnf install -y dotnet-sdk-8.0 # Versiyon ihtiyacına göre değiştir

- name: Install SonarScanner for .NET
run: |
dotnet tool update --global dotnet-sonarscanner

- name: Run SonarQube Analysis
run: |
export PATH="$HOME/.dotnet/tools:$PATH"
dotnet-sonarscanner begin /k:"${{ github.event.repository.name }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet build
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,6 @@ Paketi yükledikten sonra `appsettings.json` içinde `PayWall` kısmının oldu

- **PayWall Entegrasyon Dökümanı:** [https://developer.paywall.one/](https://developer.paywall.one/)
- **Website:** [https://paywall.one/](https://paywall.one/)
- **Test Paneli:** [https://dev-panel.itspaywall.com/](https://dev-panel.itspaywall.com/)
- **Test Paneli:** [https://test-panel.itspaywall.com/](https://test-panel.itspaywall.com/)
- **Canlı Panel(Global):** [https://panel.itspaywall.com/](https://panel.itspaywall.com/)
- **Canlı Panel(Turkey):** [https://panel.paywall.com.tr/](https://panel.paywall.com.tr/)
19 changes: 0 additions & 19 deletions azure-pipelines-triggers.yml

This file was deleted.

8 changes: 4 additions & 4 deletions src/PayWall.NetCore.Example/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"PayWall" : {
"Prod": false,
"DataCenter": "Global",
"PublicClient": "f375fd2c-b9d7-4560-8e14-0c0ac46b1830",
"PublicKey": "P19sW+ewdl6Bn7LqrCnJudy4H3mOj4kWJewc4JhwIRMQwnmSolP+h67te+DjrfB22QWfQKguo53zLAdA5OAxioqSHZzxZ5w39xP8VlkHq+d8dt54lyT5AXiTR9P6T0uW3U7O15Mi8+N69KhAcwC3qZQLaQhwhqHKYMXmZ2meV9V5bsa+9b0r+1Z4JGYd3ihRZt7O/r7qoFqlQagM23h5C2eL+eWPWLQBHDKVFmLUBvn5xc90iujGGFFgwTqK014f9B1cV81N2CQKS2bT7HEODnAYWCOogEctY9hZ11ADAYSlHaDK0LQ9uZ/FeW0726SHdd5EvP6XO2XuVVPWQZESag==",
"PrivateClient": "f6582612-a350-476c-b047-e5d7de8ae6e0",
"PrivateKey": "LHdOYHEfC3Guzp/eD6wrnd9xjNqzcS0C0OIU1drC/HGOuBsPFy3HQSv1ETay/LcRthG4Lnneo7yUuUZS78y0sZpqZQs8yX4DPSnD4gQ7EVTciIgpZppZzLK100xkFMbjhZWzyXuVg/TLyVwqybRm95eOMKjMLxc2TX0xo4rID7sY1yrfxHhzP/lZYqqAItijFlHBBW7kxVaACFme/1y/ubX1BwMcIR7h1Xejvh46EmU3xALiPCvDla8sjjLE2gdCzprBkFCD4aIrtp91n6BUbHYHTt/Dcg773E3IQyOo+61harGAydrQiNJEpqYrESzpB0b2Qd+dMUX4ZQMXFFtDAg=="
"PublicClient": "",
"PublicKey": "",
"PrivateClient": "",
"PrivateKey": ""
}
}
1 change: 1 addition & 0 deletions src/PayWall.NetCore/Models/Common/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public class Error
{
public int Code { get; set; }

public string Message { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public class CardInsurance
/// </summary>
[StringLength(20)]
[Required]
public string InquiryValue { get; set; }
public string IdentityNumber { get; set; }

/// <summary>
/// Ödemenin alınacağı kartın son kullanma tarihi ayı.
Expand Down
2 changes: 1 addition & 1 deletion src/PayWall.NetCore/PayWall.NetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Authors>PayWall</Authors>
<PackageId>PayWall.NetCore</PackageId>
<Version>0.0.5</Version>
<Version>0.0.8</Version>
<Product>PayWall.NetCore</Product>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
Expand Down
21 changes: 17 additions & 4 deletions src/PayWall.NetCore/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public static class ServiceCollectionExtensions
#region Private Properties
// Global
private static Uri ProdPaymentApiUrlGCP => new("https://payment-api.itspaywall.com/api/paywall/");
private static Uri TestPaymentApiUrlGCP => new("https://dev-payment-api.itspaywall.com/api/paywall/");
private static Uri TestPaymentApiUrlGCP => new("https://test-payment-api.itspaywall.com/api/paywall/");
private static Uri ProdPaymentPrivateApiUrlGCP => new("https://payment-private-api.itspaywall.com/api/paywall/");
private static Uri TestPaymentPrivateApiUrlGCP => new("https://dev-payment-private-api.itspaywall.com/api/paywall/");
private static Uri TestPaymentPrivateApiUrlGCP => new("https://test-payment-private-api.itspaywall.com/api/paywall/");
private static Uri ProdCardWallApiUrlGCP => new("https://card-api.itspaywall.com/paywall/");
private static Uri TestCardWallApiUrlGCP => new("https://dev-card-api.itspaywall.com/paywall/");
private static Uri TestCardWallApiUrlGCP => new("https://test-card-api.itspaywall.com/paywall/");
private static Uri ProdMemberApiUrlGCP => new("https://member-api.itspaywall.com/api/paywall/");
private static Uri TestMemberApiUrlGCP => new("https://dev-member-api.itspaywall.com/api/paywall/");
private static Uri TestMemberApiUrlGCP => new("https://test-member-api.itspaywall.com/api/paywall/");


// Turkey
Expand All @@ -54,6 +54,19 @@ public static void AddPaywallService(this IServiceCollection services, IConfigur
.AddMemberApiClient(payWallOptions, handlerFactories)
.AddTransient<PayWallService>();
}

public static void AddPaywallService(
this IServiceCollection services,
PayWallOptions payWallOptions,
params Func<IServiceProvider, DelegatingHandler>[] handlerFactories)
{
services
.AddPaymentApiClient(payWallOptions, handlerFactories)
.AddPaymentPrivateApiClient(payWallOptions, handlerFactories)
.AddCardWallApiClient(payWallOptions, handlerFactories)
.AddMemberApiClient(payWallOptions, handlerFactories)
.AddTransient<PayWallService>();
}
#endregion

#region Private Methods
Expand Down
Loading