Skip to content

Commit

Permalink
Merge pull request #74 from siisltd/feature/detect_delivery_error_in_…
Browse files Browse the repository at this point in the history
…iqsms

Convert iqsms response with text "invalid mobile phone" to delivery error
  • Loading branch information
xpg934 authored Sep 19, 2024
2 parents d8bb4e6 + 9190ca2 commit f5eef7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/SMS/Curiosity.SMS.Iqsms/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.0.3]

Convert response with text "invalid mobile phone" to delivery error.

## [1.0.2]

Detect no money message.
Expand Down
2 changes: 1 addition & 1 deletion src/SMS/Curiosity.SMS.Iqsms/Curiosity.SMS.Iqsms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageVersion>1.0.2</PackageVersion>
<PackageVersion>1.0.3</PackageVersion>
<PackageIcon>siisltd.png</PackageIcon>
<Title>Curiosity.SMS.Iqsms</Title>
<Description>Classes for sending SMS via iqsms.ru.</Description>
Expand Down
3 changes: 3 additions & 0 deletions src/SMS/Curiosity.SMS.Iqsms/IqsmsSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ private async Task<Response<SmsSentResult>> SendSmsAsync(
{
case "not enough balance":
return Response.Failed(new Error((int)SmsError.NoMoney, response.Content!), new SmsSentResult(null, null, response.Content!));

case "invalid mobile phone":
return Response.Failed(new Error((int)SmsError.DeliveryError, response.Content!), new SmsSentResult(null, null, response.Content!));

default:
return Response.Failed(new Error((int)SmsError.Unknown, response.Content!), new SmsSentResult(null, null, response.Content!));
Expand Down

0 comments on commit f5eef7d

Please sign in to comment.