Moyasar 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Moyasar --version 2.0.0
NuGet\Install-Package Moyasar -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Moyasar" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Moyasar --version 2.0.0
#r "nuget: Moyasar, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Moyasar as a Cake Addin
#addin nuget:?package=Moyasar&version=2.0.0

// Install Moyasar as a Cake Tool
#tool nuget:?package=Moyasar&version=2.0.0

Moyasar.Net

Build Status

Moyasar's .NET Client Library

Target Frameworks

This library targets following frameworks:

  1. .Net Standard 2.0
  2. .Net Framework 4.0

Installation

If you are using dotnet command line tools you can add the library to your project using the following command

dotnet add package moyasar

Or if you are using Nuget Package Manager

PM> Install-Package moyasar

Manual Installation

Please note that this installation method is not recommended

To Install the library manually please download the last release from the releases section and reference it in your project.

Usage

Setup

Make sure to set the API key before proceeding

MoyasarService.ApiKey = "YouKeyHere";

Payment

Make sure you always try to catch the following exceptions:

ValidationException

NetworkException

ApiException

To fetch a payment from Moyasar, use the following:

Payment.Fetch("Payment-Id");

To refund a payment, one must have a Payment instance somePayment then invoke the following:

somePayment.Refund();

To update your payment, change Description property on that payment, then invoke Update:

somePayment.Description = "Colombia, Narino Sandona, Medium Roast (Special)";
somePayment.Update();

To list or search for payments at Moyasar, do the following:

var result = Payment.List();

or

var result = Payment.List(new SearchQuery()
{
    Id = "SomeId",
    Source = "creditcard OR sadad",
    Status = "some status",
    Page = 2,
    CreatedAfter = DateTime.Now.AddDays(-5),
    CreatedBefore = DateTime.Now
});

All SearchQuery parameters are optional, use what is needed

Invoice

Use Invoice class with the same methods as Payment class, except for the following:

To create an invoice for example:

var invoice = Invoice.Create(new InvoiceInfo()
{
    Amount = 7000,
    Currency = "SAR",
    Description = "A 70 SAR invoice just because",
    ExpiredAt = DateTime.Now.AddDays(3),
    CallbackUrl = "http://www.example.com/invoice_callback"
});

To Cancel an Invoice:

someInvoice.Cancel();

For more details, please refer to the official documentation: https://moyasar.com/docs/api/

Testing

To run the tests use the following command

dotnet test
Product 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 net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.0 5,133 11/12/2021
2.2.0 1,259 4/27/2021
2.0.3 1,503 4/8/2020
2.0.2 1,219 12/24/2019
2.0.1 1,084 7/10/2019
2.0.0 1,146 3/25/2019
0.8.0 1,256 12/25/2018
0.7.0 1,632 5/5/2018
0.6.0 1,442 2/21/2018
0.5.0 1,385 11/19/2017
0.4.0 1,470 7/19/2017
0.3.0 3,270 12/19/2016