diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-01 22:04:25 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-01 22:04:25 +0100 |
commit | 1e43a2dbf5f1122afa0eb0ab4b7ba6ee81940e6f (patch) | |
tree | 0602508ab3a080a1636c0e21529907351bec3754 | |
parent | b7bdeb383c26de6c3ce9347c9f1c0ca01f1dbcec (diff) | |
download | merchant-1e43a2dbf5f1122afa0eb0ab4b7ba6ee81940e6f.tar.gz merchant-1e43a2dbf5f1122afa0eb0ab4b7ba6ee81940e6f.tar.bz2 merchant-1e43a2dbf5f1122afa0eb0ab4b7ba6ee81940e6f.zip |
fix initialization, fix timestamp rounding (in testcase)
-rw-r--r-- | src/lib/merchant_api_pay.c | 4 | ||||
-rw-r--r-- | src/lib/test_merchant_api.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c index 52dc509e..696b1f51 100644 --- a/src/lib/merchant_api_pay.c +++ b/src/lib/merchant_api_pay.c @@ -215,8 +215,8 @@ TALER_MERCHANT_pay_wallet (struct TALER_MERCHANT_Context *merchant, p->denom_pub = coin->denom_pub; p->denom_sig = coin->denom_sig; p->coin_pub = dr.coin_pub; - p->amount_with_fee = pc->amount_with_fee; - p->amount_without_fee = pc->amount_without_fee; + p->amount_with_fee = coin->amount_with_fee; + p->amount_without_fee = coin->amount_without_fee; } return TALER_MERCHANT_pay_frontend (merchant, merchant_uri, diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c index bc612b7b..88670c12 100644 --- a/src/lib/test_merchant_api.c +++ b/src/lib/test_merchant_api.c @@ -1018,6 +1018,7 @@ interpreter_run (void *cls, struct GNUNET_HashCode h_wire; struct GNUNET_HashCode h_contract; struct GNUNET_TIME_Absolute refund_deadline; + struct GNUNET_TIME_Absolute timestamp; /* get amount */ if (GNUNET_OK != @@ -1127,13 +1128,16 @@ interpreter_run (void *cls, refund_deadline = GNUNET_TIME_UNIT_ZERO_ABS; /* no refunds */ else refund_deadline = GNUNET_TIME_relative_to_absolute (cmd->details.pay.refund_deadline); + TALER_round_abs_time (&refund_deadline); + timestamp = GNUNET_TIME_absolute_get (); + TALER_round_abs_time (×tamp); cmd->details.pay.ph = TALER_MERCHANT_pay_wallet (merchant, MERCHANT_URI, MINT_URI, &h_wire, &h_contract, - GNUNET_TIME_absolute_get (), + timestamp, cmd->details.pay.transaction_id, &merchant_pub, refund_deadline, |