If we want to make Monero based eCommerce websites, what is the process? how do we integrate Monero into the website so a seller can set a price for the product and buyer can pay in Monero and get the product, for both immediate and escrow based?
2 Answers
You will have to have some code or product that is able to determine when a monero payment has been received at your merchant address, and compare it to the payment id (or integrated address) your ecommerce system generates.
There are two easy approaches:
- Use a 3rd party merchant solution
- Run your own wallet live on your server to scan for incoming transactions
Number one is easy, but does require you to rely on a 3rd party. You may be sacrificing some privacy or reliability, but these are pretty easy to work with. From getmonero.org has a list of merchant info, including payment processors:
https://getmonero.org/getting-started/merchants
At this time, there are two publicly known services to help:
PayBee is in beta, and requires a beta signup. I don't have details on their API or how to use it.
Monero Merchants appears to be an open API that does not require an account or API keys. You will need a developer to help write some of the code, but it should be very easy to set up. Your website just tells the merchant API how much monero you need and what address you want it deposited into. They respond with a different monero address and payment id for your customers to send monero into. Your website can then check to see if the monero has been received. They collect the monero in a wallet they control (that you can't see) and will then transfer it to your account.
If you need more control or privacy (so a third party isn't involved) you will need to run a wallet live on your servers to scan for incoming transactions to your wallet address. There are libraries available for a developer to integrate with your website, although it requires an ecommerce platform that can accomodate custom code. You can see a list of libraries at https://getmonero.org/getting-started/merchants in the "Libraries and Helpers" section.
One such library is https://github.com/PsychicCat/monero-php which is a php library that will communicate with a monero wallet via RPC and is a good starting place if you need something custom.
You can run your own Monero node and use the existing RPC functionality of the Monero node to write an API to communicate with your node. You can write the API using PHP very easily. I used PHP to develop API for my client and it is pretty straightforward to develop with all the resources available on Monero. Once you have API, you can use it produce integrated payment address which can be used to track payments. Let me know if you need more help.