In my application, the registration of user happens after payment. So i used paypal for payment. When registration form submits, in actionCreate() check the model is post and validation. If that succeed it redirect to paypal( calling paypal function) inside the create(). After successful transaction, the page redirect and call another function for saving form data to the database. How can i perform this…?
Check the model is post and the validation of fields in form-in two different functions of same controller?
Why not save the record to the database with a flag which can be set once payment has been verified? Insert the record with the "verified" flag set to false, then update the flag to true in the next request if payment was taken successfully.
If you don’t want to have an extra flag or have unpaid records in the table, you could save the user’s data to a separate table for users pending payment and move the record over when payment is confirmed.