Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update spec adding separator to amount with currency
Browse files Browse the repository at this point in the history
lsunsi committed Dec 6, 2023

Unverified

This user has not yet uploaded their public signing key.
1 parent 5f0ea3a commit 7bf8f3a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 21.md
Original file line number Diff line number Diff line change
@@ -82,12 +82,12 @@ The most general case, when the user is denominating the amount in `CURRENCY1`,
`CURRENCY1` and `CURRENCY2` can be the same, which would the common use case for remittances.
```diff
- <callback><?|&>amount=<milliSatoshi>
+ <callback><?|&>amount=<AMOUNT><CURRENCY1>&convert=<CURRENCY2>
+ <callback><?|&>amount=<AMOUNT>.<CURRENCY1>&convert=<CURRENCY2>

In a more particular case, when user is denominating the amount in `CURRENCY`, but does not want to convert it or the service does not support conversion.
```diff
- <callback><?|&>amount=<milliSatoshi>
+ <callback><?|&>amount=<AMOUNT><CURRENCY>
+ <callback><?|&>amount=<AMOUNT>.<CURRENCY>
```

In another particular case, when the user is denominating the amount in millisatoshi, but wants it to be converted to `CURRENCY` on `SERVICE`.
@@ -174,30 +174,30 @@ These examples show all the possible uses of this extension by a supporting `WAL
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC as BTC
```json
// GET bipa.app/callback?amount=100BRL
// GET bipa.app/callback?amount=100.BRL
{
"pr": "(invoice of 538 sats)"
}
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC as BRL
```json
// GET bipa.app/callback?amount=100BRL&convert=BRL
// GET bipa.app/callback?amount=100.BRL&convert=BRL
{
"pr": "(invoice of 538 sats)",
"converted": 100
}
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC as USDT (20 cents of USDT)
```json
// GET bipa.app/callback?amount=100BRL&convert=USDT
// GET bipa.app/callback?amount=100.BRL&convert=USDT
{
"pr": "(invoice of 538 sats)",
"converted": 200000
}
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC to unsupported
```json
// GET bipa.app/callback?amount=100BRL
// GET bipa.app/callback?amount=100.BRL
// ERROR, because 100BRL is not a number and can't
// be interpret as milisatoshis by the unsupported service.
```

0 comments on commit 7bf8f3a

Please sign in to comment.