ePlatform.Api
1.3.0
See the version list below for details.
dotnet add package ePlatform.Api --version 1.3.0
NuGet\Install-Package ePlatform.Api -Version 1.3.0
<PackageReference Include="ePlatform.Api" Version="1.3.0" />
paket add ePlatform.Api --version 1.3.0
#r "nuget: ePlatform.Api, 1.3.0"
// Install ePlatform.Api as a Cake Addin #addin nuget:?package=ePlatform.Api&version=1.3.0 // Install ePlatform.Api as a Cake Tool #tool nuget:?package=ePlatform.Api&version=1.3.0
Turkcell e-Şirket .NET Client Örnekleri
e-Belge ve e-Bilet uygulamaları için .Net Client kullanım örnekleri.
Kütüphaneler NET Standard 2.0 ile geliştirilmiştir. Uyumlu versiyonlar için Net Standard Versiyon uyumluluk tablosuna gözatabilirsiniz.
Başlarken
Servisleri nuget paketleri ile kullanmak için nuget adresimizi takip edebilir, teknik dokümantasyon için Turkcell e-Şirket Teknik Dokümanlar adresimizi ziyaret edebilirsiniz. Entegrasyon süreçlerinizde entegrasyon@eplatform.com.tr üzerinden iletişime geçebilirsiniz.
Kullanım
Tüm servis metodlarında authentication sağlamak için ApiKey kullanılması gerekmektedir. ApiKey'inizi oluşturmak için e-Şirket Kimlik Doğrulama dokümanını inceleyin.
Console Uygulaması/Minimal API Örneği
Console uygulamanızda main
metodu içine aşağıdaki satırları ekledikten sonra, interfaceler üzerinden servis metodlarına erişebilirsiniz.
ServiceProvider serviceProvider = new ServiceCollection()
.AddePlatformClients(clientOptions =>
{
clientOptions.InvoiceServiceUrl = "https://efaturaservicetest.isim360.com";
clientOptions.TicketServiceUrl = "https://ebiletservicetest.isim360.com";
clientOptions.ApiKey = "";
})
.BuildServiceProvider();
var outboxInvoiceClient = serviceProvider.GetService<IOutboxInvoiceClient>();
var inboxInvoiceClient = serviceProvider.GetService<IInboxInvoiceClient>();
var commonClient = serviceProvider.GetService<ICommonClient>();
var earchiveClient = serviceProvider.GetService<IEArchiveInvoiceClient>();
var eventTicketClient = serviceProvider.GetService<IEventTicketClient>();
var passengerTicketClient = serviceProvider.GetService<IPassengerTicketClient>();
}
.NET Core Örneği
.NET core uygulamanızda Startup
dosyanızı aşağıdaki gibi yapılandırın,
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddePlatformClients(Configuration);
services.AddControllers();
}
appsettings.json dosyasınıza aşağıdaki nodu ekleyin,
"ePlatformClientOptions": {
"InvoiceServiceUrl" : "https://efaturaservicetest.isim360.com",
"TicketServiceUrl" : "https://ebiletservicetest.isim360.com",
"ApiKey": ""
},
Controller injection
private readonly IOutboxInvoiceClient _outboxInvoiceClient;
public OutboxInvoiceController(IOutboxInvoiceClient outboxInvoiceClient)
{
_outboxInvoiceClient = outboxInvoiceClient;
}
[HttpGet("pdf/{id}")]
public async Task<ActionResult> GetPdf(Guid id)
{
var data = await _outboxInvoiceClient.GetPdf(id);
return File(data, "application/pdf", $"{id}.zip");
}
.NET Framework Örneği
protected void Application_Start()
{
var services = new ServiceCollection();
//Use this method to add invoice clients
services.AddePlatformClients(clientOptions =>
{
clientOptions.InvoiceServiceUrl = "https://efaturaservicetest.isim360.com";
clientOptions.ApiKey = "";
});
var providerFactory = new AutofacServiceProviderFactory();
//to populate your container
ContainerBuilder builder = providerFactory.CreateBuilder(services);
// MVC - Register your MVC controllers.
builder.RegisterControllers(typeof(WebApiApplication).Assembly);
// MVC - OPTIONAL: Register model binders that require DI.
builder.RegisterModelBinders(typeof(WebApiApplication).Assembly);
builder.RegisterModelBinderProvider();
// MVC - OPTIONAL: Register web abstractions like HttpContextBase.
builder.RegisterModule<AutofacWebTypesModule>();
// MVC - OPTIONAL: Enable property injection in view pages.
builder.RegisterSource(new ViewRegistrationSource());
// MVC - OPTIONAL: Enable property injection into action filters.
builder.RegisterFilterProvider();
// MVC - Set Autofac as dependency resolver.
var container = builder.Build();
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
// Standard MVC setup:
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
Controller injection
private readonly IOutboxInvoiceClient _outboxInvoiceClient;
public OutboxInvoiceController(IOutboxInvoiceClient outboxInvoiceClient)
{
_outboxInvoiceClient = outboxInvoiceClient;
}
[HttpGet("pdf/{id}")]
public async Task<ActionResult> GetPdf(Guid id)
{
var data = await _outboxInvoiceClient.GetPdf(id);
return File(data, "application/pdf", $"{id}.zip");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Flurl.Http (>= 2.4.2)
- Microsoft.Extensions.Caching.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Caching.Memory (>= 2.2.0)
- Microsoft.Extensions.Http (>= 2.2.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.2.0)
- Newtonsoft.Json (>= 12.0.2)
- Polly (>= 7.1.0)
- System.Threading.Tasks.Extensions (>= 4.5.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.