merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 1e43a2dbf5f1122afa0eb0ab4b7ba6ee81940e6f
parent b7bdeb383c26de6c3ce9347c9f1c0ca01f1dbcec
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  1 Jan 2016 22:04:25 +0100

fix initialization, fix timestamp rounding (in testcase)

Diffstat:
Msrc/lib/merchant_api_pay.c | 4++--
Msrc/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 @@ -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 @@ -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 (&timestamp); 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,