Closed davidyuk closed 3 years ago
In some cases (like usage of vue-router) it is easier to accept parameters in a path instead of a query. We can use URL templates to allow the vendor to set a way how parameters should be inlined into a callback URL. For example, this request:
aeternity:ak_.../125.12/myaeshop?callback=https://myaeshop.com/verify/{txId}/
can redirect the user to
https://myaeshop.com/verify/th_.../
This approach supports the initial proposal as well:
aeternity:ak_.../125.12/myaeshop?callback=https://myaeshop.com/verify?txId={txId} => https://myaeshop.com/verify?txId=th_...
Also, this approach can help to get rid of the return param in "Sign and Broadcast" method by passing it in the template.
return
I'm not sure how placeholders can be encoded into URL, I have to approaches:
In both cases, special chars like %, {, and } should be encoded to %25, %7B, and %7D correspondingly and then be decoded by a wallet.
%
{
}
%25
%7B
%7D
no longer relevant, AEX-4 is withdrawn
In some cases (like usage of vue-router) it is easier to accept parameters in a path instead of a query. We can use URL templates to allow the vendor to set a way how parameters should be inlined into a callback URL. For example, this request:
can redirect the user to
This approach supports the initial proposal as well:
Also, this approach can help to get rid of the
return
param in "Sign and Broadcast" method by passing it in the template.I'm not sure how placeholders can be encoded into URL, I have to approaches:
In both cases, special chars like
%
,{
, and}
should be encoded to%25
,%7B
, and%7D
correspondingly and then be decoded by a wallet.