├── .gitignore ├── .nuget └── NuGet.config ├── LICENSE ├── QiwiApi.sln ├── QiwiApi ├── Entities │ ├── Balance │ │ ├── Balance.cs │ │ └── BalanceType.cs │ ├── General │ │ ├── CommissionRange.cs │ │ └── CurrencyAmount.cs │ ├── Payments │ │ ├── Payment.cs │ │ └── PaymentProvider.cs │ ├── Profile │ │ ├── AuthInfo.cs │ │ ├── ContractInfo.cs │ │ ├── IdentificationInfo.cs │ │ ├── MobilePinInfo.cs │ │ ├── PassInfo.cs │ │ ├── PinInfo.cs │ │ └── UserInfo.cs │ └── Transaction │ │ ├── Transaction.cs │ │ └── TransactionState.cs ├── Enumerations │ ├── Currency.cs │ ├── Operation.cs │ ├── PaymentStatus.cs │ ├── Provider.cs │ └── Source.cs ├── Exceptions │ ├── NotInitializedException.cs │ ├── RequestException.cs │ ├── RequestLimitException.cs │ ├── TransactionNotFoundException.cs │ ├── UnauthorizedException.cs │ └── WalletNotFoundException.cs ├── QiwiApi.cs ├── QiwiApi.csproj └── Responses │ ├── BalanceResponse.cs │ ├── ComissionResponse.cs │ ├── PaymentHistoryResponse.cs │ ├── PaymentResponse.cs │ ├── PaymentStatisticsResponse.cs │ └── UserProfileResponse.cs ├── README.md └── global.json /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | -------------------------------------------------------------------------------- /.nuget/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Dmitry Osipov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /QiwiApi.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QiwiApi", "QiwiApi\QiwiApi.csproj", "{0FEAEFE8-D810-4020-AEB3-6EB736968A26}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0FEAEFE8-D810-4020-AEB3-6EB736968A26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0FEAEFE8-D810-4020-AEB3-6EB736968A26}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0FEAEFE8-D810-4020-AEB3-6EB736968A26}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0FEAEFE8-D810-4020-AEB3-6EB736968A26}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /QiwiApi/Entities/Balance/Balance.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class Balance 4 | { 5 | public string alias; 6 | public string fsAlias; 7 | public string title; 8 | public bool? hasBalance; 9 | public BalanceType type; 10 | public CurrencyAmount balance; 11 | } 12 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Balance/BalanceType.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class BalanceType 4 | { 5 | public string id; 6 | public string title; 7 | } 8 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/General/CommissionRange.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class CommissionRange 4 | { 5 | public double? bound; 6 | public double? @fixed; 7 | public double? rate; 8 | } 9 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/General/CurrencyAmount.cs: -------------------------------------------------------------------------------- 1 | using QiwiApiSharp.Enumerations; 2 | 3 | namespace QiwiApiSharp.Entities 4 | { 5 | public class CurrencyAmount 6 | { 7 | public double? amount; 8 | public Currency? currency; 9 | } 10 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Payments/Payment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using QiwiApiSharp.Enumerations; 4 | 5 | namespace QiwiApiSharp.Entities 6 | { 7 | public class Payment 8 | { 9 | public long? txnId; 10 | public long? personId; 11 | public DateTime? date; 12 | public int? errorCode; 13 | public string error; 14 | public PaymentStatus? status; 15 | public string type; 16 | public string statusText; 17 | public string trmTxnId; 18 | public string account; 19 | public CurrencyAmount sum; 20 | public CurrencyAmount comission; 21 | public CurrencyAmount total; 22 | public PaymentProvider provider; 23 | public string comment; 24 | public decimal? currencyRate; 25 | public object extras; 26 | public bool? chequeReady; 27 | public bool? bankDocumentAvailable; 28 | public bool? bankDocumentReady; 29 | public bool? repeatPaymentEnabled; 30 | } 31 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Payments/PaymentProvider.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class PaymentProvider 4 | { 5 | public int? id; 6 | public string shortName; 7 | public string longName; 8 | public string logoUrl; 9 | public string description; 10 | public string keys; 11 | public string siteUrl; 12 | } 13 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/AuthInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Entities 4 | { 5 | public class AuthInfo 6 | { 7 | public string boundEmail; 8 | public string ip; 9 | public DateTime? lastLoginDate; 10 | public MobilePinInfo mobilePinInfo; 11 | public PassInfo passInfo; 12 | public long? personId; 13 | public PinInfo pinInfo; 14 | public DateTime? registrationDate; 15 | } 16 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/ContractInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace QiwiApiSharp.Entities 5 | { 6 | public class ContractInfo 7 | { 8 | public bool? blocked; 9 | public long? contactId; 10 | public DateTime? creationDate; 11 | public List features; 12 | public List IdentificationInfo; 13 | } 14 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/IdentificationInfo.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class IdentificationInfo 4 | { 5 | public string bankAlias; 6 | public string identificationLevel; 7 | } 8 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/MobilePinInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Entities 4 | { 5 | public class MobilePinInfo 6 | { 7 | public DateTime? lastMobilePinChange; 8 | public DateTime? nextMobilePinChange; 9 | public bool? mobilePinUsed; 10 | } 11 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/PassInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Entities 4 | { 5 | public class PassInfo 6 | { 7 | public bool? passwordUsed; 8 | public DateTime? lastPassChange; 9 | public DateTime? nextPassChange; 10 | } 11 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/PinInfo.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class PinInfo 4 | { 5 | public bool? pinUsed; 6 | } 7 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Profile/UserInfo.cs: -------------------------------------------------------------------------------- 1 | using QiwiApiSharp.Enumerations; 2 | 3 | namespace QiwiApiSharp.Entities 4 | { 5 | public class UserInfo 6 | { 7 | public Currency? defaultPayCurrency; 8 | public int? defaultPaySource; 9 | public string email; 10 | public long? firstTxnId; 11 | public string language; 12 | public string @operator; 13 | public string phoneHash; 14 | public bool? promoEnabled; 15 | } 16 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Transaction/Transaction.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Entities 2 | { 3 | public class Transaction 4 | { 5 | public long id; 6 | public TransactionState state; 7 | } 8 | } -------------------------------------------------------------------------------- /QiwiApi/Entities/Transaction/TransactionState.cs: -------------------------------------------------------------------------------- 1 | using QiwiApiSharp.Enumerations; 2 | 3 | namespace QiwiApiSharp.Entities 4 | { 5 | public class TransactionState 6 | { 7 | public PaymentStatus code; 8 | } 9 | } -------------------------------------------------------------------------------- /QiwiApi/Enumerations/Currency.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Enumerations 2 | { 3 | /// 4 | /// Currency identifier. 5 | /// 6 | public enum Currency 7 | { 8 | /// 9 | /// Russia ruble. 10 | /// 11 | RUB = 643, 12 | /// 13 | /// United States Dollar 14 | /// 15 | USD = 840, 16 | /// 17 | /// European Union Euro. 18 | /// 19 | EUR = 978, 20 | /// 21 | /// Kazakhstan Tenge. 22 | /// 23 | KZT = 398 24 | } 25 | } -------------------------------------------------------------------------------- /QiwiApi/Enumerations/Operation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Enumerations 4 | { 5 | /// 6 | /// Wallet operatin. 7 | /// 8 | [Flags] 9 | public enum Operation 10 | { 11 | /// 12 | /// Income operation. 13 | /// 14 | IN = 1, 15 | /// 16 | /// Outcome operation. 17 | /// 18 | OUT = 2, 19 | /// 20 | /// Qiwi card operations. 21 | /// 22 | QIWI_CARD = 4, 23 | /// 24 | /// All operations. 25 | /// 26 | ALL = IN | OUT | QIWI_CARD 27 | } 28 | } -------------------------------------------------------------------------------- /QiwiApi/Enumerations/PaymentStatus.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Enumerations 2 | { 3 | /// 4 | /// Payment transaction status. 5 | /// 6 | public enum PaymentStatus 7 | { 8 | /// 9 | /// Transaction were accepted. 10 | /// 11 | Accepted, 12 | /// 13 | /// Transaction is waiting for processing. 14 | /// 15 | WAITING, 16 | /// 17 | /// Transaction processing success. 18 | /// 19 | SUCCESS, 20 | /// 21 | /// Transaction processing error. 22 | /// 23 | ERROR 24 | } 25 | } -------------------------------------------------------------------------------- /QiwiApi/Enumerations/Provider.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Enumerations 2 | { 3 | /// 4 | /// Transaction provider identifiers. 5 | /// 6 | public enum Provider 7 | { 8 | /// 9 | /// Qiwi wallet. 10 | /// 11 | QiwiWallet = 99, 12 | /// 13 | /// Visa card emitted in Russian Federation. 14 | /// 15 | VisaRus = 1963, 16 | /// 17 | /// MasterCard emitted in Russian Federation. 18 | /// 19 | MasterCardRus = 21013, 20 | /// 21 | /// Visa card emitted in Azerbaijan, Armenia, Belarus, Georgia, Kazakhstan, Kyrgyzstan, Moldova, Tajikistan, Turkmenistan, Ukraine, Uzbekistan; 22 | /// 23 | VisaCIS = 1960, 24 | /// 25 | /// MasterCard emitted in Azerbaijan, Armenia, Belarus, Georgia, Kazakhstan, Kyrgyzstan, Moldova, Tajikistan, Turkmenistan, Ukraine, Uzbekistan; 26 | /// 27 | MasterCardCIS = 21012, 28 | /// 29 | /// MIR payment system emitted card. 30 | /// 31 | MIR = 31652, 32 | /// 33 | /// Tinkoff bank card. 34 | /// 35 | Tinkoff = 466, 36 | /// 37 | /// AlfaBank card. 38 | /// 39 | AlfaBank = 464, 40 | /// 41 | /// PromsvyazBank card. 42 | /// 43 | PromsvyazBank = 821, 44 | /// 45 | /// Russian standard card. 46 | /// 47 | RussianStandard = 815, 48 | /// 49 | /// Mobile phone provider. Is generic by phone number and not used by api. 50 | /// 51 | MobilePhone = -1 52 | } 53 | } -------------------------------------------------------------------------------- /QiwiApi/Enumerations/Source.cs: -------------------------------------------------------------------------------- 1 | namespace QiwiApiSharp.Enumerations 2 | { 3 | /// 4 | /// Payment source identifier. 5 | /// 6 | public enum Source 7 | { 8 | /// 9 | /// Russian Ruble Qiwi Wallet. 10 | /// 11 | QW_RUB, 12 | /// 13 | /// United States Dollar Qiwi Wallet. 14 | /// 15 | QW_USD, 16 | /// 17 | /// Euro Qiwi Wallet. 18 | /// 19 | QW_EUR, 20 | /// 21 | /// Binded card. 22 | /// 23 | CARD, 24 | /// 25 | /// Mobile phone balance. 26 | /// 27 | MK 28 | } 29 | } -------------------------------------------------------------------------------- /QiwiApi/Exceptions/NotInitializedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Exceptions 4 | { 5 | public class NotInitializedException : Exception 6 | { 7 | public override string Message 8 | { 9 | get { return "QiwiApi has not been initalized. Call 'QiwiApi.Initialize(*token*) first."; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /QiwiApi/Exceptions/RequestException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Exceptions 4 | { 5 | public class RequestException : Exception 6 | { 7 | private string _message; 8 | public override string Message 9 | { 10 | get { return _message; } 11 | } 12 | 13 | public RequestException(string message) 14 | { 15 | _message = message; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /QiwiApi/Exceptions/RequestLimitException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Exceptions 4 | { 5 | public class RequestLimitException : Exception 6 | { 7 | public override string Message 8 | { 9 | get { return "Request limit exception (423). Service is temporary unavailable."; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /QiwiApi/Exceptions/TransactionNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Exceptions 4 | { 5 | public class TransactionNotFoundException : Exception 6 | { 7 | public override string Message 8 | { 9 | get { return "Transaction not found exception (404).Transaction were not found or no valid pyments with such signs."; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /QiwiApi/Exceptions/UnauthorizedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Exceptions 4 | { 5 | public class UnauthorizedException : Exception 6 | { 7 | public override string Message 8 | { 9 | get { return "Unauthorized access exception (401). Token is invalid or has been expired."; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /QiwiApi/Exceptions/WalletNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace QiwiApiSharp.Exceptions 4 | { 5 | public class WalletNotFoundException : Exception 6 | { 7 | public override string Message 8 | { 9 | get { return "Wallet not found exception (404). Wallet was not found."; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /QiwiApi/QiwiApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net.Http; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | using Newtonsoft.Json.Linq; 8 | using QiwiApiSharp.Entities; 9 | using QiwiApiSharp.Enumerations; 10 | using QiwiApiSharp.Exceptions; 11 | 12 | namespace QiwiApiSharp 13 | { 14 | public static class QiwiApi 15 | { 16 | private const string API_ENDPOINT = "edge.qiwi.com"; 17 | 18 | public static bool Initialized { get; private set; } 19 | 20 | private static string _token; 21 | private static HttpClient _httpClient; 22 | 23 | #region Public Api 24 | 25 | /// 26 | /// Initializes api with passed. 27 | /// 28 | /// Api token obtained from for instructions. 29 | public static void Initialize(string token) 30 | { 31 | _token = token; 32 | _httpClient = new HttpClient(); 33 | _httpClient.BaseAddress = new Uri("https://" + API_ENDPOINT + "/"); 34 | _httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); 35 | _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); 36 | _httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + _token); 37 | Initialized = true; 38 | } 39 | 40 | /// 41 | /// Identifies mobile provider by phone number. 42 | /// 43 | /// Mobile phone number - 11 digits. 44 | /// Mobile operator identifier. 45 | /// If invalid number passed. 46 | /// If request were not processed. 47 | public static async Task MobileProviderAsync(string phoneNumber) 48 | { 49 | if (!ValidatePhoneNumber(phoneNumber)) throw new ArgumentException("Invalid phone number."); 50 | var response = await _httpClient.PostAsync("https://qiwi.com/mobile/detect.action", new FormUrlEncodedContent(new Dictionary { { "phone", "+" + phoneNumber } })); 51 | response = response.EnsureSuccessStatusCode(); 52 | var responseString = await response.Content.ReadAsStringAsync(); 53 | var content = JsonConvert.DeserializeObject(responseString); 54 | int providerId = 0; 55 | if (int.TryParse(content["message"].Value(), out providerId)) return providerId; 56 | throw new RequestException(content["message"].Value()); 57 | } 58 | 59 | /// 60 | /// Identifies card emitter by card number. 61 | /// 62 | /// Mobile phone number - 16 digits. 63 | /// Card emitter identifier. 64 | /// If invalid number passed. 65 | /// If request were not processed. 66 | public static async Task CardProviderAsync(string cardNumber) 67 | { 68 | if(!ValidateCardNumber(cardNumber)) throw new ArgumentException("Invalid card number."); 69 | var response = await _httpClient.PostAsync("https://qiwi.com/card/detect.action", new FormUrlEncodedContent(new Dictionary { { "cardNumber", cardNumber.ToString() } })); 70 | response = response.EnsureSuccessStatusCode(); 71 | var responseString = await response.Content.ReadAsStringAsync(); 72 | var content = JsonConvert.DeserializeObject(responseString); 73 | int providerId = 0; 74 | if (int.TryParse(content["message"].Value(), out providerId)) return (Provider)providerId; 75 | throw new RequestException(content["message"].Value()); 76 | } 77 | 78 | /// 79 | /// Requests user profile. 80 | /// 81 | /// Is authorization info will be included in response. 82 | /// Is contract info will be included in response. 83 | /// Is user info will be included in response. 84 | /// UserProfileResponse object. See for details. 85 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 86 | /// If token is invalid or were expired. 87 | /// If wallet were not found. 88 | public static async Task UserProfileAsync(bool authInfoEnabled = true, bool contractInfoEnabled = true, bool userInfoEnabled = true) 89 | { 90 | if (!Initialized) throw new NotInitializedException(); 91 | var response = await ApiCallAsync("person-profile/v1/profile/current", new Dictionary 92 | { 93 | {"authInfoEnabled", authInfoEnabled}, 94 | {"contractInfoEnabled", contractInfoEnabled}, 95 | {"userInfoEnabled", userInfoEnabled} 96 | }); 97 | 98 | if (response.IsSuccessStatusCode) 99 | { 100 | var data = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 101 | return data; 102 | } 103 | switch ((int)response.StatusCode) 104 | { 105 | case 401: throw new UnauthorizedException(); 106 | case 423: throw new WalletNotFoundException(); 107 | } 108 | 109 | response.EnsureSuccessStatusCode(); 110 | return null; 111 | } 112 | 113 | /// 114 | /// Requests payment history. 115 | /// 116 | /// Id of wallet for history request. 117 | /// Rows count to request. 118 | /// Wallet operation to include in response. See for possible variaties. 119 | /// Wallet sources to include in response. See for possible variaties. 120 | /// Start date to request history. Must be specified with . 121 | /// End date to request history. Must be specified with . 122 | /// Txn date to request from previous list. See in . Must be specified with . 123 | /// Txn previous id to request from previous list. See in . Must be specified with . 124 | /// PaymentHistoryResponse object. See for details. 125 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 126 | /// If wallet id is not a phone number format. 127 | /// If token is invalid or were expired. 128 | /// If transaction is missing or no transactions can be found with spocified signs. 129 | public static async Task PaymentHistoryAsync(string walletId, int rows, Operation operation, Source[] sources, DateTime? startDate = null, DateTime? endDate = null, DateTime? nextTxnDate = null, long? nextTxnId = null) 130 | { 131 | if (!Initialized) throw new NotInitializedException(); 132 | if (!ValidatePhoneNumber(walletId)) throw new ArgumentException("Invalid wallet id."); 133 | var query = new Dictionary 134 | { 135 | {"rows", rows }, 136 | {"operation", operation.ToString() } 137 | }; 138 | 139 | for (int i = 0; i < sources.Length; i++) 140 | query.Add("source[" + i + "]", sources[i].ToString()); 141 | 142 | if (startDate != null && endDate != null) 143 | { 144 | query.Add("startDate", startDate.Value.ToString("s") + "Z"); 145 | query.Add("endDate", endDate.Value.ToString("s") + "Z"); 146 | } 147 | 148 | if(nextTxnDate != null && nextTxnId != null) 149 | { 150 | query.Add("nextTxnDate", nextTxnDate.Value.ToString("s") + "Z"); 151 | query.Add("nextTxnId", nextTxnId); 152 | } 153 | 154 | var response = await ApiCallAsync("payment-history/v1/persons/" + walletId + "/payments", query); 155 | if (response.IsSuccessStatusCode) 156 | { 157 | var data = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 158 | return data; 159 | } 160 | switch ((int)response.StatusCode) 161 | { 162 | case 401: throw new UnauthorizedException(); 163 | case 404: throw new TransactionNotFoundException(); 164 | } 165 | 166 | response.EnsureSuccessStatusCode(); 167 | return null; 168 | } 169 | 170 | /// 171 | /// Requests payments statistics for period. 172 | /// 173 | /// Id of wallet for history request. 174 | /// Start date to request history. Must be specified with . 175 | /// End date to request history. Must be specified with . 176 | /// Wallet operation to include in response. See for possible variaties. 177 | /// Wallet sources to include in response. See for possible variaties. 178 | /// PaymentStatisticsResponse object. See for details. 179 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 180 | /// If wallet id is not a phone number format. 181 | /// If token is invalid or were expired. 182 | /// If transaction is missing or no transactions can be found with spocified signs. 183 | public static async Task PaymentStatisticsAsync(string walletId, DateTime startDate, DateTime endDate, Operation operation, Source[] sources) 184 | { 185 | if (!Initialized) throw new NotInitializedException(); 186 | if (!ValidatePhoneNumber(walletId)) throw new ArgumentException("Invalid wallet id."); 187 | var query = new Dictionary 188 | { 189 | {"startDate", startDate.ToString("s") + "Z" }, 190 | {"endDate", endDate.ToString("s") + "Z" }, 191 | {"operation", operation.ToString()} 192 | }; 193 | for (int i = 0; i < sources.Length; i++) 194 | query.Add("source[" + i + "]", sources[i].ToString()); 195 | 196 | var response = await ApiCallAsync("payment-history/v1/persons/" + walletId + "/payments/total", query); 197 | if (response.IsSuccessStatusCode) 198 | { 199 | var data = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 200 | return data; 201 | } 202 | switch ((int)response.StatusCode) 203 | { 204 | case 401: throw new UnauthorizedException(); 205 | case 404: throw new TransactionNotFoundException(); 206 | } 207 | 208 | response.EnsureSuccessStatusCode(); 209 | return null; 210 | } 211 | 212 | /// 213 | /// Requests balance for current user. 214 | /// 215 | /// BalanceResponse object. See for details. 216 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 217 | /// If token is invalid or were expired. 218 | /// If wallet were not found. 219 | public static async Task BalanceAsync() 220 | { 221 | if (!Initialized) throw new NotInitializedException(); 222 | var response = await ApiCallAsync("funding-sources/v1/accounts/current", null); 223 | if (response.IsSuccessStatusCode) 224 | { 225 | var data = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 226 | return data; 227 | } 228 | switch ((int)response.StatusCode) 229 | { 230 | case 401: throw new UnauthorizedException(); 231 | case 404: throw new WalletNotFoundException(); 232 | } 233 | 234 | response.EnsureSuccessStatusCode(); 235 | return null; 236 | } 237 | 238 | /// 239 | /// Requests comission for payment provider. 240 | /// 241 | /// Provider id. See for ids, or or to get provider id from phone or card number. 242 | /// CommissionResponse object. See for details. 243 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 244 | public static async Task ComissionAsync(int provider) 245 | { 246 | if (!Initialized) throw new NotInitializedException(); 247 | var response = await ApiCallAsync("sinap/providers/" + provider + "/form", null); 248 | if (response.IsSuccessStatusCode) 249 | { 250 | var data = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 251 | return data; 252 | } 253 | response.EnsureSuccessStatusCode(); 254 | return null; 255 | } 256 | 257 | /// 258 | /// Makes payment to other qiwi wallet. 259 | /// 260 | /// of payment. 261 | /// Funds amount to pay. 262 | /// Phone number of recipient. 263 | /// PaymentResponse object. See for details. 264 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 265 | /// If phone number of recipient is invalid. 266 | /// If token is invalid or were expired. 267 | /// If wallet were not found. 268 | public static async Task QiwiPaymentAsync(Currency currency, double amount, string phoneNumber) 269 | { 270 | if (!Initialized) throw new NotInitializedException(); 271 | if(!ValidatePhoneNumber(phoneNumber)) throw new ArgumentException("Invalid phone number."); 272 | return await PaymentAsync(99, currency, amount, "+" + phoneNumber); 273 | } 274 | 275 | /// 276 | /// Makes moblie payment. 277 | /// 278 | /// of payment. 279 | /// Funds amount to pay. 280 | /// Phone number of to send funds. 281 | /// PaymentResponse object. See for details. 282 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 283 | /// If phone number is invalid. 284 | /// If token is invalid or were expired. 285 | /// If wallet were not found. 286 | public static async Task MobilePaymentAsync(Currency currency, double amount, string phoneNumber) 287 | { 288 | if (!Initialized) throw new NotInitializedException(); 289 | if (!ValidatePhoneNumber(phoneNumber)) throw new ArgumentException("Invalid phone number."); 290 | var providerId = await MobileProviderAsync(phoneNumber); 291 | return await PaymentAsync(providerId, currency, amount, phoneNumber.ToString().Substring(1)); 292 | } 293 | 294 | /// 295 | /// Makes card payment. 296 | /// 297 | /// of payment. 298 | /// Funds amount to pay. 299 | /// Card number of recipient. 300 | /// PaymentResponse object. See for details. 301 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 302 | /// If phone number is invalid. 303 | /// If token is invalid or were expired. 304 | /// If wallet were not found. 305 | public static async Task CardPayment(Currency currency, double amount, string cardNumber) 306 | { 307 | if (!Initialized) throw new NotInitializedException(); 308 | if(!ValidateCardNumber(cardNumber)) throw new ArgumentException("Invalid card number."); 309 | var providerId = await CardProviderAsync(cardNumber); 310 | return await PaymentAsync((int)providerId, currency, amount, cardNumber); 311 | } 312 | 313 | /// 314 | /// Makes bank payment. 315 | /// 316 | /// of payment. 317 | /// Funds amount to pay. 318 | /// Card number of recipient. 319 | /// Card expiration date in 4 digits format. 320 | /// Bank account type. 321 | /// (1 - card, 3 - contract) for . 322 | /// (1 - card, 2 - account) for . 323 | /// (7 - card, 9 - account) for . 324 | /// (1 - card, 2 - account, 3 - contract) for . 325 | /// 326 | /// PaymentResponse object. See for details. 327 | /// If Qiwi Api were not initalized calling QiwiApi.Initialize(*token*). 328 | /// If card or bank account number is invalid. 329 | /// If token is invalid or were expired. 330 | /// If wallet were not found. 331 | public static async Task BankPaymentAsync(Currency currency, double amount, string cardOrAccountNumber, short expDate, short accountType) 332 | { 333 | if (!Initialized) throw new NotInitializedException(); 334 | if(!ValidateCardNumber(cardOrAccountNumber) && !ValidateBankAccountNumber(cardOrAccountNumber)) throw new ArgumentException("Card or bank account number is invalid."); 335 | if(!ValidateExpDate(expDate)) throw new ArgumentException("Invalid expiration date."); 336 | var providerId = await CardProviderAsync(cardOrAccountNumber); 337 | if(!ValidateAccountType(providerId, accountType)) throw new ArgumentException("Invalid account type date."); 338 | return await PaymentAsync((int)providerId, currency, amount, cardOrAccountNumber, expDate, accountType); 339 | } 340 | 341 | #endregion 342 | 343 | #region Internal Api 344 | 345 | private static async Task ApiCallAsync(string request, Dictionary query) 346 | { 347 | string queryString = null; 348 | if (query != null && query.Count > 0) 349 | { 350 | var queryBuilder = new StringBuilder(); 351 | foreach (var param in query) 352 | { 353 | queryBuilder.Append(param.Key); 354 | queryBuilder.Append("="); 355 | queryBuilder.Append(param.Value); 356 | queryBuilder.Append("&"); 357 | } 358 | queryString = queryBuilder.ToString(); 359 | } 360 | queryString = string.IsNullOrEmpty(queryString) ? "" : "?" + queryString; 361 | return await _httpClient.GetAsync(request + queryString); 362 | } 363 | 364 | private static async Task PaymentAsync(int providerId, Currency currency, double amount, string accountId, short expDate = 0, short accountType = 0) 365 | { 366 | var fields = new Dictionary(); 367 | fields.Add("account", accountId); 368 | if (expDate > 0) fields.Add("expDate", expDate.ToString()); 369 | if (accountType > 0) fields.Add("accountType", accountType.ToString()); 370 | 371 | var body = new Dictionary 372 | { 373 | { "id", (int) DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds }, 374 | { "sum", new CurrencyAmount 375 | { 376 | amount = amount, 377 | currency = currency 378 | } 379 | }, 380 | {"source", "account_643"}, 381 | { "paymentMethod", 382 | new { 383 | type = "account", 384 | accountId = 643 385 | } 386 | }, 387 | { "fields", fields } 388 | }; 389 | var response = await _httpClient.PostAsync("sinap/terms/" + providerId + "/payments", new StringContent(JsonConvert.SerializeObject(body))); 390 | if (response.IsSuccessStatusCode) 391 | { 392 | var data = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 393 | return data; 394 | } 395 | switch ((int)response.StatusCode) 396 | { 397 | case 401: throw new UnauthorizedException(); 398 | case 404: throw new WalletNotFoundException(); 399 | } 400 | 401 | response.EnsureSuccessStatusCode(); 402 | return null; 403 | } 404 | 405 | #endregion 406 | 407 | #region Validation 408 | 409 | private static bool ValidateAccountType(Provider providerId, short accountType) 410 | { 411 | switch (providerId) 412 | { 413 | case Provider.Tinkoff: 414 | if (accountType == 1 || accountType == 3) return true; 415 | break; 416 | case Provider.AlfaBank: 417 | if (accountType == 1 || accountType == 2) return true; 418 | break; 419 | case Provider.PromsvyazBank: 420 | if (accountType == 7 || accountType == 9) return true; 421 | break; 422 | case Provider.RussianStandard: 423 | if (accountType == 1 || accountType == 2 || accountType == 3) return true; 424 | break; 425 | } 426 | return false; 427 | } 428 | 429 | private static bool ValidateExpDate(short expDate) 430 | { 431 | if(DigitsCount(expDate) != 4) throw new ArgumentException("Invalid expiration date."); 432 | var m = expDate / 100; 433 | var y = expDate % 100; 434 | return new DateTime(2000 + y, m, 0) > DateTime.Now.Date; 435 | } 436 | 437 | private static bool ValidateBankAccountNumber(string bankAccountNumber) 438 | { 439 | return bankAccountNumber.Length == 16; 440 | } 441 | 442 | private static bool ValidateCardNumber(string cardNumber) 443 | { 444 | return cardNumber.Length == 16; 445 | } 446 | 447 | private static bool ValidatePhoneNumber(string phoneNumber) 448 | { 449 | return phoneNumber.Length == 11; 450 | } 451 | 452 | private static long DigitsCount(long n) 453 | { 454 | return (long) (n == 0 ? 1 : Math.Floor(Math.Log10(Math.Abs(n)) + 1)); 455 | } 456 | #endregion 457 | } 458 | } -------------------------------------------------------------------------------- /QiwiApi/QiwiApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;net5.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard1.7;netstandard2.0;netstandard2.1 4 | QiwiApiSharp 5 | True 6 | 0 7 | 8 | Dmitrii Osipov 9 | .NET Core compatiable C# Wrapper for QIWI Api. For bots and other stuff based on .NET Core and .NET Framework platforms. 10 | https://github.com/blackboneworks/qiwi-api-sharp 11 | https://github.com/blackboneworks/qiwi-api-sharp/blob/master/LICENSE 12 | https://github.com/blackboneworks/qiwi-api-sharp 13 | Git 14 | qiwi, api, payments 15 | 16 | 17 | 18 | 1.0.0.$(VersionSuffix) 19 | 1.0.0.$(VersionSuffix) 20 | 1.0.0.$(VersionSuffix) 21 | 22 | 23 | 24 | 25 | QiwiApiSharp 26 | https://www.syl.ru/misc/i/ai/164256/595866.jpg 27 | 28 | 29 | 30 | 31 | none 32 | False 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /QiwiApi/Responses/BalanceResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using QiwiApiSharp.Entities; 3 | 4 | namespace QiwiApiSharp 5 | { 6 | public class BalanceResponse 7 | { 8 | public List accounts; 9 | } 10 | } -------------------------------------------------------------------------------- /QiwiApi/Responses/ComissionResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using QiwiApiSharp.Entities; 3 | 4 | namespace QiwiApiSharp 5 | { 6 | public class CommissionResponse 7 | { 8 | public CommissionResponseContent content; 9 | } 10 | 11 | public class CommissionResponseContent 12 | { 13 | public CommissionResponseTerms terms; 14 | } 15 | 16 | public class CommissionResponseTerms 17 | { 18 | public CommissionResponseComission commission; 19 | } 20 | 21 | public class CommissionResponseComission 22 | { 23 | public List ranges; 24 | } 25 | } -------------------------------------------------------------------------------- /QiwiApi/Responses/PaymentHistoryResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using QiwiApiSharp.Entities; 4 | 5 | namespace QiwiApiSharp 6 | { 7 | public class PaymentHistoryResponse 8 | { 9 | public List data; 10 | public long? nextTxnId; 11 | public DateTime? nextTxnDate; 12 | } 13 | } -------------------------------------------------------------------------------- /QiwiApi/Responses/PaymentResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using QiwiApiSharp.Entities; 3 | 4 | namespace QiwiApiSharp 5 | { 6 | public class PaymentResponse 7 | { 8 | public string id; 9 | public CurrencyAmount sum; 10 | public Dictionary fields; 11 | public string source; 12 | public Transaction transaction; 13 | } 14 | } -------------------------------------------------------------------------------- /QiwiApi/Responses/PaymentStatisticsResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using QiwiApiSharp.Entities; 3 | 4 | namespace QiwiApiSharp 5 | { 6 | public class PaymentStatisticsResponse 7 | { 8 | public List incomingTotal; 9 | public List outgoingTotal; 10 | } 11 | } -------------------------------------------------------------------------------- /QiwiApi/Responses/UserProfileResponse.cs: -------------------------------------------------------------------------------- 1 | using QiwiApiSharp.Entities; 2 | 3 | namespace QiwiApiSharp 4 | { 5 | public class UserProfileResponse 6 | { 7 | public AuthInfo authInfo; 8 | public ContractInfo contractInfo; 9 | public UserInfo userInfo; 10 | } 11 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # qiwi-api-sharp 2 | .NET Core compatiable C# Wrapper for QIWI API 3 | 4 | | **Build:** | **NuGet:** | 5 | | ---------- | ---------- | 6 | | [![Build status](https://ci.appveyor.com/api/projects/status/c7y65lkrf357s9aj/branch/master?svg=true)](https://ci.appveyor.com/project/blackboneworks/qiwi-api-sharp/branch/master) | [![NuGet](https://img.shields.io/nuget/v/QiwiApiSharp.svg)](https://www.nuget.org/packages/QiwiApiSharp) [![NuGet](https://img.shields.io/nuget/dt/QiwiApiSharp.svg)](https://www.nuget.org/packages/QiwiApiSharp) | 7 | 8 | # supported platforms 9 | Currently there are not so much supported platforms 10 | * .NET Standard 1.1 11 | * .NET Standard 1.2 12 | * .NET Standard 1.3 13 | * .NET Standard 1.4 14 | * .NET Standard 1.5 15 | * .NET Standard 1.6 16 | * .NET Standard 2.0 17 | * .NET Framework 4.5 18 | * .NET Framework 4.6 19 | * .NET Framework 4.6.1 20 | * .NET Framework 4.6.2 21 | * .NET Framework 4.7 22 | 23 | More platforms will be supported soon. 24 | 25 | # usage 26 | 1. Get token at https://qiwi.com/api 27 | 2. Call `QiwiApi.Initialize("*tokent*)` to initialize api. 28 | 3. Call `QiwiApi.UserProfile()` to get user profile data. 29 | 4. Call any other method. 30 | 31 | # restrictions 32 | There are 2 mehtods you can call without initializing api: 33 | * `QiwiApi.MobileProvider()` 34 | * `QiwiApi.CardProvider()` 35 | 36 | Both of them used to identify phone or card number to use in payment methods. 37 | Other methods must be used with proper specified _token_. 38 | 39 | # issues 40 | If you have some issues - feel free to create it in [https://github.com/blackboneworks/qiwi-api-sharp/issues](issued) page. 41 | 42 | # contributing 43 | 1. Fork the _develop_ branch of [https://github.com/blackboneworks/qiwi-api-sharp](repository) 44 | 2. Commit your changes in small, incremental steps with clear descriptions 45 | 3. When ready, issue a Pull Request (PR) against the _develop_ branch of [https://github.com/blackboneworks/qiwi-api-sharp](repository) 46 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "5.0.*", 4 | "rollForward": "latestFeature" 5 | } 6 | } --------------------------------------------------------------------------------