mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-25 19:55:52 +00:00
pass signup time to api
This commit is contained in:
parent
74f783391b
commit
c929ea5f75
1 changed files with 10 additions and 4 deletions
|
@ -250,18 +250,20 @@ class SimplexAPI {
|
||||||
};
|
};
|
||||||
Map<String, String> data = {
|
Map<String, String> data = {
|
||||||
'ROUTE': 'order',
|
'ROUTE': 'order',
|
||||||
'QUOTE_ID': "${quote.id}",
|
'QUOTE_ID': quote.id,
|
||||||
'ADDRESS': "${quote.receivingAddress}",
|
'ADDRESS': quote.receivingAddress,
|
||||||
'CRYPTO_TICKER': "${quote.crypto.ticker.toUpperCase()}",
|
'CRYPTO_TICKER': quote.crypto.ticker.toUpperCase(),
|
||||||
};
|
};
|
||||||
if (userID != null) {
|
if (userID != null) {
|
||||||
data['USER_ID'] = userID;
|
data['USER_ID'] = userID;
|
||||||
}
|
}
|
||||||
if (signupEpoch != null && signupEpoch != 0) {
|
if (signupEpoch != null && signupEpoch != 0) {
|
||||||
|
DateTime date = DateTime.fromMillisecondsSinceEpoch(signupEpoch * 1000);
|
||||||
data['SIGNUP_TIMESTAMP'] =
|
data['SIGNUP_TIMESTAMP'] =
|
||||||
"${DateTime.fromMillisecondsSinceEpoch(signupEpoch * 1000)}";
|
date.toIso8601String() + timeZoneFormatter(date.timeZoneOffset);
|
||||||
}
|
}
|
||||||
Uri url = _buildUri('api.php', data);
|
Uri url = _buildUri('api.php', data);
|
||||||
|
print(data);
|
||||||
|
|
||||||
var res = await http.get(url, headers: headers);
|
var res = await http.get(url, headers: headers);
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
|
@ -323,4 +325,8 @@ class SimplexAPI {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See https://github.com/dart-lang/sdk/issues/43391#issuecomment-1229656422
|
||||||
|
String timeZoneFormatter(Duration offset) =>
|
||||||
|
"${offset.isNegative ? "-" : "+"}${offset.inHours.abs().toString().padLeft(2, "0")}:${(offset.inMinutes - offset.inHours * 60).abs().toString().padLeft(2, "0")}";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue