Commit 254f94e
jeffyanta
Support additional fees for payment requests (#53)
* Update request stores to include fee metadata
* Add basis points to payment request fee model
* Ensure consistent fee ordering from DB store
* Pull in v1.10.0 protobuf APIs
* Support additional fee takers in SubmitIntent
* Add edge case tests for SubmitIntent when using additional fee takers
* Ensure additional third party fees are subtracted from RECEIVED chat messages
* Support additional fee takers in messaging service
* Add happy path tests for additional fees in messaging service
* Add edge case tests for additional fees in messaging service
* Improve error messaging to distinguish between fee taker and payment destination
* Update merchant chats to consider fees to Code accounts
* Be more strict about wasteful fees
* Max fee basis points is now configurable
* Add tests for new fee edge cases in messaging service
* Update scheduler test to ensure multiple fees are handled
* Add local simulation test to ensure we catch invalid fee structures due to fluctuating exchange rates
* Add client-side assertions on fee server parameter expectations
* Add a test for getMicroPaymentReceiveExchangeDataByOwner
* Fix micropayment check in getMicroPaymentReceiveExchangeDataByOwner1 parent 638f62f commit 254f94e
File tree
26 files changed
+1348
-251
lines changed- pkg/code
- async/sequencer
- chat
- common
- data/paymentrequest
- memory
- postgres
- tests
- server/grpc
- messaging
- transaction/v2
26 files changed
+1348
-251
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
614 | 624 | | |
615 | 625 | | |
616 | 626 | | |
| |||
632 | 642 | | |
633 | 643 | | |
634 | 644 | | |
635 | | - | |
| 645 | + | |
636 | 646 | | |
637 | 647 | | |
638 | 648 | | |
| |||
642 | 652 | | |
643 | 653 | | |
644 | 654 | | |
645 | | - | |
| 655 | + | |
646 | 656 | | |
647 | 657 | | |
648 | 658 | | |
| |||
651 | 661 | | |
652 | 662 | | |
653 | 663 | | |
654 | | - | |
| 664 | + | |
655 | 665 | | |
656 | 666 | | |
657 | 667 | | |
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
661 | 671 | | |
662 | | - | |
| 672 | + | |
663 | 673 | | |
664 | 674 | | |
665 | 675 | | |
666 | 676 | | |
667 | 677 | | |
668 | | - | |
| 678 | + | |
669 | 679 | | |
670 | 680 | | |
671 | 681 | | |
| |||
674 | 684 | | |
675 | 685 | | |
676 | 686 | | |
| 687 | + | |
677 | 688 | | |
678 | 689 | | |
679 | 690 | | |
680 | 691 | | |
681 | | - | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
682 | 702 | | |
683 | 703 | | |
684 | 704 | | |
| |||
2306 | 2326 | | |
2307 | 2327 | | |
2308 | 2328 | | |
2309 | | - | |
| 2329 | + | |
2310 | 2330 | | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
2317 | 2344 | | |
2318 | 2345 | | |
2319 | 2346 | | |
| |||
2343 | 2370 | | |
2344 | 2371 | | |
2345 | 2372 | | |
2346 | | - | |
2347 | | - | |
| 2373 | + | |
| 2374 | + | |
2348 | 2375 | | |
2349 | 2376 | | |
2350 | 2377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | | - | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
122 | | - | |
| 125 | + | |
123 | 126 | | |
124 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
125 | 175 | | |
| 176 | + | |
| 177 | + | |
126 | 178 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
130 | 191 | | |
0 commit comments