Skip to content

feat: implement Telesign SMS provider (US / Global) #54

Open

Description

@teesofttech

Summary

Implement the Telesign SMS provider inside src/SmsBridge/Providers/Telesign/.

Telesign is a US/global identity and communications provider with SMS messaging APIs. This adds another established US/global provider for verification and transactional messaging use cases.

Official docs:

Files to create

  • src/SmsBridge/Providers/Telesign/TelesignSmsProvider.cs
  • src/SmsBridge/Providers/Telesign/TelesignSmsRequestMapper.cs
  • src/SmsBridge/Providers/Telesign/TelesignSmsResponseMapper.cs
  • src/SmsBridge/Options/TelesignOptions.cs
  • Register UseTelesign() in src/SmsBridge/DependencyInjection/SmsBridgeProviderBuilder.cs
  • Add HttpClientNames.Telesign in src/SmsBridge/Internal/Http/HttpClientNames.cs
  • Add SmsProviderType.Telesign to the enum

Telesign API Details

  • Messaging endpoint commonly documented as: POST https://rest-ww.telesign.com/v1/messaging
  • Auth: Customer ID plus API key using Telesign request signing
  • Request fields commonly include:
    phone_number=15557654321
    message=Hello from SMSBridge
    message_type=ARN
    
  • Response includes a provider reference id and status/error details.

Options

public sealed class TelesignOptions
{
    public required string CustomerId { get; init; }
    public required string ApiKey { get; init; }
    public string MessageType { get; init; } = "ARN";
}

Implementation Notes

  • Confirm the current Telesign signing requirements during implementation; their docs are hosted behind a dynamic ReadMe site and the exact endpoint page should be rechecked before coding.
  • Keep the request signing helper private to the Telesign provider unless another provider needs the same scheme.
  • Map the provider reference id to SmsSendResult.ProviderMessageId.
  • Map Telesign status/error payloads into SMSBridge success/failure semantics.

Tests to add

  • tests/SmsBridge.ProviderTests/TelesignResponseMapperTests.cs
  • tests/SmsBridge.ProviderTests/TelesignProviderTests.cs
  • Unit tests for Telesign request signing

Acceptance Criteria

  • Provider signs Telesign requests using CustomerId and ApiKey
  • Provider sends via the current Telesign SMS/messaging endpoint using IHttpClientFactory
  • Request mapper emits phone_number, message, and message_type
  • Response mapper maps provider reference id to SmsSendResult.ProviderMessageId
  • Provider maps Telesign status/error responses to failed SmsSendResult
  • Transient HTTP failures set IsTransientFailure = true
  • UseTelesign() registers the provider in DI
  • All tests pass - dotnet test
  • dotnet build has 0 warnings

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions