Skip to content

Commit

Permalink
PARTNER-146: Add external_account_id to SEP-9 (#1410)
Browse files Browse the repository at this point in the history
* PARTNER-146: Add external_account_id to SEP-9

* Add link

* Move customer_id to SEP-6 and -24

* Fix changelog

* Change description

* Update description to clarify when to use customer_id

* PR comments
  • Loading branch information
Ifropc authored Oct 24, 2023
1 parent 37bf768 commit 1abf481
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions bin/prettier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
yarn prettier $1 --write
10 changes: 7 additions & 3 deletions ecosystem/sep-0006.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Title: Deposit and Withdrawal API
Author: SDF
Status: Active (Interactive components are deprecated in favor of SEP-24)
Created: 2017-10-30
Updated: 2023-09-08
Version 3.22.0
Updated: 2023-10-20
Version 3.23.0
```

## Simple Summary
Expand Down Expand Up @@ -331,6 +331,7 @@ Name | Type | Description
`amount` | string | (optional) The amount of the asset the user would like to deposit with the anchor. This field may be necessary for the anchor to determine what KYC information is necessary to collect.
`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. |

The request parameters also must include the required fields from the `/info` endpoint.

Expand Down Expand Up @@ -578,6 +579,7 @@ Name | Type | Description
`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.
`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. |

The request parameters also must include the required fields from the `/info` endpoint.

Expand Down Expand Up @@ -662,6 +664,7 @@ Name | Type | Description
`on_change_callback` | string | (optional) A URL that the anchor should `POST` a JSON message to when the `status` property of the transaction created as a result of this request changes. The JSON message should be identical to the response format for the [/transaction](#single-historical-transaction) endpoint. The callback needs to be signed by the anchor and the signature needs to be verified by the wallet according to the [callback signature specification](#callback-signature).
`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. |

Examples:

Expand Down Expand Up @@ -711,6 +714,7 @@ Name | Type | Description
`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.
`refund_memo` | (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` | (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. |

Example:

Expand Down Expand Up @@ -1480,7 +1484,7 @@ If the information was malformed, or if the sender tried to update data that isn
[SEP-38]: sep-0038.md

## Changelog

- `v3.23.0`: Add `customer_id` field to deposit and withdrawal requests ([#1410](https://github.com/stellar/stellar-protocol/pull/1410))
- `v3.22.0`: Deprecate the `wallet_name` and `wallet_url` parameters of `deposit` and `withdraw` requests ([#1393](https://github.com/stellar/stellar-protocol/pull/1393))
* `v3.21.0`: Accept financial information via SEP-12. ([#1379](https://github.com/stellar/stellar-protocol/pull/1380/))
* `v3.20.0`: Add support for asynchronous deposit instructions. ([#1379](https://github.com/stellar/stellar-protocol/pull/1379/))
Expand Down
3 changes: 2 additions & 1 deletion ecosystem/sep-0009.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ already separate fields.

## Changelog

- `v1.13.0`: Add `crypto` related fields to financial account fields section. ([#1382](https://github.com/stellar/stellar-protocol/pull/1382))
- `v1.13.0`: Add `crypto` related fields to financial account fields section.
([#1382](https://github.com/stellar/stellar-protocol/pull/1382))
- `v1.12.0`: Define financial account fields section. ([#1367](https://github.com/stellar/stellar-protocol/pull/1367))
- `v1.11.0`: Add `bank_account_type` for describing types of bank accounts.
([#1344](https://github.com/stellar/stellar-protocol/pull/1344))
Expand Down
11 changes: 7 additions & 4 deletions ecosystem/sep-0024.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Title: Hosted Deposit and Withdrawal
Author: SDF
Status: Active
Created: 2019-09-18
Updated: 2023-07-17
Version 3.3.0
Updated: 2023-10-20
Version 3.4.0
```

## Simple Summary
Expand Down Expand Up @@ -412,6 +412,7 @@ Request Parameters:
| `wallet_url` | string | (**deprecated**,optional) Anchor should link to this when notifying the user that the transaction has completed. However, anchors should use client_domain (for non-custodial) and `sub` value of JWT (for custodial) to determine wallet information. |
| `lang` | string | (optional) Defaults to `en` if not specified or if the specified language is not supported. Language code specified using [RFC 4646] which means it can also accept locale in the format `en-US`. `error` fields in the response, as well as the interactive flow UI and any other user-facing strings returned for this transaction should be in this language. |
| `claimable_balance_supported` | boolean | (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. |

When anchor receives a request, it can determine an origin of the request. First, it should check `client_domain` value
of the authentication token. If it's set, this wallet is an origin of the request. Otherwise, `sub` value of the JWT is
Expand Down Expand Up @@ -618,6 +619,7 @@ Request parameters:
| `lang` | string | (optional) Defaults to `en` if not specified or if the specified language is not supported. Language code specified using [RFC 4646] which means it can also accept locale in the format `en-US`. `error` fields in the response, as well as the interactive flow UI and any other user-facing strings returned for this transaction should be in this language. |
| `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. |

Additionally, any [SEP-9](sep-0009.md) parameters may be passed as well to make the onboarding experience simpler.

Expand Down Expand Up @@ -1386,9 +1388,10 @@ There is a small set of changes when upgrading from SEP-6 to SEP-24.

## Changelog

- `v3.4.0`: Add `customer_id` field to deposit and withdrawal requests ([#1410](https://github.com/stellar/stellar-protocol/pull/1410))
- `v3.3.0`: Add support for [SEP-38] API. Add optional `quote_id` parameter to `post /transactions/deposit/interactive`
and `POST /transactions/deposit/interactive` requests. Add `quote_id` to the transaction object schema. Deprecate `/fee` endpoint.
([#1358](https://github.com/stellar/stellar-protocol/pull/1358))
and `POST /transactions/deposit/interactive` requests. Add `quote_id` to the transaction object schema. Deprecate
`/fee` endpoint. ([#1358](https://github.com/stellar/stellar-protocol/pull/1358))
- `v3.2.0`: Deprecate the `wallet_name` and `wallet_url` parameters of `POST /transactions/deposit/interactive` and
`POST /transactions/withdrawal/interactive` requests ([#1364](https://github.com/stellar/stellar-protocol/pull/1364))
- `v3.1.0`: Add native asset support to SEP-24 ([#1363](https://github.com/stellar/stellar-protocol/pull/1363))
Expand Down

0 comments on commit 1abf481

Please sign in to comment.