Farapayamak 1.0.0

dotnet add package Farapayamak --version 1.0.0                
NuGet\Install-Package Farapayamak -Version 1.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="Farapayamak" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Farapayamak --version 1.0.0                
#r "nuget: Farapayamak, 1.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 Farapayamak as a Cake Addin
#addin nuget:?package=Farapayamak&version=1.0.0

// Install Farapayamak as a Cake Tool
#tool nuget:?package=Farapayamak&version=1.0.0                

Farapayamak

Farapayamak is an Iranian SMS provider and this package is an auxiliary service for its convenient use. So you can use it in .Net Core projects and use DI with custom configuration.

First, you must create base account on farapayamak.ir

Authors

Features

  • Send single and multiple SMS at time.
  • GetMessages from Inbox and Outbox
  • Get Credit and balance account
  • DI (IFarapayamakService)

Install

Install with Package Manager Console

  Install-Package Farapayamak

Add/DI

// you must set configuration when add Service in 'Startup' Class
public void ConfigureServices(IServiceCollection services)
{
    services.AddFarapayamakSMSProvider(options => {
         options.Username = "nilesoft.ir";
         options.Password = "lakejrf!#$RASF@";
         options.DefaultNumber = "500012701212122323"; // your number in Farapayamak Panel
         options.UseDefaultIsFlash = false; // default false
         options.MaxReciveMessageCount = 100; // default 50, when you need get sms from panel inbox or outbox
    });
}

Panel/Info

public class AccountController : Controller
{

    private readonly IFarapayamakService _smsService;
    public AccountController(IFarapayamakService smsService)
    {
         _smsService = smsService;
    }


    public async Task PanelInfo()
    {
         var accCredit = await _smsService.GetCredit();
            // Result 
            // accCredit.IsSuccess      (bool)
            // accCredit.Credit         (decimal)

         var accBasePrice = await _smsService.GetBasePrice();
            // Result 
            // accBasePrice.IsSuccess   (bool)
            // accBasePrice.BasePrice   (decimal)

          var accBalance = await _smsService.GetAccountBalance();
            // Result 
            // accBalance.IsSuccess     (bool)
            // accBalance.Balance       (decimal)

          var userNumbers = await _smsService.GetUserNumbers();
            // Result 
            // userNumbers.IsSuccess     (bool)
            // userNumbers.Response      (string) action message
            // userNumbers.Numbers       (list of string)
     }
}

Send Single Message

public async Task SendSingleMessage()
{
       // use defualt panel number, you setting up a configuration Time
       var sendResult = await _smsService.SendAsync("09127706148","Hi dear [thisisnabi]");
             
       // use custom panel number [xxx is your panel number]
       var sendResult = await _smsService.SendAsync("xxx","09127706148", "Hi dear [thisisnabi]");

       // Result
       // sendResult.IsSuccess     (bool)
       // sendResult.Response      (string) action message
       // sendResult.RecivedId     (long) if send was a failure, you get -1.
}

Get/Inbox|Outbox Messages

public async Task GetInboxOutBoxMessages()
{ 
      // use index 0, you can pass index
      var inboxMessages = await _smsService.GetInboxMessagesAsync();
          // Result
          // inboxMessages.IsSuccess     (bool)
          // inboxMessages.Response      (string) action message
          // inboxMessages.Messages      (list of MessageItemModel)

       // use index 0, you can pass index
       var outboxMessages = await _smsService.GetOutboxMessagesAsync();
           // Result
           // outboxMessages.IsSuccess     (bool)
           // outboxMessages.Response      (string) action message
           // outboxMessages.Messages      (list of MessageItemModel)
}

Get/ Message Status

public async Task GetMessageStatus()
{
      // use defualt panel number
      var sendResult = await _smsService.SendAsync("09127706148", "Hi dear [thisisnabi]");
          // Result
          // sendResult.IsSuccess     (bool)
          // sendResult.Response      (string) action message
          // sendResult.RecivedId     (long) if send was a failure, you get -1.
          
      if (sendResult.IsSuccess)
      {
          var msgStatus = await _smsService.GetMessageStatusAsync(sendResult.RecivedId);
             // msgStatus.IsSuccess     (bool)
             // msgStatus.Response      (string) action message
      }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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
1.0.0 229 7/8/2022