use _buildUri in redirect

This commit is contained in:
sneurlax 2023-01-25 11:13:00 -06:00
parent a223f735a2
commit 74f783391b

View file

@ -290,9 +290,17 @@ class SimplexAPI {
Future<BuyResponse<bool>> redirect(SimplexOrder order) async {
try {
Map<String, String> headers = {
'Content-Type': 'application/x-www-form-urlencoded',
};
Map<String, String> data = {
'ROUTE': 'redirect',
'PAYMENT_ID': order.paymentId,
};
Uri url = _buildUri('api.php', data);
bool status = await launchUrl(
Uri.parse(
"https://simplex-sandbox.stackwallet.com/api.php?ROUTE=redirect&PAYMENT_ID=${order.paymentId}"),
url,
mode: LaunchMode.externalApplication,
);