diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-06 16:35:30 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-06 16:35:30 +0100 |
commit | 0214e426a6cd2c80671bb55257e3358e737f60d3 (patch) | |
tree | c0acf2e8d730637482c6030647d01b17681a7413 /src/include | |
parent | 326f3b2a43d9e18938cb2ac902b4cc9c7423f393 (diff) | |
download | exchange-0214e426a6cd2c80671bb55257e3358e737f60d3.tar.xz |
add amount division API and test case
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_amount_lib.h | 14 | ||||
-rw-r--r-- | src/include/taler_error_codes.h | 15 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/include/taler_amount_lib.h b/src/include/taler_amount_lib.h index 5a59c10ce..555894f4b 100644 --- a/src/include/taler_amount_lib.h +++ b/src/include/taler_amount_lib.h @@ -252,6 +252,20 @@ TALER_amount_add (struct TALER_Amount *sum, /** + * Divide an amount by a float. Note that this function + * may introduce a rounding error! + * + * @param result where to store @a dividend / @a divisor + * @param dividend amount to divide + * @param divisor by what to divide, must be positive + */ +void +TALER_amount_divide (struct TALER_Amount *result, + const struct TALER_Amount *dividend, + uint32_t divisor); + + +/** * Normalize the given amount. * * @param amount amount to normalize diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h index e47cff77c..c8a030fac 100644 --- a/src/include/taler_error_codes.h +++ b/src/include/taler_error_codes.h @@ -1005,6 +1005,21 @@ enum TALER_ErrorCode */ TALER_EC_PAY_FAILED_COMPUTE_PROPOSAL_HASH = 2123, + /** + * Failed to locate merchant's account information matching the + * wire hash given in the proposal. + * This response is + * provided with HTTP status code MHD_HTTP_INTERNAL_SERVER_ERROR. + */ + TALER_EC_PAY_WIRE_HASH_UNKNOWN = 2124, + + /** + * We got different currencies for the wire fee and the maximum wire + * fee. This response is provided with HTTP status code + * MHD_HTTP_INTERNAL_SERVER_ERROR. + */ + TALER_EC_PAY_WIRE_FEE_CURRENCY_MISSMATCH = 2125, + /** * Integer overflow with sepcified timestamp argument detected. |