__wf_reserved_heredar
__wf_reserved_heredar
__wf_reserved_heredar
¿Qué hay de nuevo?
Producto
¿Quién usa Directual?
Qué se puede construir en Directual
Aprenda Directual
¿Por qué Directual?
Recursos
Jurídico
Empresa

New Directual Billing — and how we built it

Big news: we’ve updated the billing section on our platform! That’s the module responsible for calculating virtually everything: tariff plans, developer seats, the cost of on-demand resources depending on the plan, discounts, and promo codes. Long story short, it’s a rather sophisticated part of the platform, built on the platform itself! Find the breakdown of it all below, folks.

The billing section and what it is

Billing is a substantial part of the platform’s functionality, which includes:

  • Pricing grid: both for app plans and team plans
  • User balance accounting
  • Account balance top-ups—recurring or ad hoc
  • Balance charges based on the plan: recurring licenses and on-demand resource consumption
  • Support for a variety of top-up methods, including PayPal, bank cards, and (oh yeah!) crypto
  • Grant and promo-code framework (with a complex logic)

All of that can help you ensure proper functionality of your platform, comfortable account balance deposits, and transparency when it comes to spending. All in all, this section of the platform is complex, necessary, and (most importantly) under heavy load. 

Below you will learn what we did and how to get there (because now you can do precisely the same thing by using our miracle of science platform!).

Internal D-coins

For all purposes of internal accounting, we’ve launched a stablecoin named Directual-coin (or D-coin), placed in the Ethereum network.

Here’s how you can get these nice and freshly minted coins:

  • Buy D-coins based on 1 coin = 1 dollar exchange rate (with both fiat and crypto transactions)
  • Get D-coins as a reward for affiliate activities (we’ll let you know about the partnership program in May!)
  • Receive grants in D-coins (see the section on promo-codes below)

These coins can be used to pay for the app and team plans, as well as for on-demand resource consumption.

Promo-codes

This is one of the most flexible and comfortable systems that you can use to transfer D-coins to users’ accounts. In the “billing” section, you can press the “Add funds” button and apply a promo code. The code is processed based on the scenario, see how in detail below:

A couple of words on what kind of promo codes are out there:

  • Multi-use promo codes, suitable for anyone and any occasion
  • Single-use promo codes, which any user can apply
  • Promo codes that can be applied only by the users on a list
  • Base promo codes (only one can be applied) and special (can be applied any number of times)
  • Time-based and indefinite promo codes

To make this particular feature, we’ve built a promo-code database, which is connected with this endpoint:

Do note, we’ve connected a synchronic scenario here, which receives the promo-code and user ID at the start, and produces the result based on its own backend logic (success/fail) at the end. You can see the logic in the picture below:

A prize for the patient!

For everyone who made it this far, a promo code worth $50 in D-coins: WELCOME

Get it while it’s hot!

Credit cards processing

Promo-codes are good and all, and yet you’ll need to be able to top up your account with more traditional means, including bank cards and PayPal. Our scenarios to the rescue once again. Here’s what we did:

  • Integrated the receiving of transaction data (through a webhook) through two payment gateways: Paddle and Tinkoff (which covers PayPal, Visa, Mastercard, and increasingly popular MIR cards)
  • Made two scenarios for processing of objects received by the webhook
Paddle processing
Tinkoff processing

And this beauty is the result you can get. That’s the transaction history of both withdrawals and deposits.

Crypto payments

If you can recall, recently we’ve been boasting about our new blockchain integration. Here’s what it looks like in real life! Even right now, you can use the “Add funds” button and see an option to pay with crypto:

All of this is made on the very same plugins we’ve covered in the recent blog post. See what the real crypto payment processing scenarios look like:

Every client gets their own wallet which will then be able to receive payments (consolidated later on our single wallet). Above you can see the scenario that monitors all the wallets and collects the transactions heading their way. 

After that, the transactions are processed:

Here’s what we do with the transaction itself:

  • Monitor what network and token it is (Ethereum, Matic, USDC, etc)
  • Normalize it (by reducing it to decimal form)
  • Convert it into USD on exchange rate pulled from Coinbase exchange
  • Deposit D-coins to the user’s balance

No headache whatsoever — it’s all nice and dandy!

Teams and Apps creating/updating

Another super cool scenario responsible for the creation of a team or an app, as well as tariff plan downgrade or upgrade:

It is a rather advanced scenario that combines a number of various logic cores designed for team plans and apps, no question about it. However, just imagine—how many programmer-hours you’d have to spend trying to recreate all of that yourself? We can’t either. All it took for us is a week — including debugging. Yup.

What next?

Soon we’ll finish our affiliate program (of course, built on our scenarios as well) and show how it works. We’ll also continue to introduce new networks and tokens that you can use for payment (just next week we’ll release a plugin for another awesome network — NEAR).

Conclusion

And that, folks, is how we managed to build a very complex part of the platform on the platform itself! It just works. Our main message here is that any user can do the same (or another web3-app), including you!

FAQ

What is crypto?
What is crypto?

A cryptocurrency, crypto-currency, or crypto is a digital currency designed to work as a medium of exchange through a computer network that is not reliant on any central authority, such as a government or bank, to uphold or maintain it.

What is a webhook?
What is a webhook?

A webhook in web development is a method of augmenting or altering the behavior of a web page or web application with custom callbacks. These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application.

Featured blog posts

Подробное руководство по продуктивности для no-code разработчиков

Откажитесь от бесполезных показателей производительности и стимулируйте энтузиазм разработчиков и реальные результаты! 🚀 Узнайте, как повысить эффективность команды и уменьшить стресс.

October 25, 2024
by
Павел Ершов

Полное руководство по no-code системам управления инцидентами

Неполадки случаются постоянно, поэтому без системы управления инцидентами (IMS) отслеживание проблем превращается в настоящий ад. Этот гайд поможет вам разобраться с ситуацией правильным образом.

Low-code против No-code: Кто победитель?

Откажитесь от кода и присоединяйтесь к революции low-code/no-code! Получите возможность быстрой разработки приложений, автоматизации процессов и инноваций, не прилагая особых усилий (и не превышая бюджет). Перетаскивание, создание и возможность удивлять с помощью простого способа создания кастомных приложений.

Сертификация Directual: Станьте официальным экспертом и предлагайте услуги на платформе

Нанимайте разработчиков для реализации своих проектов и предлагайте собственные услуги для реализации чужих! Все это прямо в Directual. Заходите, чтобы узнать больше.

September 21, 2024
by
Павел Ершов

Чат-боты WhatsApp для бизнеса: Практическое руководство на 2024 год

WhatsApp — это поле битвы за привлечение клиентов. Изучите реальные истории успеха, узнайте, как создать свой собственный чатбот, и оставайтесь в курсе перспективных тенденций.

Топ-20 инструментов для создания чат-ботов с искусственным интеллектом для мира no-code

ИИ чат-боты! Узнайте, кто в тренде, кто нет, и как создать своего собственного помощника с ИИ, чтобы добиться максимальной продуктивности с no-code.

Готовы создать
приложение своей мечты?

Присоединяйтесь к 22 000+ разработчикам на Directual и создавайте проекты быстрее и дешевле. Визуальный интерфейс упрощает разработку, а мощные базы данных и бэкенд делают масштабирование легким и эффективным.