I'm creating a new payment gateway at my store, and now running some tests. The gateway I used as sample was eway30, then I created my gateway called Braspag.
So, the payment process seems to be ok, but something isn't right (ok, if it was ok I didn't need to contact you).
My main changes are at the process_payment function, where I use my personal payment gateway and on the tests it seems to be ok. When find some error at the payment process, it calls the function:
$mp->cart_checkout_error( __('', 'mp').' ('.$lblError.')' );
and after that: return false
So, It is working fine.
My question is:
If it has some error at the payment, the course was added to the "Dashboard -> My Courses" page.
What function do I need to call to don't add the course when the payment wasn't aproved?