-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SEP-6] Add location_id to withdrawal #1433
Conversation
ecosystem/sep-0006.md
Outdated
### Extra object schema | ||
|
||
This object is used to pass any additional info to the anchor. Anchors are free to add any field to this object. Anchors | ||
should notify wallets about fields they are expecting to receive. However, it's recommended to submit a change to this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will Anchors communicate this to the wallet? Should the schema be included in the /info
response?
Its unclear if fields listed in I'm not opposed to simply adding an optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% convinced we should be adding a types
map to deposit info objects.
I understand that this approach makes sense because the withdraw objects use the same approach, but withdraws and deposits are different. With withdraws, you need to tell the anchor your financial account information so they can send you funds off-chain. But with deposits, the anchor actually needs to tell you their financial account information so you can send the funds off-chain. Thats why the deposit info objects don't have a types
map today -- there is typically no extra non-KYC information that is needed, and that is why we have an instructions
field in the deposit endpoints response.
Location selection seems like the one exception to that rule. The anchor can't tell the user which location to go to, the user needs to pick. I can't think of another type of deposit that would require extra arguments from the client.
Because of that, I think I still prefer adding location_id
as a first-class parameter to deposit request endpoints, rather than it being a custom field defined in GET /info
. If you can point out other potential uses of a types
array for deposits, I'm willing to change my mind.
EDIT: actually, I know its not a requirement for MGI since you can pick up cash at any location, but should we consider adding location_id
to withdraw request endpoints as well?
ecosystem/sep-0006.md
Outdated
"types": { | ||
"location": { | ||
"fields": { | ||
"id": { | ||
"description": "ID of location user must visit to pick up cash" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the example should be something like:
"types": { | |
"location": { | |
"fields": { | |
"id": { | |
"description": "ID of location user must visit to pick up cash" | |
} | |
} | |
"types": { | |
"cash": { | |
"fields": { | |
"location_id": { | |
"description": "ID of location user must visit to pick up cash" | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other examples
ecosystem/sep-0006.md
Outdated
"bank_account": { | ||
"fields": { | ||
"dest": {"description": "your bank account number" }, | ||
"dest_extra": { "description": "your routing number" }, | ||
"bank_branch": { "description": "address of your bank branch" }, | ||
"phone_number": { "description": "your phone number in case there's an issue" }, | ||
"country_code": { | ||
"description": "The ISO 3166-1 alpha-3 code of the user's current address", | ||
"choices": ["USA", "PRI"] | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm, we're removing this because the bank_account
type is requesting the user's KYC info like phone number and bank account number right? And we want them to do this via SEP-12?
Don't we still need the client to provide the type=bank_account
query parameter though, so the anchor knows to request bank account fields in the GET /customer
response? If that is the case, then we need to do something like this:
"bank_account": {}
This signals that the type should be passed but there are no extra fields that need to passed in the transaction creation request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do it like described above, that would mean that we accept field named bank_account
with empty body though, am I wrong?
We still have type
in the request, it should be used as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do it like described above, that would mean that we accept field named bank_account with empty body though, am I wrong?
On what endpoint would anchors accept a "bank_account": {}
key-value pair from wallet requests? I'm referring to the fact that GET /info
responses should have all possible values of the type
query parameter as keys. So we shouldn't remove the entire bank_account
object, just the items within the object, since no additional parameters should be sent to the anchor other than the type
parameter in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types
in info
describes type of on object, not of a string. type of type parameter from the request is string. With current protocol we can't describe acceptable values of
type`, because it's not an object.
That being said, I agree with just adding location_id
ecosystem/sep-0006.md
Outdated
type of deposit. In the case that the Anchor requires additional fields for a deposit, it should set the | ||
transaction status to `pending_customer_info_update`. The wallet can query the `/transaction` endpoint to get the | ||
fields needed to complete the transaction in `required_customer_info_updates` and then use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stops mid-sentence. I also think you mean pending_transaction_info_update
and required_info_updates
.
I don't mind just adding location_id directly, but I think it's more flexible if we allow anchors to define their own fields, so we don't need to modify protocol for any small deviation from SEP-6 protocol |
I agree it is valuable that your solution provides anchors a way to request their own custom fields, and if we were starting from scratch I think this is the right approach. The reason I think we should try to avoid making this change is simply because it is breaking, and it is unclear how common the need for custom fields will be. I also think that a |
Ok, it sounds like we're on the same page of adding |
Reopened PR to preserve discussion history |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with edits
ecosystem/sep-0006.md
Outdated
@@ -828,6 +829,7 @@ Request Parameters: | |||
| `country_code` | string | (optional) The [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code of the user's current address. This field may be necessary for the anchor to determine what KYC information is necessary to collect. | | |||
| `claimable_balance_supported` | string | (optional) `true` if the client supports receiving deposit transactions as a claimable balance, `false` otherwise. | | |||
| `customer_id` | string | (optional) id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's `sub` field). If the anchor supports [SEP-12], the `customer_id` field should match the [SEP-12] customer's id. `customer_id` should be passed only when the off-chain id is know to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor. | | |||
| `location_id` | string | (optional) id of the chosen location for cash pick up cash | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `location_id` | string | (optional) id of the chosen location for cash pick up cash | | |
| `location_id` | string | (optional) id of the chosen location to drop off cash | |
ecosystem/sep-0006.md
Outdated
@@ -726,6 +726,7 @@ Request parameters: | |||
| `refund_memo` | string | (optional) The memo the anchor must use when sending refund payments back to the user. If not specified, the anchor should use the same memo used by the user to send the original payment. If specified, `refund_memo_type` must also be specified. | | |||
| `refund_memo_type` | string | (optional) The type of the `refund_memo`. Can be `id`, `text`, or `hash`. See the [memos](https://developers.stellar.org/docs/encyclopedia/memos) documentation for more information. If specified, `refund_memo` must also be specified. | | |||
| `customer_id` | string | (optional) id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's `sub` field). If the anchor supports [SEP-12], the `customer_id` field should match the [SEP-12] customer's id. `customer_id` should be passed only when the off-chain id is know to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor. | | |||
| `location_id` | string | (optional) id of the chosen location for cash pick up cash | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `location_id` | string | (optional) id of the chosen location for cash pick up cash | | |
| `location_id` | string | (optional) id of the chosen location to pick up cash | |
Also, don't forget to update the updated-at and version fields. |
# Conflicts: # ecosystem/sep-0006.md
Background
One of partners requires for user to choose a location to be selected. This location will be used to pick up funds
Proposed change
Add
location_id
to withdrawal requests