Closed zacleids closed 6 years ago
This is server side, but will be fixed in the next major payment-protocol deploy.
I know its server side, the error is just being printed, but I wanted to bring attention to it in case no one had caught it yet.
Yep, we hadn't caught it yet. I've already made a patch for it since it was just a math error, just wanted you to know it will be packaged with some larger changes so may take a bit before it's deployed. Thanks for the report :)
Thanks, while I have you here, I wanted to ask a clarification question about the protocol. In bip70, there was a flow where the server could return unspents amounts that summed to zero, and the wallet would then ask the client to enter an amount, and send that to one or all of the unspents. Is that flow also supposed to work in the jsonPaymentProtocol, or is the outputs object always supposed to contain outputs with non-zero amounts. The specification didn't say.
In our current server side implementation we'll never have a case of zero outputs. However, that doesn't mean it shouldn't be supported. Right now if you already have logic that does that for BIP70 I'd say its fine to keep that for JPP. If you're writing new logic entirely then honestly its up to you if you want to include that right now as I'd consider that undocumented functionality.
Ok, thanks :)
This was fixed back in April but it seems we didn't update this issue, fixed :)
While testing the json payment protocol, I purposely crafted a transaction 1000 satoshi less than the requested amount, to see the error message returned by bitpay. The error message returned was
Unhandled rejection Error: The amount on the transaction (0.000252 BTC) does not match the amount requested (26200 BTC). This payment will not be accepted.
The second value should be 0.000262 BTC.