Accept Payment
You can receive the Siberian Chervonets (SIB) using the SIBCoin Merchant (Android)
You can automate the receiving SIBCoin payments on your website also.
To do this you need to do the following:
- install and run sibcoind on your server
- generate a unique SIB address to each client
- periodically check incoming transactions on your wallet via custom script
When you discover a new incoming transaction, find out the address where the funds come from. Find out which client uses that address and increase their balance. Thereafter, change the status of the transaction in the database to be certain that the deposit was counted only once.
Request for payment
-
Generate a new address to the client:
getnewaddress "account"
where "account" - a user name on your system. This name will be written in the wallet as a label to address. -
Generate special link URI to make a payment "in one click". Link launches the application on the client device and inserts options for payment: amount, label, message (payment details). The client only needs to click the \"Send\" button
Format URI:
sibcoin:SQVjvk5DiToPR4ktZpHQBiWos718scGizB?amount=100.00000000&label=AlexxTrade&message=account_deposit- SQVjvk5DiToPR4ktZpHQBiWos718scGizB – address, you generated for the client
- amount=100.00000000 – SIB amount for payment
- label=AlexxTrade – label for the customer wallet (the name of your store / service, displayed in his notebook)
- message=account_deposit – payment details
-
Generate QR-code to pay with mobile devices. entering addresses manually is extremely inconvenient on mobile devices, QR-code is much more convenient. QR-Reader built into the SIBCoin mobile wallet. To generate you can use any open library or service. The URI should to be encoded in QR-code.
As a result, after clicking on "Pay" button in your shop, the customer has to see something like this:
Verification of payment and enrollment
Please take a look to this PHP Example.
-
Get a list of transactions with the command:
listtransactions "account"
where "account" - filter (if you want to see only transactions for a given account) -
In response, check the type of transaction (incoming); the amount; the number of confirmations in the network required to accept the payment in your system (For example, if there are more than 3 confirmations, then we accept the payment):
[
{
"account" : "Ivan_Petrov",
"address" : "SXdjZK1beuGYKYDD8utymUmjZkdsHVTazW",
"category" : "receive",
"amount" : 100.00000000,
"vout" : 1,
"confirmations" : 7019,
"bcconfirmations" : 7019,
"blockhash" : "00000000178e2403c42dbd979376027dba6eefc773a2317ed18084b6d2bffa52",
"blockindex" : 1,
"blocktime" : 1457219932,
"txid" : "f35e9c06b80c18ef9263a772dfe25888c0efc49c2c68197060cefc812ce99eae",
"walletconflicts" : [
],
"time" : 1457219926,
"timereceived" : 1457219926
},
{
"account" : "Ivan_Petrov",
"address" : "SXdjZK1beuGYKYDD8utymUmjZkdsHVTazW",
"category" : "receive",
"amount" : 180.90000000,
"vout" : 1,
"confirmations" : 1670,
"bcconfirmations" : 1670,
"blockhash" : "00000000027595a35e1c415f9b3deeb5a880ccb3b090b6b0241c2e745206a8be",
"blockindex" : 1,
"blocktime" : 1458064825,
"txid" : "a7393b8ca262a2f98d8d8b91141f6971af82e47f074d9c2c828905b456cbe83c",
"walletconflicts" : [
],
"time" : 1458064726,
"timereceived" : 1458064726
}
]
-
Do check the database to see if there is already a given transaction (txid). And if not - increase the balance of the client (the payment is credited).
If you accept payments in a different currency in your system, then after checking txid in the database, you should request an exchange rate and record the amount in required currency.Then, write data to a log, and you are done.
Finally, place the label on the bottom of your site that you accept SIBCoins:
<a href="https://sibcoin.money"><img src="https://sibcoin.money/site/images/accept_sibcoin.png" alt="We accept SIBCoins" title="We accept SIBCoins" width="182" height="69"></a>
Or:
<a href="https://sibcoin.money"><img src="https://sibcoin.money/site/images/accept_sibcoin.png" alt="We accept SIBCoins" title="We accept SIBCoins" width="364" height="138"></a>