MedicineOrder method

Future MedicineOrder()

Implementation

Future MedicineOrder() async {
  Map data = {
    "insert_id": orderid.toString(),
    // "cart": ordercart,
    "check_use_wallet": "${checkboxmedicin}",
    "user_package_id": "${userpackageIdmedicin}",
  };
  var body = jsonEncode(data);

  final response = await http.post(
    Uri.parse('${SDK_BASE_URL}api/api_medicine_1mg/medicine_order'),
    headers: {'Authorization': SignUpController.currentUserToken},
    body: body,
  );
  print('${response.body}order');
  var decodedResponse = json.decode(response.body);

  medicinecontroller.getpincodefromlocal();
  await UniversalCallBack().CallBackPayment(
      fromplace: 'medicine',
      userpackageIdmedicin: "${userpackageIdmedicin}",
      callbackurl:
          '${decodedResponse['results']['razorpay_details']['call_back_url']}',
      insertid: orderid.toString());
  Get.to(PaymentPopup(
    messag: '${decodedResponse['results']['message']}',
    image: '${LottiePath}Upload_Successful.json',
    fromplace: 'medicine',
  ));
}