Here are the minimum changes you need to made.
Open file appsettings.json
and put your configs there.
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ZarinpalConfiguration": {
"Token": "1344b5d4-0048-11e8-94db-005056a205be",
"CallbackUrl": "http://yoursite.com/verify"
}
}
I mean
ZarinpalConfiguration
part.
services.AddZarinClient(Configuration.GetZarinpalConfiguration());
You need ZarinpalSharp.Asp. otherwise you should add it your self and it's not that hard! See AspExtensions.cs
Use IZarinClient
in your controller to request payments and verify them.