blockchain / service-my-wallet-v3

Blockchain Wallet API Service
https://blockchain.info/api/blockchain_wallet_api
GNU Affero General Public License v3.0
910 stars 518 forks source link

Sending Payment's doesn't work. #401

Open chetanmadaan opened 5 years ago

chetanmadaan commented 5 years ago

http://127.0.0.1:3000/merchant/GUID/payment?password=xxx&to=address&amount=14000&second_password=xxx

response: {"error":"Unexpected error, please try again"}

If I put in a different password or remove the second password, I do get the specific error but when everything is correct. The payment doesn't go through.

Versions: Service 0.26.3 Node v8.11.4

ghost commented 5 years ago

@chetanmadaan you have not passed the fee/fee_per_byte value. Notice, that fee is an extra value of transactions. I mean if you want to pass, for example, 10000 Satoshi and pass fee_per_byte params with value 6, then for trx with 226 bytes, you should have on the "from" wallet (226×6)+10000 = 11356 Satoshi.

chetanmadaan commented 5 years ago

I'll give this a try.

Thank You!

amitkhandagale commented 5 years ago

I am facing same issue. @chetanmadaan you able to figure it out? I have tried fee/fee_per_byte params as mentioned by @pavels-hyuna and all other optional parameters as well but no luck. Please help.

chetanmadaan commented 5 years ago

I am facing same issue. @chetanmadaan you able to figure it out? I have tried fee/fee_per_byte params as mentioned by @pavels-hyuna and all other optional parameters as well but no luck. Please help.

Amit,

I haven't had the chance to try it yet. In the beginning it was working just fine even without those params. Thanks, Chetan

amitkhandagale commented 5 years ago

@chetanmadaan Thanks for reply. I am able to figure it out. In my case It was from parameter issue. Using account_index worked for me. I found account_index in response of this api (/merchant/:guid/accounts) As per the documentation from parameter is optional [from - bitcoin address or account index to send from (optional)] but may be its required.

Brayan233 commented 5 years ago

@chetanmadaan Thanks for reply. I am able to figure it out. In my case It was from parameter issue. Using account_index worked for me. I found account_index in response of this api (/merchant/:guid/accounts) As per the documentation from parameter is optional [from - bitcoin address or account index to send from (optional)] but may be its required.

Hello @amitkhandagale ! Can you show me a sample request to make payments working for you ? Cause i'm facing the same issue, and even with the account_index set in the from parameters...

Thanks

amitkhandagale commented 5 years ago

Hi @Brayan233 I have used request same as mentioned in the documentation. Did you tried using all parameters including all optional parameters? Here's the sample request worked for me : /merchant/:guid/payment?password=wallet_password&to=to_address&amount=amount_in_satoshi&api_code=api_code_value&from=btc_address_or_index&fee=10000 Also make sure amount in satoshi should not have any decimals. let me know if it helps.

Thanks Amit

Brayan233 commented 5 years ago

@amitkhandagale Thanks for the answer. Unfortunately, it doesn't work for me, with all params ... I attach screenshots from my api console and my call request (with postman) maybe it could help you

error1 error2

amitkhandagale commented 5 years ago

Hi @Brayan233 This is odd that with same parameters it worked for me but not working for you. I am not sure if you already tried this but if not please try once:

  1. did you confirmed your index is 0 which you are sending in "from" param using this api (/merchant/:guid/accounts)?
  2. try with little bit larger amount. (as per their documentation minimum amount of bitcoin can be sent in a transaction is 546 Satoshis)
  3. You kept fees too high. Try setting 10000 satoshi (default fees amount) and keep fee smaller than the amount you are trying to send
Brayan233 commented 5 years ago

Hi @amitkhandagale , thank's for the reply.

  1. yes i'm sure index is 0 for the wallet i'm using git1

2 & 3 yes, i tried with amount 10k satoshis and 5k fees, still not working git2

elvismdev commented 5 years ago

Facing the same problem, have someone figured it out?

Brayan233 commented 5 years ago

@elvismdev , i solved it by downgrade my node js version to 6.4.0 (#409 ). Hope it help !

ostapyrih commented 4 years ago

Solved it by passing transaction fee in send

kennyendowed commented 4 years ago

am having same problem pls

trying to send bitcoin to another address

am geting a error $wallet = Blockchain::makeOutgoingPayment($wallet_guid, $amount, $wallet_password, $to_guid,$from_guid);

errors

file_get_contents(http://127.0.0.1:3000/merchant/ijfia83405-2339-fdjofe-b8d2-ergrgwgefa?payment?password=huyut7342s%4011&api_code=8698dr4w5d-yftdt-lhilj-a7878-hisrwserwrt536&to=1ABYVpfwSxPukqvmPDtZ6KiybgzRe4KaFF&amount=10000.00000000&from=1LMdnxXsuHuZaDeiqRMAkQfUc7JgdwsKVu&fee=1000): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error\r\n in /var/www/html/coin_api/vendor/botdigit/blockchain/src/Blockchain.php:264

on d wallet server i get this 1593571032038 - info: blockchain.info wallet service v0.26.3 running on http://127.0.0.1:3000 1593571039821 - error: [object Object] 1593571117816 - error: [object Object] 1593571189722 - error: [object Object] 1593571618354 - error: [object Object] 1593572101402 - error: [object Object]

techwebdev commented 4 years ago

amount not allowed in float number convert in satoshi

devpilot-official commented 3 years ago

Hello good people

I am having issues with sending bitcoin using the payment and send many endpoints, it continues to return 404.

Someone please help!!!