M
M
Moldovich2016-05-30 12:22:39
PHP
Moldovich, 2016-05-30 12:22:39

How to send SMS securely in PHP?

We send SMS to buyers through the gateway (TurboSMS) using SoapClient. If the gateway is not available (DDOS or preventive maintenance),
the order is not placed, the buyer sees page 500, this is bad.
How to safely send sms without emulating multithreading and creating daemons?
Can somehow ping if there is an answer - we send if not - then we issue the order without SMS? In general, you need a quick working version without claims for the correctness of the architecture and other practices, because. Now everything generally works stupidly, the accessibility check is also simple, that's how to organize it I would be glad to hear. Thank you in advance for your help.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2016-05-30
@Moldovich

If the gateway is not available (DDOS or preventive maintenance),
the order is not placed, the buyer sees page 500, this is bad
So you have an error in your code that you do not intercept.
Handle errors.
Learn PHP: php.net/manual/en/language.exceptions.php
Это противоречивые понятия. В долгосрочной перспективе вариант без претензий на правильность архитектуры и прочие практики не будет рабочим.

Александр Аксентьев, 2016-05-30
@Sanasol Куратор тега PHP

Ну так отправлять запрос и ждать ответ, если не получили - проводим без смс.
Сами всё описали.
Код готовый никто не даст.

Александр Кубинцев, 2016-05-30
@akubintsev

Делается очередь (в реляционной БД или nosql). Дальше крон-задача бегает по очереди и пытается отсылать запрос в сервис СМС. Можно реализовать несколько попыток с прогрессивным таумаутом.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question