Chimoney / chimoney-community-projects

Repo for Community Contributors
http://api.chimoney.io/
MIT License
136 stars 172 forks source link

Web: P2P App for Sending Gift Card, Airtime, Mobile Money, Crypto etc #16

Open uchibeke opened 2 years ago

uchibeke commented 2 years ago

Create a web app with any framework using Chimoney's API

Below are some features but feel free to get creative

ezechuka commented 2 years ago

@uchibeke how does a user sign into a subaccount? Is there an endpoint for it?

uchibeke commented 2 years ago

No. A user doesn't sign in to a sub account

A subaccount is under the main account and controlled by the main account and you can initiate all Chimoney transactions as a subaccount by passing subAccount=sub_account_id to all Chimoney API calls.

For example, you can payout/airtime to send Airtime from the sub-account AKA the wallet of the sub-account is debited

You can create and manage sub-accounts for your main account.

So for this issue, you have normal users in your app who can auth to your app, but maybe as part of their profile, you have the chimoneySubAccount ID which automatically gives you

ezechuka commented 2 years ago

Interesting... So if I understand correctly, let's say I've a platform that creates a subaccount on auth for each user into my platform. By creating a subaccount, the users of my platform can indirectly interact with Chimoney's product without actually having an account on Chimoney right?

And when they login back to my platform I'll need to retrieve their chimoneySubAccount ID as well

uchibeke commented 2 years ago

That’s correct. Your app will interact with Chimoney on their behalf using their sub account id @ezechuka

uchibeke commented 2 years ago

@ezechuka interested in this? I now realize the scope is really big so many you could break it into 2 issues?

Let me know and share how you intend to approach it

ezechuka commented 2 years ago

I was thinking maybe 3 issues:

This would be the first issue. My approach would be creating the landing page, use firebase for auth and firestore to store authenticated users and their subaccount ID.

* Once authenticated in your app, a user in your app is a sub-account on Chimoney which also owns its own Wallet. Accounting is handled by Chimoney so you might not need additional DB

Then this would be the second one. This too is very broad as there will be lots of UI and API calls involved.

* A user can send transfers to other users in form of Bank transfers, Airtime Transfer, Mobile Money Transfer, Gift Card transfer

Third issue:

* A user can send USD to other accounts using [Account transfer](https://chimoney.readme.io/reference/post_v0-2-accounts-transfer) endpoint

* Receivers should be able to [see all transfers](https://chimoney.readme.io/reference/post_v0-2-accounts-transactions) sent to them and the Status of the transfer and redeem it either through an API call or through embedding the redeem page in an iframe

And with the subaccount feature, it should be possible to implement an escrow payment feature.

uchibeke commented 2 years ago

Sure. Let's do it!

Please create and document the 3 issues and I will assign them to you @ezechuka

ezechuka commented 2 years ago

Okay 💯

codelikesuraj commented 2 years ago

Hello @uchibeke, I also want to work on this

uchibeke commented 2 years ago

Could you break outline what you want to build including framework, language device you’re building for and other relevant details?

share an implementation plan please @codelikesuraj

codelikesuraj commented 2 years ago

@uchibeke

I plan on building a web application using Laravel Framework for PHP

The application allows user's to sign-up primarily with email and any username of choice. For new users, a new sub-account is generated for them which should allow them to send, receive or redeem allowed assets on chimoney to other users on the application. Users can view transaction history, which includes payouts and also view history of assets they have received Users can also view their wallet balance.

codelikesuraj commented 2 years ago

@uchibeke

How do you fund subAccounts? I'm able to create a sub-account for each of my users now, but I how do you fund their account/wallet

uchibeke commented 2 years ago

The receiver of an Account transfer transaction can be a sub account https://chimoney.readme.io/reference/post_v0-2-sub-account-create

Hence, you can transfer from your own main account the to sub account by using the sub account Id as the receiver @codelikesuraj.

Additionally, You could also transfer from a sub account to another account (sub, main, different user account) by passing subAccount in the body like you do with other endpoints.

codelikesuraj commented 2 years ago

The receiver of an Account transfer transaction can be a sub account https://chimoney.readme.io/reference/post_v0-2-sub-account-create

Hence, you can transfer from your own main account the to sub account by using the sub account Id as the receiver @codelikesuraj.

Additionally, You could also transfer from a sub account to another account (sub, main, different user account) by passing subAccount in the body like you do with other endpoints.

Thanks, this helped a lot

codelikesuraj commented 2 years ago

Hello @uchibeke.

I understand that a sub_account automatically has 3 wallets - chi, airtime and momo. I don't really know what momo is, I'm not sure we use that here. For the airtime wallet, does it mean that the balance there can only be used for airtimes?

uchibeke commented 2 years ago

Hello @uchibeke.

I understand that a sub_account automatically has 3 wallets - chi, airtime and momo. I don't really know what momo is, I'm not sure we use that here. For the airtime wallet, does it mean that the balance there can only be used for airtimes?

Only the chi wallet is useful, for now. Ignore the other wallets

codelikesuraj commented 2 years ago

Hello @uchibeke. I understand that a sub_account automatically has 3 wallets - chi, airtime and momo. I don't really know what momo is, I'm not sure we use that here. For the airtime wallet, does it mean that the balance there can only be used for airtimes?

Only the chi wallet is useful, for now. Ignore the other wallets

Okay

ezechuka commented 2 years ago

The receiver of an Account transfer transaction can be a sub account https://chimoney.readme.io/reference/post_v0-2-sub-account-create

Hence, you can transfer from your own main account the to sub account by using the sub account Id as the receiver @codelikesuraj.

Additionally, You could also transfer from a sub account to another account (sub, main, different user account) by passing subAccount in the body like you do with other endpoints.

But @uchibeke is there no way the user can fund their account themself?