- Create model in
orders
tableorderNumber
- генерировать UUID
- Create model in
jobs
table только если рекуррентный платеж- заполняем
orderId
,frequency
- в месяцах,amount
в копейках,currencyCode
(643 - rubles, 051 - dram, 840 - USD Dollars)
- заполняем
- Отправляем запрос в банк с
returnUrl
in Jobs table
- успешность платежа
- bindingId
- nextPaymentDate = createdAt + frequency
- status = ENABLED | DISABLED
- Мы берем из
jobs
гдеstatus = ENABLED and isProcessing = 0 and nexPaymentDate < now() and attempts < 2
isProcessing = 1
- Request order from bank
- Pay order by bindingId
- unsuccessful order
- attempt++
- nextPaymentDate + 1
- attempts >= 2
- status = DISABLED
- disableReason
- disabledDate
- successful order
- attempts = 0
- nextPaymentDate += frequency
- unsuccessful order
- isProcessing = 0