DEV Community

MrNaif2018
MrNaif2018

Posted on • Edited on

Twiliohackathon Project - Pay for twilio services with cryptocurrency

Edit: unfortunately I didn't organize my time to do it properly(study, exams), but when I get more free time I will finish it anyway, as this would be a great example of using twilio and my API I think, sorry for not finishing it in time. I will update this post anyway.

What I want to build

I want to create an application which will allow using twilio APIs by paying for usage with cryptocurrency. Currently due to COVID-19, sometimes it's not that easy to manage paper money or fiat money. I think in that situation internet money(cryptocurrencies) help a lot.
There will be a graphical interface to select twilio service(I will start from SMS), where user will be prompted to pay for usage in cryptocurrency first, and then they will be able to use the API endpoint. Probably if all goes right I will also write a small API wrapper for any twilio endpoint, not sure yet.
How will the price be calculated? Using twilio pricing API I am going to take the price USD value, and use that for invoice creation, the payment work is handled by my API(so it is also an example integration with other APIs).

Demo Link

https://twilio-crypto-payments.now.sh/
I started from setting up production deployment for being able to share the progress

Link to Code

GitHub logo MrNaif2018 / twilio-crypto-payments

Pay and use many different twilio services via cryptocurrencies(Made for Twilio & Dev.to Hackathon)

Pay for twilio services and use them(sms, voice, video, messenger) via cryptocurrencies

This project is built for Dev.to & Twilio hackathon.

It fits in category 3: integrating twilio APIs with other APIs(in my case, my own API and SDK - bitcart).

TODO: implement everything




How I built it (what's the stack? did I run into issues or discover something new along the way?)

I am using Vue.js with it's Nuxt.js framework(for PWA and other nice things), as UI framework I am going to use Vuetify.js, and as backend server I am going to use integrated Nuxt.js server.
The payment API is in Python, but the purpose of this application is integrate twilio API with the payment API.
I am going to use Twilio Pricing API, Programmable SMS, Programmable Video etc. Not sure yet, ideally it would be a wrapper around all twilio APIs.

Screenshots

Day 1

Additional Resources/Info

I will be posting progress reports there

Day 1

I started with create-nuxt-app with vuetify.js template
Then I decided to setup deployment first, to see the progress live.
I have found out that there is a hosting for SSR apps - now.sh, using nuxtjs/now-builder and after some issues(process.env.npm_* not accesible), I have set it up.
Then I've cleared up layouts, and added my favourite day/night mode switch and automatic switching to night mode between 8 pm and 6 am (:
Then I have added first input fields, and telephone input.
Not sure yet which twilio phone number to use, maybe will make a select of available numbers.
From investigating a little bit I think that I will use nuxt serverMiddleware for handling http POST IPN requests from payment API, and for fetching data from trello(so not exposing secrets to client).

More progress coming soon.
Any early feedback welcome!

Top comments (2)

Collapse
 
lizziepika profile image
Lizzie Siegle

Love the dark mode trigger button! I was unable to send a SMS in the demo though--no button to send and clicking return just added a new line.

Collapse
 
mrnaif2018 profile image
MrNaif2018

Thank you! It isn't implemented yet, as I wasn't at home and was using an old laptop, but I found a service gitpod.io for that purpose. Today I will return back and write about my discoveries, as well as another competition I am participating in which is the most unusual one I have ever seen! Will write articles about all that.