Skip to content

sms service migration to gupshup.#40

Open
paahaad wants to merge 3 commits into
code100x:mainfrom
paahaad:migrate/gupshup
Open

sms service migration to gupshup.#40
paahaad wants to merge 3 commits into
code100x:mainfrom
paahaad:migrate/gupshup

Conversation

@paahaad

@paahaad paahaad commented Feb 2, 2025

Copy link
Copy Markdown

Solves: #39

This PR includes the Gupshup migration with rate limiting, where a user is blocked for 30 minutes after three OTP attempts.

Process Overview

To send transactional SMS in India, we must register a sender ID (header) and an SMS template on the DLT platform, a blockchain system used by all telecom operators. Registration is done via the operator's portal (e.g., Jio's portal, it requies a PAN card and an annual fee of around ₹5,900. Once registered, we can register as many as header and template (template ID).

This template ID is then provided to Gupshup via their API to send SMS. Gupshup has tieup with telecom operators. it also requires PAN card verification for registration.

NOTE: This PR is not yet complete. I've requested access to a Gupshup account with my pen card, and once I receive the API key, I'll perform end-to-end testing and finalize the PR.

In the meantime, I’d appreciate a code review.

)));
}

// update db count :TODO: Make sure to move this line below before push

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this comment 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh' that was reminder to myself I forget to remove that. Ill do that in final PR.
actually code should be this:

let _ = self.client.post(&self.gupshup_url).body("").send().await?;
let _ = state.db.update_otpc_by_number(&number).await?;

first send the otp. if otp send success then update the count.

@paahaad

paahaad commented Feb 8, 2025

Copy link
Copy Markdown
Author

@Praashh This is taking little longer. I haven't received the api keys yet. I'll keep you posted.
image

@Praashh

Praashh commented Feb 8, 2025

Copy link
Copy Markdown
Contributor

@Praashh This is taking little longer. I haven't received the api keys yet. I'll keep you posted. image

don't we have test keys on gubshub sir?

@paahaad

paahaad commented Feb 8, 2025

Copy link
Copy Markdown
Author

No, I also find this weird. I spoke to the support team, and they said you need to email them to get the keys.

@paahaad

paahaad commented Feb 15, 2025

Copy link
Copy Markdown
Author

@Praashh This is complete. Please let me know if anything else is needed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants