Iran Bus Service Package
Webservice package for iran bus api on safar724 website
Before posting new issues: Test samples
Note that: you should register on safar724 website and get your username and password to using this package
you can use it in both .net core and .net framework its use .net standard
Use library as dll, reference from nuget or just use this in package manager console
Install-Package IRBusDotNet
Currently the library supports following method:
- [*] Getcode
- [*] GetToken
- [*] ValidateToken
- [*] GetCities
- [*] GetServices
- [*] GetBusService
- [*] BuyTicket
- [*] InfoBuyTicket
- [*] RefundOverviewTicket
- [*] RefundTicket
- [*] GetTokenAsync
- [*] GetCitiesAsync
- [*] GetServicesAsync
- [*] GetBusServiceAsync
- [*] BuyTicketAsync
- [*] InfoBuyTicketAsync
- [*] RefundOverviewTicketAsync
- [*] RefundTicketAsync
IIRBusApi api = new IRBusApi();
var token = api.GetToken("Username","Password");
bool flag = api.ValidateToken(token.Created,token.ExpireIn);
This method lists all of the cities with a specific ID. Provided ID is required for further methods.Since list of cities rarely changes, caching the list for feature use is highly recommended:
IBusApi _api = new BusApi(token.AccessToken);
var cities = _api.GetCities();
Output Array of the Bus Summary object
Get a specific service
This method returns detailed information of the specific bus
this method books a ticket from the specific service and returns aticket ID.
If online payment method is selected, this method also will returna payment endpoint.
To finalize the booking processfor the online payment method,
user must be redirected to the provided endpoint and should complete payment process within 10 minutes,
then ticket issuccessfully booked and ticket number isissued
Get a specific ticket
This method returns detailed information of the specific ticket
Get refund overview of a ticket
This method returns detailed information about a ticket which is subjectto refund
This method actually refunds the ticket
MIT