I am creating a multi-stage booking process in Umbraco. As part of this I have a value in my model called stage. Depending on this value, my view will output a different set of fields in my form.
Towards the end of the process, I have a form that collects credit card details. These details are sent to a payment provider immediately and then destroyed. At least this is what I want to happen but the model fails to clear correctly.
In my controller i do the following:
if(bookingSuccess){
// Move to the next stage of the booking process
}else{
TempData["notification"] = "There was an error processing your booking. You have not been charged.";
model.Stage = 2;
model.Passenger_Details.cc_Number = string.Empty;
}
return View(model);
As you can see, if there is an error making the booking with the third party provider, I set the model stage back to where the card details were captured (stage 2) and then I attempt the reset the value stored in the model for the credit card number so that we force the user to re-enter these details. The CCV number is find because this is set as a password field and is does not get remembered anyway.
My problem is, this does not work. If the booking fails, it successfully returns me to stage 2 of the booking process but the card details are still populated.
What is the best way to remove these details and force the user to re-enter them?
Model values failing to be clear
Hi all,
I am creating a multi-stage booking process in Umbraco. As part of this I have a value in my model called stage. Depending on this value, my view will output a different set of fields in my form.
Towards the end of the process, I have a form that collects credit card details. These details are sent to a payment provider immediately and then destroyed. At least this is what I want to happen but the model fails to clear correctly.
In my controller i do the following:
As you can see, if there is an error making the booking with the third party provider, I set the model stage back to where the card details were captured (stage 2) and then I attempt the reset the value stored in the model for the credit card number so that we force the user to re-enter these details. The CCV number is find because this is set as a password field and is does not get remembered anyway.
My problem is, this does not work. If the booking fails, it successfully returns me to stage 2 of the booking process but the card details are still populated.
What is the best way to remove these details and force the user to re-enter them?
is working on a reply...