redeemCoins method

Future<Response> redeemCoins({
  1. required double coin,
  2. required String upiId,
})

To redeem user coins in whitelabel app user needs to use below API

Implementation

Future<http.Response> redeemCoins(
    {required double coin, required String upiId}) async {
  Uri url = Uri.parse("$_baseUrl/coin/redeem/create");

  final body = jsonEncode({
    "coin": coin,
    "upi_id": upiId,
  });

  http.Response response = await http.Client()
      .post(url, body: body, headers: kAuthenticatedPostRequestHeader);

  if (response.statusCode == 200) {
    printMessage("REDEEM COINS RESPONSE = ${response.statusCode}");
    return response;
  } else {
    printMessage("REDEEM COINS RESPONSE = ${response.statusCode}");
    printMessage("REDEEM COINS RESPONSE = ${response.body}");
    return response;
  }
}