View Issue Details

IDProjectCategoryView StatusLast Update
0006755Talermerchant backendpublic2021-08-24 14:23
Reportersebasjm Assigned Tosebasjm Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.8Fixed in Version0.8 
Summary0006755: The PATCH operation does not work as expected for the "payto_uris" field
DescriptionFrom
https://docs.taler.net/core/api-merchant.html#instance-management

payto_uri field seems to add always the values to the previous one in the account list.

See steps to reproduce the issue
Steps To ReproduceCreate an instance

curl 'http://localhost:9966/private/instances' \
  -H 'Authorization: Bearer secret-token:super_secret' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"default_wire_transfer_delay":{"d_ms":2000},"default_pay_delay":{"d_ms":1000},"jurisdiction":{},"address":{},"default_wire_fee_amortization":10,"default_max_wire_fee":"COL:2","default_max_deposit_fee":"COL:1","payto_uris":["payto://x-taler-bank/bank.taler:5882/blogger"],"name":"www","id":"www2"}'

It create the instance with id www2 as expected, and one single account payto://x-taler-bank/bank.taler:5882/blogger

Next, try to remove the payto uri to replace it with another

curl 'http://localhost:9966/private/instances/www2' \
  -X 'PATCH' \
  -H 'Authorization: Bearer secret-token:super_secret' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"default_pay_delay":{"d_ms":1000},"name":"www","merchant_pub":"3N4SC26BXAAF4QM9VJ1T6FQK074JN0YCXQK6CJ4MYXPS4TJYN4N0","address":{},"jurisdiction":{},"default_max_wire_fee":"COL:2","default_max_deposit_fee":"COL:1","default_wire_fee_amortization":10,"default_wire_transfer_delay":{"d_ms":2000},"id":"www2","payto_uris":["payto://x-taler-bank/bank.taler:5882/blogger3"]}'

It is not removed, but is added to the existing one. The expected behavior is to replace the previous value with the new one.

An attempt to clean the field also doesnt work as expected:

curl 'http://localhost:9966/private/instances/www2' \
  -X 'PATCH' \
  -H 'Authorization: Bearer secret-token:super_secret' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"default_pay_delay":{"d_ms":1000},"name":"www","merchant_pub":"3N4SC26BXAAF4QM9VJ1T6FQK074JN0YCXQK6CJ4MYXPS4TJYN4N0","address":{},"jurisdiction":{},"default_max_wire_fee":"COL:2","default_max_deposit_fee":"COL:1","default_wire_fee_amortization":10,"default_wire_transfer_delay":{"d_ms":2000},"id":"www2","payto_uris":[""]}'
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Christian Grothoff

2021-02-17 19:50

manager   ~0017542

f8bc94d..441d1a5 fixes an issue where re-enabling (!) an account would not work. But looking at the code I've not yet seen how it could fail to disable. Investigation continues...

Christian Grothoff

2021-02-17 20:02

manager   ~0017543

I tried it, and it works for me here. Do note that the bank account is never 'deleted', just set to "inactive". So now I have:

$ curl 'http://localhost:8080/private/instances/www2' -H 'Authorization: Bearer secret-token:super_secret' -H 'Content-Type: application/json;charset=UTF-8'
{
  "accounts": [
    {
      "payto_uri": "payto://x-taler-bank/bank.taler:5882/blogger2",
      "h_wire": "CSB7EKYYG8NX6GKMT5HCJ7BAC8700SP2B8693AKJB2RQ3YFXBJCH011P0PYX34FE8N45Q1QR662P6MXPH0CWJMFQF5MYCQ6EEAJRST0",
      "salt": "E9H97C4XZPGYK7HQWM2JBCJR6BWSC2ZK33MZ0FV1J5PTC253MWJGKPTPAZ098Q587PTP7FQ7VS7Q85FSQYD5727F5M8TDCPEVMWW1Z0",
      "active": true
    },
    {
      "payto_uri": "payto://x-taler-bank/bank.taler:5882/blogger",
      "h_wire": "M99W9FA8RZM1Y67MPFW9BH1MTAYCN2CT4AQPZWW1HA028FC6J5P77EZTZCH825HWQSW5VM0M7N2THD7YSSKM088YNFQC59SDVWSV4CR",
      "salt": "EJ6YSNTZ8FM8CJ8MXYHNKC894J195V5Y1S4T9MTGRF6E7KTNTDFDP3GCKXCW5SF65JF6AEGQFYSKT3MFHFVN578T9CCSCW78Y29TF40",
      "active": false
    }
  ],
  "name": "www",
  "merchant_pub": "WRH5QWP0DPRMQ712HBJ5AKMFDKNQ6RXDZNQQHM8KYNMRFWRYXGR0",
  "address": {},
  "jurisdiction": {},
  "default_max_wire_fee": "EUR:2",
  "default_max_deposit_fee": "EUR:1",
  "default_wire_fee_amortization": 10,
  "default_wire_transfer_delay": {
    "d_ms": 2000
  },
  "default_pay_delay": {
    "d_ms": 1000
  }
}

See the "active" : false for the 'blogger'. Fixed?

sebasjm

2021-02-17 20:28

developer   ~0017545

Not in my side, if I send payto_uris with an empty array I expect all to be active: false.
But it has no effect.

Christian Grothoff

2021-02-17 21:20

manager   ~0017547

I just tested it again, and it works fine here. did you try with the lastest merchant? Git c3b87356b2f31f63bb7dfa84cb7a3361fc55debc?

sebasjm

2021-02-17 22:54

developer   ~0017548

Sorry, was not running the last version.
Yes it seems fixed

Issue History

Date ModifiedUsernameFieldChange
2021-02-17 19:06sebasjmNew Issue
2021-02-17 19:06sebasjmStatusnew => assigned
2021-02-17 19:06sebasjmAssigned To => Christian Grothoff
2021-02-17 19:50Christian GrothoffNote Added: 0017542
2021-02-17 20:02Christian GrothoffNote Added: 0017543
2021-02-17 20:02Christian GrothoffAssigned ToChristian Grothoff => sebasjm
2021-02-17 20:02Christian GrothoffStatusassigned => feedback
2021-02-17 20:28sebasjmNote Added: 0017545
2021-02-17 21:20Christian GrothoffNote Added: 0017547
2021-02-17 22:54sebasjmNote Added: 0017548
2021-02-17 23:40Christian GrothoffStatusfeedback => informing
2021-02-17 23:40Christian GrothoffResolutionopen => fixed
2021-02-17 23:40Christian GrothoffFixed in Version => 0.9
2021-02-17 23:41Christian GrothoffTarget Version => 0.9
2021-07-30 11:57Christian GrothoffFixed in Version0.9 => 0.8.1
2021-07-30 11:59Christian GrothoffTarget Version0.9 => 0.8.1
2021-07-30 12:02Christian GrothoffFixed in Version0.8.1 => 0.8
2021-07-30 12:02Christian GrothoffTarget Version0.8.1 => 0.8
2021-08-24 14:23Christian GrothoffStatusinforming => closed
2025-03-22 13:09Christian GrothoffCategorymechant backend => merchant backend