Skip to content

Conversation

@paahaad
Copy link

@paahaad paahaad commented Feb 2, 2025

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
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
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
Copy link
Author

paahaad commented Feb 8, 2025

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

@Praashh
Copy link
Contributor

Praashh commented Feb 8, 2025

@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
Copy link
Author

paahaad commented Feb 8, 2025

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
Copy link
Author

paahaad commented Feb 15, 2025

@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