mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
Merge pull request #5797 from BlueWallet/fix-azteco
FIX: azteco voucher updated uri format
This commit is contained in:
commit
27ee1739c4
@ -30,6 +30,18 @@ export default class Azteco {
|
||||
|
||||
static getParamsFromUrl(u) {
|
||||
const urlObject = URL.parse(u, true); // eslint-disable-line n/no-deprecated-api
|
||||
|
||||
if (urlObject.query.code) {
|
||||
// newer format of the url
|
||||
return {
|
||||
uri: u,
|
||||
c1: urlObject.query.code.substring(0, 4),
|
||||
c2: urlObject.query.code.substring(4, 8),
|
||||
c3: urlObject.query.code.substring(8, 12),
|
||||
c4: urlObject.query.code.substring(12, 16),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
uri: u,
|
||||
c1: urlObject.query.c1,
|
||||
|
@ -172,6 +172,18 @@ describe.each(['', '//'])('unit - DeepLinkSchemaMatch', function (suffix) {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
argument: {
|
||||
url: 'https://azte.co/redeem?code=1111222233334444',
|
||||
},
|
||||
expected: [
|
||||
'AztecoRedeemRoot',
|
||||
{
|
||||
screen: 'AztecoRedeem',
|
||||
params: { c1: '1111', c2: '2222', c3: '3333', c4: '4444', uri: 'https://azte.co/redeem?code=1111222233334444' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
argument: {
|
||||
url: 'https://azte.co/?c1=3062&c2=2586&c3=5053&c4=5261',
|
||||
|
Loading…
Reference in New Issue
Block a user