Bitcoin Forum
April 25, 2024, 01:27:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help in configuring JSON RPC for Bitcoin Core - Please help  (Read 531 times)
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
August 14, 2017, 09:25:04 PM
 #1

Hi,

I installed bitcoin core on ubuntu server and using JSON RPC on php. I am in the process of developing a gaming site.  When a client requests a withdrawal it automatically process the transaction and the transaction fee is charged from my main balance. Is there any way to make the the transaction fees deducted from the withdrawn money by the user.

Example - If a client requests for a withdrawal of 0.1 btc, i want to deduct the fee and send the balance as withdrawal.  How do i put it in php code?  Please help me.  I dont want to charge a fixed fee from the clients.  I want to just deduct the fees that will incur for that withdrawal..
1714008463
Hero Member
*
Offline Offline

Posts: 1714008463

View Profile Personal Message (Offline)

Ignore
1714008463
Reply with quote  #2

1714008463
Report to moderator
1714008463
Hero Member
*
Offline Offline

Posts: 1714008463

View Profile Personal Message (Offline)

Ignore
1714008463
Reply with quote  #2

1714008463
Report to moderator
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714008463
Hero Member
*
Offline Offline

Posts: 1714008463

View Profile Personal Message (Offline)

Ignore
1714008463
Reply with quote  #2

1714008463
Report to moderator
Casy
Member
**
Offline Offline

Activity: 149
Merit: 22

🔴🔵 FoxMixer.com 🔵🔴


View Profile WWW
August 15, 2017, 10:40:24 AM
 #2

Hi,

I installed bitcoin core on ubuntu server and using JSON RPC on php. I am in the process of developing a gaming site.  When a client requests a withdrawal it automatically process the transaction and the transaction fee is charged from my main balance. Is there any way to make the the transaction fees deducted from the withdrawn money by the user.

Example - If a client requests for a withdrawal of 0.1 btc, i want to deduct the fee and send the balance as withdrawal.  How do i put it in php code?  Please help me.  I dont want to charge a fixed fee from the clients.  I want to just deduct the fees that will incur for that withdrawal..

I don't know if this parameter is implemented in your bitcoin core version, but on
https://chainquery.com/bitcoin-api/sendtoaddress
You can see parameter 5: subtractfeefromamount (boolean), that is exactly what you want.

Just a general remark: it is usually more convenient for all users to know exactly what fees will be substracted.
As soon as you pass on the network fees directly to your customers, they will be encountering "random" fees, just depending on the network load. New users won't understand at all, why they received 0.1 BTC yesterday and 0.05 today.
Setting a fee that is generally a bit higher than the typical mining fees is the way of doing it predictably in the view of the users.

IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
August 15, 2017, 11:44:30 PM
 #3

Hi,

I installed bitcoin core on ubuntu server and using JSON RPC on php. I am in the process of developing a gaming site.  When a client requests a withdrawal it automatically process the transaction and the transaction fee is charged from my main balance. Is there any way to make the the transaction fees deducted from the withdrawn money by the user.

Example - If a client requests for a withdrawal of 0.1 btc, i want to deduct the fee and send the balance as withdrawal.  How do i put it in php code?  Please help me.  I dont want to charge a fixed fee from the clients.  I want to just deduct the fees that will incur for that withdrawal..

I don't know if this parameter is implemented in your bitcoin core version, but on
https://chainquery.com/bitcoin-api/sendtoaddress
You can see parameter 5: subtractfeefromamount (boolean), that is exactly what you want.

Just a general remark: it is usually more convenient for all users to know exactly what fees will be substracted.
As soon as you pass on the network fees directly to your customers, they will be encountering "random" fees, just depending on the network load. New users won't understand at all, why they received 0.1 BTC yesterday and 0.05 today.
Setting a fee that is generally a bit higher than the typical mining fees is the way of doing it predictably in the view of the users.

Thanks for your help. Can you please tell  me how do i use that 5 parameter in php? 

For example:

I use the below code for withdraw:


$wind = $bitcoin->sendtoaddress($address,$amount1);
$info = '<span  class="msgOk">Paid to the address: <b>'.$address.'</b><br><br>Txid: <b>'.$wind.'</b><br></span>';

Please tell me how should i use it in php
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
August 16, 2017, 11:54:03 PM
 #4

an y one please help me with the code
MrCrank
Sr. Member
****
Offline Offline

Activity: 1336
Merit: 258



View Profile
August 17, 2017, 04:24:35 AM
 #5

an y one please help me with the code

You can read it om bitcoin wiki.
Php examples find with google.
no one tell you working code because is expensive info.

I can help you, cost 0.1BTC
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!