Giter Club home page Giter Club logo

apg-sdk-csharp's Introduction

Com.AyriaPlatform.APG - the C# library for the APG API

This is a APG (Ayria Payment Gateway) API SDK.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.2.1
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Com.AyriaPlatform.APG.Api;
using Com.AyriaPlatform.APG.Client;
using Com.AyriaPlatform.APG.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Com.AyriaPlatform.APG.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Com.AyriaPlatform.APG.Api;
using Com.AyriaPlatform.APG.Client;
using Com.AyriaPlatform.APG.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration.Default.BasePath = "https://api.ayria.club/apg/v1";
            // Configure API key authorization: APG-API-KEY
            Configuration.Default.ApiKey.Add("APG-API-KEY", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("APG-API-KEY", "Bearer");

            var apiInstance = new PaymentApi(Configuration.Default);
            var APG_WALLET_ID = APG_WALLET_ID_example;  // string | 
            var referenceCode = referenceCode_example;  // string | ReferenceCode of payment to return

            try
            {
                // Find payment with referenceCode
                AyriaPaymentV1DTO result = apiInstance.GetPaymentByReferenceCode(APG_WALLET_ID, referenceCode);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling PaymentApi.GetPaymentByReferenceCode: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.ayria.club/apg/v1

Class Method HTTP request Description
PaymentApi GetPaymentByReferenceCode GET /get/{referenceCode} Find payment with referenceCode
PaymentApi GetPayments GET /list List of payments between given dates
PaymentApi PaymentCancel POST /cancel Cancel a payment
PaymentApi PaymentCreate POST /create Add a new payment
PaymentApi VerifyPaymentByReferenceCode POST /verify/{referenceCode} Verify payment with referenceCode

Documentation for Models

Documentation for Authorization

APG-API-KEY

  • Type: API key

  • API key parameter name: APG-API-KEY

  • Location: HTTP header

apg-sdk-csharp's People

Contributors

sidmorad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.