fix: randomSatoshis trigger success#482
Conversation
chedieck
left a comment
There was a problem hiding this comment.
Not sure if I understood it correctly, but I was guessing random-satoshis=true should make ONLY the amounts being equal necessary to call a transaction a success transaction.
i.e. ignoring the opReturn, and with him the paymentId.
| contributionOffset, | ||
| ...widgetProps | ||
| } = props; | ||
| const [internalCurrencyObj, _setInternalCurrencyObj] = useState<CurrencyObject>(); |
There was a problem hiding this comment.
Setter shouldn't have been prefixed with a underscore, it is used in the line below
d3e2241 to
c62aee4
Compare
There was a problem hiding this comment.
I'm not getting a success with the same amount if I don't send anything in the OP_RETURN.
Tried for the button:
<div class="paybutton" to="ecash:qq3zv9s3jna6x5t0fxzfgd2zwteqyyjrscf9zmthz7" text="Mine" amount="21"
random-satoshis="true"
currency="XEC" goal-amount="1000" success-text="WOW!" on-close="myClose" on-open="myOpen"
on-success="mySuccessFunction" on-transaction="myTransactionFunction"
></div>
chedieck
left a comment
There was a problem hiding this comment.
My bad, didn't pulled the latest changes, it is actually working well. Just left a code question.
| transaction: Transaction, | ||
| currency: string, | ||
| price: number, | ||
| randomSatoshis: number | boolean, |
There was a problem hiding this comment.
why 'number'? AFAIK this is a boolean.
There was a problem hiding this comment.
Check WidgetContainerProps randomSatoshis is boolean | number there
3a231c3 to
fb51c8a
Compare
Related to #366
Description
Fix button not triggering success when random satoshis is active
Test plan
1 - Test component(paybutton and widget) with no amount should trigger succes
2 - Test if component (paybutton and widget) with an amount and without random satoshis active is triggering sucess
3 - Test if component (paybutton and widget) with an amount and random satoshis active is triggering success as expected