Update: 2026-06-11 18:22:57
This commit is contained in:
@@ -45,30 +45,16 @@ class RateController extends GetxController {
|
||||
confirm: MyElevatedButton(title: 'Ok', onPressed: () => Get.back()));
|
||||
} else if (Get.find<PaymentController>().isWalletChecked == true) {
|
||||
double tip = 0;
|
||||
tip = (Get.find<RideLifecycleController>().totalPassenger) *
|
||||
tip = double.parse(Get.find<RideLifecycleController>().totalPassenger.toString()) *
|
||||
(double.parse(box.read(BoxName.tipPercentage).toString()));
|
||||
|
||||
if (tip > 0) {
|
||||
var res = await CRUD().post(link: AppLink.addTips, payload: {
|
||||
'passengerID': box.read(BoxName.passengerID),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
'driverID': Get.find<RideLifecycleController>().driverId.toString(),
|
||||
'rideID': Get.find<RideLifecycleController>().rideId.toString(),
|
||||
'tipAmount': tip.toString(),
|
||||
});
|
||||
await Get.find<PaymentController>()
|
||||
.addPassengersWallet(((-1) * tip).toString());
|
||||
var token1 = await Get.find<PaymentController>().generateTokenDriver(
|
||||
box.read(BoxName.countryCode) == 'Egypt'
|
||||
? tip.toStringAsFixed(0)
|
||||
: (tip * 100).toString());
|
||||
await CRUD().postWallet(link: AppLink.addDriversWalletPoints, payload: {
|
||||
'driverID': Get.find<RideLifecycleController>().driverId.toString(),
|
||||
'paymentID': '${Get.find<RideLifecycleController>().rideId}tip',
|
||||
'amount': box.read(BoxName.countryCode) == 'Egypt'
|
||||
? tip.toStringAsFixed(0)
|
||||
: (tip * 100).toString(),
|
||||
'paymentMethod': 'visa-tip',
|
||||
'token': token1,
|
||||
'country_code': box.read(BoxName.countryCode).toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
await NotificationService.sendNotification(
|
||||
@@ -76,7 +62,7 @@ class RateController extends GetxController {
|
||||
target: Get.find<RideLifecycleController>().driverToken.toString(),
|
||||
title: 'You Have Tips'.tr,
|
||||
body:
|
||||
'${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + (Get.find<RideLifecycleController>().totalPassenger)}',
|
||||
'${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + double.parse(Get.find<RideLifecycleController>().totalPassenger.toString())}',
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'ding',
|
||||
driverList: [],
|
||||
|
||||
Reference in New Issue
Block a user